diff --git a/gapic-libraries-bom/pom.xml b/gapic-libraries-bom/pom.xml index b54e4e65a899..e1a604f58a57 100644 --- a/gapic-libraries-bom/pom.xml +++ b/gapic-libraries-bom/pom.xml @@ -1022,6 +1022,13 @@ pom import + + com.google.cloud + google-cloud-workstations-bom + 0.0.1-SNAPSHOT + pom + import + com.google.cloud google-cloud-dns diff --git a/java-accessapproval/README.md b/java-accessapproval/README.md index d3eeef613ee9..be70127ea920 100644 --- a/java-accessapproval/README.md +++ b/java-accessapproval/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Access Approval][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-accessapproval" % "2.13.0" ``` + ## Authentication diff --git a/java-accesscontextmanager/README.md b/java-accesscontextmanager/README.md index 88607bda3ebb..4f52d91426f6 100644 --- a/java-accesscontextmanager/README.md +++ b/java-accesscontextmanager/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Identity Access Context Manager][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-identity-accesscontextmanager" % "1.13.0" ``` + ## Authentication diff --git a/java-aiplatform/README.md b/java-aiplatform/README.md index a839d7994183..ca7f605192b5 100644 --- a/java-aiplatform/README.md +++ b/java-aiplatform/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Vertex AI][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-aiplatform" % "3.13.0" ``` + ## Authentication diff --git a/java-alloydb/README.md b/java-alloydb/README.md index de4e72d1b7fa..0b8683e3ceb4 100644 --- a/java-alloydb/README.md +++ b/java-alloydb/README.md @@ -17,6 +17,7 @@ Java idiomatic client for [AlloyDB][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -37,6 +38,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-alloydb" % "0.1.0" ``` + ## Authentication diff --git a/java-api-gateway/README.md b/java-api-gateway/README.md index f25a1f318ee7..43075b0e2a1f 100644 --- a/java-api-gateway/README.md +++ b/java-api-gateway/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [API Gateway][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-api-gateway" % "2.12.0" ``` + ## Authentication diff --git a/java-apigee-connect/README.md b/java-apigee-connect/README.md index b977e0cce8ab..23a757a6c946 100644 --- a/java-apigee-connect/README.md +++ b/java-apigee-connect/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Apigee Connect][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-apigee-connect" % "2.12.0" ``` + ## Authentication diff --git a/java-apigee-registry/README.md b/java-apigee-registry/README.md index aceee97acc03..045a043affa2 100644 --- a/java-apigee-registry/README.md +++ b/java-apigee-registry/README.md @@ -17,6 +17,7 @@ Java idiomatic client for [Registry API][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -37,6 +38,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-apigee-registry" % "0.12.0" ``` + ## Authentication diff --git a/java-apikeys/README.md b/java-apikeys/README.md index 8571f6d3deec..f4832b666c51 100644 --- a/java-apikeys/README.md +++ b/java-apikeys/README.md @@ -17,6 +17,7 @@ Java idiomatic client for [API Keys API][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -37,6 +38,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-apikeys" % "0.10.0" ``` + ## Authentication diff --git a/java-appengine-admin/README.md b/java-appengine-admin/README.md index 08787e393ebe..62c9d9c5b8a4 100644 --- a/java-appengine-admin/README.md +++ b/java-appengine-admin/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [App Engine Admin API][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-appengine-admin" % "2.12.0" ``` + ## Authentication diff --git a/java-area120-tables/README.md b/java-area120-tables/README.md index b728ffcbe9e0..d0f9d3ee8f11 100644 --- a/java-area120-tables/README.md +++ b/java-area120-tables/README.md @@ -17,6 +17,7 @@ Java idiomatic client for [Area 120 Tables][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -37,6 +38,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.area120" % "google-area120-tables" % "0.16.0" ``` + ## Authentication diff --git a/java-artifact-registry/README.md b/java-artifact-registry/README.md index 0a9d1cf762ce..d0c526067585 100644 --- a/java-artifact-registry/README.md +++ b/java-artifact-registry/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Artifact Registry][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-artifact-registry" % "1.11.0" ``` + ## Authentication diff --git a/java-asset/README.md b/java-asset/README.md index 6a57544f9dc9..43fd52ba1a31 100644 --- a/java-asset/README.md +++ b/java-asset/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Cloud Asset Inventory][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-asset" % "3.16.0" ``` + ## Authentication diff --git a/java-assured-workloads/README.md b/java-assured-workloads/README.md index b9bd7b927332..a5492006e0f2 100644 --- a/java-assured-workloads/README.md +++ b/java-assured-workloads/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Assured Workloads for Government][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-assured-workloads" % "2.12.0" ``` + ## Authentication diff --git a/java-automl/README.md b/java-automl/README.md index d2f0f7db9361..9da04b080cac 100644 --- a/java-automl/README.md +++ b/java-automl/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Cloud Auto ML][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-automl" % "2.12.0" ``` + ## Authentication diff --git a/java-batch/README.md b/java-batch/README.md index 8eb706827cd8..707b1612c23c 100644 --- a/java-batch/README.md +++ b/java-batch/README.md @@ -17,6 +17,7 @@ Java idiomatic client for [Cloud Batch][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -37,6 +38,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-batch" % "0.12.0" ``` + ## Authentication diff --git a/java-bigqueryconnection/README.md b/java-bigqueryconnection/README.md index 058000eb5486..c7d73320979d 100644 --- a/java-bigqueryconnection/README.md +++ b/java-bigqueryconnection/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Cloud BigQuery Connection][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-bigqueryconnection" % "2.14.0" ``` + ## Authentication diff --git a/java-bigquerydatatransfer/README.md b/java-bigquerydatatransfer/README.md index c094787d4ef9..14703900bcfa 100644 --- a/java-bigquerydatatransfer/README.md +++ b/java-bigquerydatatransfer/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [BigQuery Data Transfer Service][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-bigquerydatatransfer" % "2.12.0" ``` + ## Authentication diff --git a/java-bigquerymigration/README.md b/java-bigquerymigration/README.md index 6478cb9c836e..2d5e0cf651bf 100644 --- a/java-bigquerymigration/README.md +++ b/java-bigquerymigration/README.md @@ -17,6 +17,7 @@ Java idiomatic client for [BigQuery Migration][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -37,6 +38,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-bigquerymigration" % "0.15.0" ``` + ## Authentication diff --git a/java-billing/README.md b/java-billing/README.md index 384a18541196..040f01b274c3 100644 --- a/java-billing/README.md +++ b/java-billing/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Cloud Billing][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-billing" % "2.12.0" ``` + ## Authentication diff --git a/java-billingbudgets/README.md b/java-billingbudgets/README.md index fd72ceefb448..233c0dc5d659 100644 --- a/java-billingbudgets/README.md +++ b/java-billingbudgets/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Cloud Billing Budgets][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-billingbudgets" % "2.12.0" ``` + ## Authentication diff --git a/java-binary-authorization/README.md b/java-binary-authorization/README.md index 5cca3764adcd..03f97974f531 100644 --- a/java-binary-authorization/README.md +++ b/java-binary-authorization/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Binary Authorization][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-binary-authorization" % "1.11.0" ``` + ## Authentication diff --git a/java-certificate-manager/README.md b/java-certificate-manager/README.md index 227e8818fd8f..7f57ceba0239 100644 --- a/java-certificate-manager/README.md +++ b/java-certificate-manager/README.md @@ -17,6 +17,7 @@ Java idiomatic client for [Certificate Manager][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -37,6 +38,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-certificate-manager" % "0.15.0" ``` + ## Authentication diff --git a/java-channel/README.md b/java-channel/README.md index 4cb5eecf69e3..eabd47ec268d 100644 --- a/java-channel/README.md +++ b/java-channel/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Channel Services][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-channel" % "3.16.0" ``` + ## Authentication diff --git a/java-cloudbuild/README.md b/java-cloudbuild/README.md index 044d55a10ef8..61d25647e028 100644 --- a/java-cloudbuild/README.md +++ b/java-cloudbuild/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Cloud Build][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-build" % "3.14.0" ``` + ## Authentication diff --git a/java-cloudcommerceconsumerprocurement/README.md b/java-cloudcommerceconsumerprocurement/README.md index 2b179dce56b7..7c78287fe507 100644 --- a/java-cloudcommerceconsumerprocurement/README.md +++ b/java-cloudcommerceconsumerprocurement/README.md @@ -17,6 +17,7 @@ Java idiomatic client for [Cloud Commerce Consumer Procurement][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -37,6 +38,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-cloudcommerceconsumerprocurement" % "0.10.0" ``` + ## Authentication diff --git a/java-contact-center-insights/README.md b/java-contact-center-insights/README.md index a1a23b875947..53aa060d86e0 100644 --- a/java-contact-center-insights/README.md +++ b/java-contact-center-insights/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [CCAI Insights][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-contact-center-insights" % "2.12.0" ``` + ## Authentication diff --git a/java-container/README.md b/java-container/README.md index 7a85e4b66d76..e71c5c1d6c09 100644 --- a/java-container/README.md +++ b/java-container/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Kubernetes Engine][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-container" % "2.15.0" ``` + ## Authentication diff --git a/java-data-fusion/README.md b/java-data-fusion/README.md index bddff11b115d..48e4832a03e5 100644 --- a/java-data-fusion/README.md +++ b/java-data-fusion/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Cloud Data Fusion][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-data-fusion" % "1.12.0" ``` + ## Authentication diff --git a/java-datacatalog/README.md b/java-datacatalog/README.md index cf26344d6ff9..8a1cec379813 100644 --- a/java-datacatalog/README.md +++ b/java-datacatalog/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Data Catalog][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-datacatalog" % "1.18.0" ``` + ## Authentication diff --git a/java-datalabeling/README.md b/java-datalabeling/README.md index c8b34c1d8474..35779657804f 100644 --- a/java-datalabeling/README.md +++ b/java-datalabeling/README.md @@ -17,6 +17,7 @@ Java idiomatic client for [Data Labeling][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -37,6 +38,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-datalabeling" % "0.132.0" ``` + ## Authentication diff --git a/java-datalineage/README.md b/java-datalineage/README.md index 60b831198860..113033a2fddd 100644 --- a/java-datalineage/README.md +++ b/java-datalineage/README.md @@ -17,6 +17,7 @@ Java idiomatic client for [Data Lineage][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -37,6 +38,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-datalineage" % "0.4.0" ``` + ## Authentication diff --git a/java-dataplex/README.md b/java-dataplex/README.md index eb15b7997275..88a5daed8c6e 100644 --- a/java-dataplex/README.md +++ b/java-dataplex/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Cloud Dataplex][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-dataplex" % "1.10.0" ``` + ## Authentication diff --git a/java-dataproc-metastore/README.md b/java-dataproc-metastore/README.md index 9e27894ce6ba..1d8ea97f92e8 100644 --- a/java-dataproc-metastore/README.md +++ b/java-dataproc-metastore/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Dataproc Metastore][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-dataproc-metastore" % "2.13.0" ``` + ## Authentication diff --git a/java-dataproc/README.md b/java-dataproc/README.md index d97a539324fb..04e27fcd2261 100644 --- a/java-dataproc/README.md +++ b/java-dataproc/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Dataproc][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-dataproc" % "4.9.0" ``` + ## Authentication diff --git a/java-datastream/README.md b/java-datastream/README.md index 652ad8509286..17a2c137c17a 100644 --- a/java-datastream/README.md +++ b/java-datastream/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Datastream][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-datastream" % "1.11.0" ``` + ## Authentication diff --git a/java-debugger-client/README.md b/java-debugger-client/README.md index d34258b8d7ec..8d40d7fa0821 100644 --- a/java-debugger-client/README.md +++ b/java-debugger-client/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Cloud Debugger][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-debugger-client" % "1.12.0" ``` + ## Authentication diff --git a/java-dialogflow-cx/README.md b/java-dialogflow-cx/README.md index 3153467981d4..608661b153cc 100644 --- a/java-dialogflow-cx/README.md +++ b/java-dialogflow-cx/README.md @@ -17,6 +17,7 @@ Java idiomatic client for [Dialogflow CX][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -37,6 +38,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-dialogflow-cx" % "0.23.0" ``` + ## Authentication diff --git a/java-dialogflow/README.md b/java-dialogflow/README.md index bae5f21006d4..f974479b7619 100644 --- a/java-dialogflow/README.md +++ b/java-dialogflow/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Dialogflow API][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-dialogflow" % "4.18.0" ``` + ## Authentication diff --git a/java-distributedcloudedge/README.md b/java-distributedcloudedge/README.md index 7097a4882048..c1618a9a0c4f 100644 --- a/java-distributedcloudedge/README.md +++ b/java-distributedcloudedge/README.md @@ -17,6 +17,7 @@ Java idiomatic client for [Google Distributed Cloud Edge][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -37,6 +38,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-distributedcloudedge" % "0.9.0" ``` + ## Authentication diff --git a/java-dlp/README.md b/java-dlp/README.md index 67651c790779..495079b5e95c 100644 --- a/java-dlp/README.md +++ b/java-dlp/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Cloud Data Loss Prevention][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-dlp" % "3.16.0" ``` + ## Authentication diff --git a/java-dms/README.md b/java-dms/README.md index aadb53e6b982..309bb57cbd67 100644 --- a/java-dms/README.md +++ b/java-dms/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Database Migration Service][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-dms" % "2.11.0" ``` + ## Authentication diff --git a/java-document-ai/README.md b/java-document-ai/README.md index 20ca4de22e65..8ebecd8c5412 100644 --- a/java-document-ai/README.md +++ b/java-document-ai/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Document AI][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-document-ai" % "2.16.0" ``` + ## Authentication diff --git a/java-errorreporting/README.md b/java-errorreporting/README.md index ad0a2b41eaab..1a639d830f4a 100644 --- a/java-errorreporting/README.md +++ b/java-errorreporting/README.md @@ -17,6 +17,7 @@ Java idiomatic client for [Error Reporting][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -37,6 +38,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-errorreporting" % "0.133.0-beta" ``` + ## Authentication diff --git a/java-essential-contacts/README.md b/java-essential-contacts/README.md index 452b4678d5ac..06d6ad6d04ef 100644 --- a/java-essential-contacts/README.md +++ b/java-essential-contacts/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Essential Contacts API][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-essential-contacts" % "2.12.0" ``` + ## Authentication diff --git a/java-filestore/README.md b/java-filestore/README.md index f9d1200f66dc..8dcd0d9a0eff 100644 --- a/java-filestore/README.md +++ b/java-filestore/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Cloud Filestore API][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-filestore" % "1.13.0" ``` + ## Authentication diff --git a/java-game-servers/README.md b/java-game-servers/README.md index 9c24cf84fd3f..3103965add4f 100644 --- a/java-game-servers/README.md +++ b/java-game-servers/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Cloud Gaming][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-game-servers" % "2.12.0" ``` + ## Authentication diff --git a/java-gke-connect-gateway/README.md b/java-gke-connect-gateway/README.md index 0d22277b9f84..409127b1292c 100644 --- a/java-gke-connect-gateway/README.md +++ b/java-gke-connect-gateway/README.md @@ -17,6 +17,7 @@ Java idiomatic client for [Connect Gateway API][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -37,6 +38,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-gke-connect-gateway" % "0.13.0" ``` + ## Authentication diff --git a/java-gkehub/README.md b/java-gkehub/README.md index 885dcc9ef9ac..92f6033915d0 100644 --- a/java-gkehub/README.md +++ b/java-gkehub/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [GKE Hub API][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-gkehub" % "1.12.0" ``` + ## Authentication diff --git a/java-grafeas/README.md b/java-grafeas/README.md index 94a24aaa8ec0..b2258b7124e4 100644 --- a/java-grafeas/README.md +++ b/java-grafeas/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Grafeas][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "io.grafeas" % "grafeas" % "2.13.0" ``` + ## Authentication diff --git a/java-gsuite-addons/README.md b/java-gsuite-addons/README.md index 01d848c79ffd..70550228a1c8 100644 --- a/java-gsuite-addons/README.md +++ b/java-gsuite-addons/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Google Workspace Add-ons API][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-gsuite-addons" % "2.12.0" ``` + ## Authentication diff --git a/java-iamcredentials/README.md b/java-iamcredentials/README.md index e41cc33d66f6..aee981599e6c 100644 --- a/java-iamcredentials/README.md +++ b/java-iamcredentials/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [IAM Service Account Credentials API][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-iamcredentials" % "2.12.0" ``` + ## Authentication diff --git a/java-iot/README.md b/java-iot/README.md index da6a456c58d7..9347eaabc96c 100644 --- a/java-iot/README.md +++ b/java-iot/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Cloud Internet of Things (IoT) Core][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-iot" % "2.12.0" ``` + ## Authentication diff --git a/java-kms/README.md b/java-kms/README.md index 96ccdc36e9dd..c78db1c72484 100644 --- a/java-kms/README.md +++ b/java-kms/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Cloud Key Management Service][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-kms" % "2.15.0" ``` + ## Authentication diff --git a/java-life-sciences/README.md b/java-life-sciences/README.md index 3c74bf85228d..afbea2847e06 100644 --- a/java-life-sciences/README.md +++ b/java-life-sciences/README.md @@ -17,6 +17,7 @@ Java idiomatic client for [Cloud Life Sciences][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -37,6 +38,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-life-sciences" % "0.14.0" ``` + ## Authentication diff --git a/java-managed-identities/README.md b/java-managed-identities/README.md index 4c1c57f0d02f..a20a469da50a 100644 --- a/java-managed-identities/README.md +++ b/java-managed-identities/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Managed Service for Microsoft Active Directory][produ If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-managed-identities" % "1.10.0" ``` + ## Authentication diff --git a/java-maps-routing/README.md b/java-maps-routing/README.md index 504c82ddf11e..28638868ea70 100644 --- a/java-maps-routing/README.md +++ b/java-maps-routing/README.md @@ -17,6 +17,7 @@ Java idiomatic client for [Routes API][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -37,6 +38,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.maps" % "google-maps-routing" % "0.6.0" ``` + ## Authentication diff --git a/java-mediatranslation/README.md b/java-mediatranslation/README.md index 888e6237371f..22f662722bb2 100644 --- a/java-mediatranslation/README.md +++ b/java-mediatranslation/README.md @@ -17,6 +17,7 @@ Java idiomatic client for [Media Translation API][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -37,6 +38,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-mediatranslation" % "0.18.0" ``` + ## Authentication diff --git a/java-memcache/README.md b/java-memcache/README.md index 4532a814ea50..9e538543d364 100644 --- a/java-memcache/README.md +++ b/java-memcache/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Cloud Memcache][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-memcache" % "2.12.0" ``` + ## Authentication diff --git a/java-network-management/README.md b/java-network-management/README.md index d7c63c933686..402ff0855be5 100644 --- a/java-network-management/README.md +++ b/java-network-management/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Network Management API][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-network-management" % "1.13.0" ``` + ## Authentication diff --git a/java-network-security/README.md b/java-network-security/README.md index f7de484d3889..9c0a24bf06db 100644 --- a/java-network-security/README.md +++ b/java-network-security/README.md @@ -17,6 +17,7 @@ Java idiomatic client for [Network Security API][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -37,6 +38,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-network-security" % "0.15.0" ``` + ## Authentication diff --git a/java-networkconnectivity/README.md b/java-networkconnectivity/README.md index 6eb66df7cdaf..fa8bb17cc96d 100644 --- a/java-networkconnectivity/README.md +++ b/java-networkconnectivity/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Network Connectivity Center][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-networkconnectivity" % "1.11.0" ``` + ## Authentication diff --git a/java-notebooks/README.md b/java-notebooks/README.md index 16083259b4ba..901cbcf972bd 100644 --- a/java-notebooks/README.md +++ b/java-notebooks/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [AI Platform Notebooks][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-notebooks" % "1.10.0" ``` + ## Authentication diff --git a/java-optimization/README.md b/java-optimization/README.md index 12c5a5944673..fb80aabdbb3a 100644 --- a/java-optimization/README.md +++ b/java-optimization/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Cloud Fleet Routing][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-optimization" % "1.10.0" ``` + ## Authentication diff --git a/java-orchestration-airflow/README.md b/java-orchestration-airflow/README.md index 3775479a037c..a39962266309 100644 --- a/java-orchestration-airflow/README.md +++ b/java-orchestration-airflow/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Cloud Composer][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-orchestration-airflow" % "1.12.0" ``` + ## Authentication diff --git a/java-os-config/README.md b/java-os-config/README.md index f3fb9da5c2f8..54fe5b62a89e 100644 --- a/java-os-config/README.md +++ b/java-os-config/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [OS Config API][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-os-config" % "2.14.0" ``` + ## Authentication diff --git a/java-os-login/README.md b/java-os-login/README.md index eb662523e8e6..cc32a2a69e4c 100644 --- a/java-os-login/README.md +++ b/java-os-login/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Cloud OS Login][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-os-login" % "2.11.0" ``` + ## Authentication diff --git a/java-phishingprotection/README.md b/java-phishingprotection/README.md index 85200df67fbd..7fc9ecdbdc4c 100644 --- a/java-phishingprotection/README.md +++ b/java-phishingprotection/README.md @@ -17,6 +17,7 @@ Java idiomatic client for [Phishing Protection][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -37,6 +38,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-phishingprotection" % "0.43.0" ``` + ## Authentication diff --git a/java-policy-troubleshooter/README.md b/java-policy-troubleshooter/README.md index 80ee95872f15..fe5a33f83dbe 100644 --- a/java-policy-troubleshooter/README.md +++ b/java-policy-troubleshooter/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [IAM Policy Troubleshooter API][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-policy-troubleshooter" % "1.11.0" ``` + ## Authentication diff --git a/java-private-catalog/README.md b/java-private-catalog/README.md index 7af16648233c..fb3bc7971b73 100644 --- a/java-private-catalog/README.md +++ b/java-private-catalog/README.md @@ -17,6 +17,7 @@ Java idiomatic client for [Private Catalog][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -37,6 +38,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-private-catalog" % "0.14.0" ``` + ## Authentication diff --git a/java-profiler/README.md b/java-profiler/README.md index 5448c554f058..d81c60d97d7a 100644 --- a/java-profiler/README.md +++ b/java-profiler/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Cloud Profiler][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-profiler" % "2.12.0" ``` + ## Authentication diff --git a/java-publicca/README.md b/java-publicca/README.md index 3239069eb575..a7a8f5a6b486 100644 --- a/java-publicca/README.md +++ b/java-publicca/README.md @@ -17,6 +17,7 @@ Java idiomatic client for [Public Certificate Authority][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -37,6 +38,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-publicca" % "0.9.0" ``` + ## Authentication diff --git a/java-recaptchaenterprise/README.md b/java-recaptchaenterprise/README.md index e5198229f0ad..f83738527550 100644 --- a/java-recaptchaenterprise/README.md +++ b/java-recaptchaenterprise/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [reCAPTCHA Enterprise][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-recaptchaenterprise" % "3.9.0" ``` + ## Authentication diff --git a/java-recommendations-ai/README.md b/java-recommendations-ai/README.md index 66dfb8a2e0a8..2113b23cceeb 100644 --- a/java-recommendations-ai/README.md +++ b/java-recommendations-ai/README.md @@ -18,6 +18,7 @@ Java idiomatic client for [Recommendations AI][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -38,6 +39,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-recommendations-ai" % "0.19.0" ``` + ## Authentication diff --git a/java-redis/README.md b/java-redis/README.md index ad19315865fb..c7a1becb1fce 100644 --- a/java-redis/README.md +++ b/java-redis/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Cloud Redis][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-redis" % "2.15.0" ``` + ## Authentication diff --git a/java-resource-settings/README.md b/java-resource-settings/README.md index f10263ff1571..5565bbbd2851 100644 --- a/java-resource-settings/README.md +++ b/java-resource-settings/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Resource Settings API][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-resource-settings" % "1.12.0" ``` + ## Authentication diff --git a/java-resourcemanager/README.md b/java-resourcemanager/README.md index f6de4af99421..adc8d5c74767 100644 --- a/java-resourcemanager/README.md +++ b/java-resourcemanager/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Resource Manager API][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-resourcemanager" % "1.14.0" ``` + ## Authentication diff --git a/java-retail/README.md b/java-retail/README.md index c37f690eab43..802f30ac6092 100644 --- a/java-retail/README.md +++ b/java-retail/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Cloud Retail][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-retail" % "2.14.0" ``` + ## Authentication diff --git a/java-run/README.md b/java-run/README.md index db69b52b252b..267ce3d79b95 100644 --- a/java-run/README.md +++ b/java-run/README.md @@ -17,6 +17,7 @@ Java idiomatic client for [Cloud Run][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -37,6 +38,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-run" % "0.12.0" ``` + ## Authentication diff --git a/java-scheduler/README.md b/java-scheduler/README.md index 013fc43fe6ef..94b21859e1ee 100644 --- a/java-scheduler/README.md +++ b/java-scheduler/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Google Cloud Scheduler][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-scheduler" % "2.12.0" ``` + ## Authentication diff --git a/java-secretmanager/README.md b/java-secretmanager/README.md index 5b16edc02c47..33b7544d9c67 100644 --- a/java-secretmanager/README.md +++ b/java-secretmanager/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Secret Management][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-secretmanager" % "2.12.0" ``` + ## Authentication diff --git a/java-security-private-ca/README.md b/java-security-private-ca/README.md index e31545c8baea..c274453cf810 100644 --- a/java-security-private-ca/README.md +++ b/java-security-private-ca/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Certificate Authority Service][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-security-private-ca" % "2.14.0" ``` + ## Authentication diff --git a/java-securitycenter-settings/README.md b/java-securitycenter-settings/README.md index 6c0fe08d4d16..ce671f4e91c2 100644 --- a/java-securitycenter-settings/README.md +++ b/java-securitycenter-settings/README.md @@ -17,6 +17,7 @@ Java idiomatic client for [Security Command Center Settings API][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -37,6 +38,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-securitycenter-settings" % "0.15.0" ``` + ## Authentication diff --git a/java-securitycenter/README.md b/java-securitycenter/README.md index 5a9b37173729..7566db8256fb 100644 --- a/java-securitycenter/README.md +++ b/java-securitycenter/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Security Command Center][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-securitycenter" % "2.20.0" ``` + ## Authentication diff --git a/java-service-control/README.md b/java-service-control/README.md index 8816e876a24d..548c8d8e0307 100644 --- a/java-service-control/README.md +++ b/java-service-control/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Service Control API][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-service-control" % "1.12.0" ``` + ## Authentication diff --git a/java-service-management/README.md b/java-service-management/README.md index 7046033a5626..37e013a857d5 100644 --- a/java-service-management/README.md +++ b/java-service-management/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Service Management API][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-service-management" % "3.10.0" ``` + ## Authentication diff --git a/java-service-usage/README.md b/java-service-usage/README.md index c635ff180d13..55f8f3f0ffb4 100644 --- a/java-service-usage/README.md +++ b/java-service-usage/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Service Usage][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-service-usage" % "2.12.0" ``` + ## Authentication diff --git a/java-servicedirectory/README.md b/java-servicedirectory/README.md index 0df1f90e276b..8a0088b9b188 100644 --- a/java-servicedirectory/README.md +++ b/java-servicedirectory/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Service Directory][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-servicedirectory" % "2.13.0" ``` + ## Authentication diff --git a/java-shell/README.md b/java-shell/README.md index a8a17fcdae67..51dd05340993 100644 --- a/java-shell/README.md +++ b/java-shell/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Cloud Shell][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-shell" % "2.11.0" ``` + ## Authentication diff --git a/java-speech/README.md b/java-speech/README.md index ab504e652438..03494ae044f8 100644 --- a/java-speech/README.md +++ b/java-speech/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Cloud Speech][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-speech" % "4.7.0" ``` + ## Authentication diff --git a/java-storage-transfer/README.md b/java-storage-transfer/README.md index f53af17929aa..d33dba3e5a07 100644 --- a/java-storage-transfer/README.md +++ b/java-storage-transfer/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Storage Transfer Service][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-storage-transfer" % "1.12.0" ``` + ## Authentication diff --git a/java-talent/README.md b/java-talent/README.md index 47647e1190d7..43573eec371e 100644 --- a/java-talent/README.md +++ b/java-talent/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Talent Solution][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-talent" % "2.13.0" ``` + ## Authentication diff --git a/java-tasks/README.md b/java-tasks/README.md index 0edc152cc38c..40a0f9178e35 100644 --- a/java-tasks/README.md +++ b/java-tasks/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Cloud Tasks][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-tasks" % "2.12.0" ``` + ## Authentication diff --git a/java-tpu/README.md b/java-tpu/README.md index 37ef967b0f0a..3a88c6264fa6 100644 --- a/java-tpu/README.md +++ b/java-tpu/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Cloud TPU][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-tpu" % "2.13.0" ``` + ## Authentication diff --git a/java-trace/README.md b/java-trace/README.md index 8ebfbf27252b..1537241fb4cf 100644 --- a/java-trace/README.md +++ b/java-trace/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Stackdriver Trace][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-trace" % "2.12.0" ``` + ## Authentication diff --git a/java-translate/README.md b/java-translate/README.md index aeb197517770..1891a1535706 100644 --- a/java-translate/README.md +++ b/java-translate/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Cloud Translation][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-translate" % "2.12.0" ``` + ## Authentication diff --git a/java-video-intelligence/README.md b/java-video-intelligence/README.md index 0ff5d4edf7b5..365b60f46d18 100644 --- a/java-video-intelligence/README.md +++ b/java-video-intelligence/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Cloud Video Intelligence][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-video-intelligence" % "2.11.0" ``` + ## Authentication diff --git a/java-video-live-stream/README.md b/java-video-live-stream/README.md index e9d8e3bf0b92..f75377958c8e 100644 --- a/java-video-live-stream/README.md +++ b/java-video-live-stream/README.md @@ -17,6 +17,7 @@ Java idiomatic client for [Live Stream API][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -37,6 +38,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-live-stream" % "0.14.0" ``` + ## Authentication diff --git a/java-video-transcoder/README.md b/java-video-transcoder/README.md index 65deacca78cf..258736cf61c3 100644 --- a/java-video-transcoder/README.md +++ b/java-video-transcoder/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Video Transcoder][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-video-transcoder" % "1.11.0" ``` + ## Authentication diff --git a/java-vision/README.md b/java-vision/README.md index a27fc88d1d92..3a3186f8d574 100644 --- a/java-vision/README.md +++ b/java-vision/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Cloud Vision][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-vision" % "3.10.0" ``` + ## Authentication diff --git a/java-vmmigration/README.md b/java-vmmigration/README.md index 225d9c165dbe..20b9717c62c9 100644 --- a/java-vmmigration/README.md +++ b/java-vmmigration/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [VM Migration][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-vmmigration" % "1.12.0" ``` + ## Authentication diff --git a/java-vmwareengine/README.md b/java-vmwareengine/README.md index e917af50ffc5..8cab51774aae 100644 --- a/java-vmwareengine/README.md +++ b/java-vmwareengine/README.md @@ -17,6 +17,7 @@ Java idiomatic client for [Google Cloud VMware Engine][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -37,6 +38,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-vmwareengine" % "0.6.0" ``` + ## Authentication diff --git a/java-vpcaccess/README.md b/java-vpcaccess/README.md index f46a86f3d0cf..9c2e5da5a270 100644 --- a/java-vpcaccess/README.md +++ b/java-vpcaccess/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Serverless VPC Access][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-vpcaccess" % "2.13.0" ``` + ## Authentication diff --git a/java-websecurityscanner/README.md b/java-websecurityscanner/README.md index 88639a737496..790134e0f685 100644 --- a/java-websecurityscanner/README.md +++ b/java-websecurityscanner/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Cloud Security Scanner][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-websecurityscanner" % "2.12.0" ``` + ## Authentication diff --git a/java-workflow-executions/README.md b/java-workflow-executions/README.md index fc01dc0fc427..a31eb25a4062 100644 --- a/java-workflow-executions/README.md +++ b/java-workflow-executions/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Cloud Workflow Executions][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-workflow-executions" % "2.12.0" ``` + ## Authentication diff --git a/java-workflows/README.md b/java-workflows/README.md index 11e2a79c2f3a..1f7cb9523834 100644 --- a/java-workflows/README.md +++ b/java-workflows/README.md @@ -14,6 +14,7 @@ Java idiomatic client for [Cloud Workflows][product-docs]. If you are using Maven, add this to your pom.xml file: + ```xml @@ -34,6 +35,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-workflows" % "2.12.0" ``` + ## Authentication diff --git a/java-workstations/.OwlBot.yaml b/java-workstations/.OwlBot.yaml new file mode 100644 index 000000000000..0fd9d510a317 --- /dev/null +++ b/java-workstations/.OwlBot.yaml @@ -0,0 +1,36 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +deep-remove-regex: +- "/java-workstations/grpc-google-.*/src" +- "/java-workstations/proto-google-.*/src" +- "/java-workstations/google-.*/src" +- "/java-workstations/samples/snippets/generated" + +deep-preserve-regex: +- "/java-workstations/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java" + +deep-copy-regex: +- source: "/google/cloud/workstations/(v.*)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/java-workstations/$1/proto-google-cloud-workstations-$1/src" +- source: "/google/cloud/workstations/(v.*)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/java-workstations/$1/grpc-google-cloud-workstations-$1/src" +- source: "/google/cloud/workstations/(v.*)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/java-workstations/$1/google-cloud-workstations/src" +- source: "/google/cloud/workstations/(v.*)/.*-java/samples/snippets/generated" + dest: "/owl-bot-staging/java-workstations/$1/samples/snippets/generated" + + +api-name: workstations \ No newline at end of file diff --git a/java-workstations/.repo-metadata.json b/java-workstations/.repo-metadata.json new file mode 100644 index 000000000000..e5ad03a0ae49 --- /dev/null +++ b/java-workstations/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "api_shortname": "workstations", + "name_pretty": "Cloud Workstations", + "product_documentation": "https://cloud.google.com/workstations", + "api_description": "Fully managed development environments built to meet the needs of security-sensitive enterprises. It enhances the security of development environments while accelerating developer onboarding and productivity.", + "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-workstations/latest/overview", + "release_level": "preview", + "transport": "grpc", + "language": "java", + "repo": "googleapis/java-workstations", + "repo_short": "java-workstations", + "distribution_name": "com.google.cloud:google-cloud-workstations", + "api_id": "workstations.googleapis.com", + "library_type": "GAPIC_AUTO", + "requires_billing": true +} \ No newline at end of file diff --git a/java-workstations/README.md b/java-workstations/README.md new file mode 100644 index 000000000000..beb4da4dc9da --- /dev/null +++ b/java-workstations/README.md @@ -0,0 +1,201 @@ +# Google Cloud Workstations Client for Java + +Java idiomatic client for [Cloud Workstations][product-docs]. + +[![Maven][maven-version-image]][maven-version-link] +![Stability][stability-image] + +- [Product Documentation][product-docs] +- [Client Library Documentation][javadocs] + +> Note: This client is a work-in-progress, and may occasionally +> make backwards-incompatible changes. + + +## Quickstart + + +If you are using Maven, add this to your pom.xml file: + + +```xml + + com.google.cloud + google-cloud-workstations + 0.0.0 + +``` + +If you are using Gradle without BOM, add this to your dependencies: + +```Groovy +implementation 'com.google.cloud:google-cloud-workstations:0.0.0' +``` + +If you are using SBT, add this to your dependencies: + +```Scala +libraryDependencies += "com.google.cloud" % "google-cloud-workstations" % "0.0.0" +``` + +## Authentication + +See the [Authentication][authentication] section in the base directory's README. + +## Authorization + +The client application making API calls must be granted [authorization scopes][auth-scopes] required for the desired Cloud Workstations APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the Cloud Workstations API calls. + +## Getting Started + +### Prerequisites + +You will need a [Google Cloud Platform Console][developer-console] project with the Cloud Workstations [API enabled][enable-api]. +You will need to [enable billing][enable-billing] to use Google Cloud Workstations. +[Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by +[installing the Google Cloud Command Line Interface][cloud-cli] and running the following commands in command line: +`gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. + +### Installation and setup + +You'll need to obtain the `google-cloud-workstations` library. See the [Quickstart](#quickstart) section +to add `google-cloud-workstations` as a dependency in your code. + +## About Cloud Workstations + + +[Cloud Workstations][product-docs] Fully managed development environments built to meet the needs of security-sensitive enterprises. It enhances the security of development environments while accelerating developer onboarding and productivity. + +See the [Cloud Workstations client library docs][javadocs] to learn how to +use this Cloud Workstations Client Library. + + + + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +Cloud Workstations uses gRPC for the transport layer. + +## Supported Java Versions + +Java 8 or above is required for using this client. + +Google's Java client libraries, +[Google Cloud Client Libraries][cloudlibs] +and +[Google Cloud API Libraries][apilibs], +follow the +[Oracle Java SE support roadmap][oracle] +(see the Oracle Java SE Product Releases section). + +### For new development + +In general, new feature development occurs with support for the lowest Java +LTS version covered by Oracle's Premier Support (which typically lasts 5 years +from initial General Availability). If the minimum required JVM for a given +library is changed, it is accompanied by a [semver][semver] major release. + +Java 11 and (in September 2021) Java 17 are the best choices for new +development. + +### Keeping production systems current + +Google tests its client libraries with all current LTS versions covered by +Oracle's Extended Support (which typically lasts 8 years from initial +General Availability). + +#### Legacy support + +Google's client libraries support legacy versions of Java runtimes with long +term stable libraries that don't receive feature updates on a best efforts basis +as it may not be possible to backport all patches. + +Google provides updates on a best efforts basis to apps that continue to use +Java 7, though apps might need to upgrade to current versions of the library +that supports their JVM. + +#### Where to find specific information + +The latest versions and the supported Java versions are identified on +the individual GitHub repository `github.com/GoogleAPIs/java-SERVICENAME` +and on [google-cloud-java][g-c-j]. + +## Versioning + + +This library follows [Semantic Versioning](http://semver.org/). + + +It is currently in major version zero (``0.y.z``), which means that anything may change at any time +and the public API should not be considered stable. + + +## Contributing + + +Contributions to this library are always welcome and highly encouraged. + +See [CONTRIBUTING][contributing] for more information how to get started. + +Please note that this project is released with a Contributor Code of Conduct. By participating in +this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more +information. + + +## License + +Apache 2.0 - See [LICENSE][license] for more information. + +## CI Status + +Java Version | Status +------------ | ------ +Java 8 | [![Kokoro CI][kokoro-badge-image-2]][kokoro-badge-link-2] +Java 8 OSX | [![Kokoro CI][kokoro-badge-image-3]][kokoro-badge-link-3] +Java 8 Windows | [![Kokoro CI][kokoro-badge-image-4]][kokoro-badge-link-4] +Java 11 | [![Kokoro CI][kokoro-badge-image-5]][kokoro-badge-link-5] + +Java is a registered trademark of Oracle and/or its affiliates. + +[product-docs]: https://cloud.google.com/workstations +[javadocs]: https://cloud.google.com/java/docs/reference/google-cloud-workstations/latest/overview +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-workstations/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-workstations/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-workstations/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-workstations/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-workstations/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-workstations/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-workstations/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-workstations/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-workstations/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-workstations/java11.html +[stability-image]: https://img.shields.io/badge/stability-preview-yellow +[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-workstations.svg +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-workstations/0.0.0 +[authentication]: https://github.com/googleapis/google-cloud-java#authentication +[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes +[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles +[iam-policy]: https://cloud.google.com/iam/docs/overview#cloud-iam-policy +[developer-console]: https://console.developers.google.com/ +[create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects +[cloud-cli]: https://cloud.google.com/cli +[troubleshooting]: https://github.com/googleapis/google-cloud-common/blob/main/troubleshooting/readme.md#troubleshooting +[contributing]: https://github.com/googleapis/java-workstations/blob/main/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/java-workstations/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/java-workstations/blob/main/LICENSE +[enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing +[enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=workstations.googleapis.com +[libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png + +[semver]: https://semver.org/ +[cloudlibs]: https://cloud.google.com/apis/docs/client-libraries-explained +[apilibs]: https://cloud.google.com/apis/docs/client-libraries-explained#google_api_client_libraries +[oracle]: https://www.oracle.com/java/technologies/java-se-support-roadmap.html +[g-c-j]: http://github.com/googleapis/google-cloud-java diff --git a/java-workstations/google-cloud-workstations-bom/pom.xml b/java-workstations/google-cloud-workstations-bom/pom.xml new file mode 100644 index 000000000000..1b5e73d1869d --- /dev/null +++ b/java-workstations/google-cloud-workstations-bom/pom.xml @@ -0,0 +1,44 @@ + + + 4.0.0 + com.google.cloud + google-cloud-workstations-bom + 0.0.1-SNAPSHOT + pom + + + com.google.cloud + google-cloud-pom-parent + 1.7.0-SNAPSHOT + ../../google-cloud-pom-parent/pom.xml + + + Google Cloud Workstations BOM + + BOM for Cloud Workstations + + + + true + + + + + + com.google.cloud + google-cloud-workstations + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-workstations-v1beta + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-workstations-v1beta + 0.0.1-SNAPSHOT + + + + diff --git a/java-workstations/google-cloud-workstations/pom.xml b/java-workstations/google-cloud-workstations/pom.xml new file mode 100644 index 000000000000..e679a0d48afa --- /dev/null +++ b/java-workstations/google-cloud-workstations/pom.xml @@ -0,0 +1,113 @@ + + + 4.0.0 + com.google.cloud + google-cloud-workstations + 0.0.1-SNAPSHOT + jar + Google Cloud Workstations + Cloud Workstations Fully managed development environments built to meet the needs of security-sensitive enterprises. It enhances the security of development environments while accelerating developer onboarding and productivity. + + com.google.cloud + google-cloud-workstations-parent + 0.0.1-SNAPSHOT + + + google-cloud-workstations + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.api + api-common + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + + com.google.api.grpc + proto-google-cloud-workstations-v1beta + + + com.google.guava + guava + + + com.google.api + gax + + + com.google.api + gax-grpc + + + com.google.api + gax-httpjson + + + com.google.api.grpc + grpc-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api.grpc + grpc-google-iam-v1 + + + org.threeten + threetenbp + + + + + junit + junit + test + + + + com.google.api.grpc + grpc-google-cloud-workstations-v1beta + test + + + + com.google.api + gax + testlib + test + + + com.google.api + gax-grpc + testlib + test + + + com.google.api + gax-httpjson + testlib + test + + + diff --git a/java-workstations/google-cloud-workstations/src/main/java/com/google/cloud/workstations/v1beta/WorkstationsClient.java b/java-workstations/google-cloud-workstations/src/main/java/com/google/cloud/workstations/v1beta/WorkstationsClient.java new file mode 100644 index 000000000000..596026b291f9 --- /dev/null +++ b/java-workstations/google-cloud-workstations/src/main/java/com/google/cloud/workstations/v1beta/WorkstationsClient.java @@ -0,0 +1,4180 @@ +/* + * Copyright 2022 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.workstations.v1beta; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.httpjson.longrunning.OperationsClient; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.workstations.v1beta.stub.WorkstationsStub; +import com.google.cloud.workstations.v1beta.stub.WorkstationsStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service for interacting with Cloud Workstations. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+ *   WorkstationClusterName name =
+ *       WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]");
+ *   WorkstationCluster response = workstationsClient.getWorkstationCluster(name);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the WorkstationsClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of WorkstationsSettings to + * create(). For example: + * + *

To customize credentials: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * WorkstationsSettings workstationsSettings =
+ *     WorkstationsSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * WorkstationsClient workstationsClient = WorkstationsClient.create(workstationsSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * WorkstationsSettings workstationsSettings =
+ *     WorkstationsSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * WorkstationsClient workstationsClient = WorkstationsClient.create(workstationsSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * WorkstationsSettings workstationsSettings = WorkstationsSettings.newHttpJsonBuilder().build();
+ * WorkstationsClient workstationsClient = WorkstationsClient.create(workstationsSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class WorkstationsClient implements BackgroundResource { + private final WorkstationsSettings settings; + private final WorkstationsStub stub; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; + + /** Constructs an instance of WorkstationsClient with default settings. */ + public static final WorkstationsClient create() throws IOException { + return create(WorkstationsSettings.newBuilder().build()); + } + + /** + * Constructs an instance of WorkstationsClient, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. + */ + public static final WorkstationsClient create(WorkstationsSettings settings) throws IOException { + return new WorkstationsClient(settings); + } + + /** + * Constructs an instance of WorkstationsClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(WorkstationsSettings). + */ + public static final WorkstationsClient create(WorkstationsStub stub) { + return new WorkstationsClient(stub); + } + + /** + * Constructs an instance of WorkstationsClient, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected WorkstationsClient(WorkstationsSettings settings) throws IOException { + this.settings = settings; + this.stub = ((WorkstationsStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + protected WorkstationsClient(WorkstationsStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + public final WorkstationsSettings getSettings() { + return settings; + } + + public WorkstationsStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final com.google.longrunning.OperationsClient getOperationsClient() { + return operationsClient; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the requested workstation cluster. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   WorkstationClusterName name =
+   *       WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]");
+   *   WorkstationCluster response = workstationsClient.getWorkstationCluster(name);
+   * }
+   * }
+ * + * @param name Required. Name of the requested resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final WorkstationCluster getWorkstationCluster(WorkstationClusterName name) { + GetWorkstationClusterRequest request = + GetWorkstationClusterRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getWorkstationCluster(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the requested workstation cluster. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   String name =
+   *       WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]").toString();
+   *   WorkstationCluster response = workstationsClient.getWorkstationCluster(name);
+   * }
+   * }
+ * + * @param name Required. Name of the requested resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final WorkstationCluster getWorkstationCluster(String name) { + GetWorkstationClusterRequest request = + GetWorkstationClusterRequest.newBuilder().setName(name).build(); + return getWorkstationCluster(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the requested workstation cluster. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   GetWorkstationClusterRequest request =
+   *       GetWorkstationClusterRequest.newBuilder()
+   *           .setName(
+   *               WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]")
+   *                   .toString())
+   *           .build();
+   *   WorkstationCluster response = workstationsClient.getWorkstationCluster(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final WorkstationCluster getWorkstationCluster(GetWorkstationClusterRequest request) { + return getWorkstationClusterCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the requested workstation cluster. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   GetWorkstationClusterRequest request =
+   *       GetWorkstationClusterRequest.newBuilder()
+   *           .setName(
+   *               WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       workstationsClient.getWorkstationClusterCallable().futureCall(request);
+   *   // Do something.
+   *   WorkstationCluster response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + getWorkstationClusterCallable() { + return stub.getWorkstationClusterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns all workstation clusters in the specified location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (WorkstationCluster element :
+   *       workstationsClient.listWorkstationClusters(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListWorkstationClustersPagedResponse listWorkstationClusters(LocationName parent) { + ListWorkstationClustersRequest request = + ListWorkstationClustersRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listWorkstationClusters(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns all workstation clusters in the specified location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (WorkstationCluster element :
+   *       workstationsClient.listWorkstationClusters(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListWorkstationClustersPagedResponse listWorkstationClusters(String parent) { + ListWorkstationClustersRequest request = + ListWorkstationClustersRequest.newBuilder().setParent(parent).build(); + return listWorkstationClusters(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns all workstation clusters in the specified location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   ListWorkstationClustersRequest request =
+   *       ListWorkstationClustersRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (WorkstationCluster element :
+   *       workstationsClient.listWorkstationClusters(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListWorkstationClustersPagedResponse listWorkstationClusters( + ListWorkstationClustersRequest request) { + return listWorkstationClustersPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns all workstation clusters in the specified location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   ListWorkstationClustersRequest request =
+   *       ListWorkstationClustersRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       workstationsClient.listWorkstationClustersPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (WorkstationCluster element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listWorkstationClustersPagedCallable() { + return stub.listWorkstationClustersPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns all workstation clusters in the specified location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   ListWorkstationClustersRequest request =
+   *       ListWorkstationClustersRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListWorkstationClustersResponse response =
+   *         workstationsClient.listWorkstationClustersCallable().call(request);
+   *     for (WorkstationCluster element : response.getWorkstationClustersList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listWorkstationClustersCallable() { + return stub.listWorkstationClustersCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new workstation cluster. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   WorkstationCluster workstationCluster = WorkstationCluster.newBuilder().build();
+   *   String workstationClusterId = "workstationClusterId351421170";
+   *   WorkstationCluster response =
+   *       workstationsClient
+   *           .createWorkstationClusterAsync(parent, workstationCluster, workstationClusterId)
+   *           .get();
+   * }
+   * }
+ * + * @param parent Required. Parent resource name. + * @param workstationCluster Required. Workstation cluster to create. + * @param workstationClusterId Required. ID to use for the workstation cluster. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createWorkstationClusterAsync( + LocationName parent, WorkstationCluster workstationCluster, String workstationClusterId) { + CreateWorkstationClusterRequest request = + CreateWorkstationClusterRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setWorkstationCluster(workstationCluster) + .setWorkstationClusterId(workstationClusterId) + .build(); + return createWorkstationClusterAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new workstation cluster. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   WorkstationCluster workstationCluster = WorkstationCluster.newBuilder().build();
+   *   String workstationClusterId = "workstationClusterId351421170";
+   *   WorkstationCluster response =
+   *       workstationsClient
+   *           .createWorkstationClusterAsync(parent, workstationCluster, workstationClusterId)
+   *           .get();
+   * }
+   * }
+ * + * @param parent Required. Parent resource name. + * @param workstationCluster Required. Workstation cluster to create. + * @param workstationClusterId Required. ID to use for the workstation cluster. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createWorkstationClusterAsync( + String parent, WorkstationCluster workstationCluster, String workstationClusterId) { + CreateWorkstationClusterRequest request = + CreateWorkstationClusterRequest.newBuilder() + .setParent(parent) + .setWorkstationCluster(workstationCluster) + .setWorkstationClusterId(workstationClusterId) + .build(); + return createWorkstationClusterAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new workstation cluster. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   CreateWorkstationClusterRequest request =
+   *       CreateWorkstationClusterRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setWorkstationClusterId("workstationClusterId351421170")
+   *           .setWorkstationCluster(WorkstationCluster.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .build();
+   *   WorkstationCluster response = workstationsClient.createWorkstationClusterAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createWorkstationClusterAsync( + CreateWorkstationClusterRequest request) { + return createWorkstationClusterOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new workstation cluster. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   CreateWorkstationClusterRequest request =
+   *       CreateWorkstationClusterRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setWorkstationClusterId("workstationClusterId351421170")
+   *           .setWorkstationCluster(WorkstationCluster.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       workstationsClient.createWorkstationClusterOperationCallable().futureCall(request);
+   *   // Do something.
+   *   WorkstationCluster response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + CreateWorkstationClusterRequest, WorkstationCluster, OperationMetadata> + createWorkstationClusterOperationCallable() { + return stub.createWorkstationClusterOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new workstation cluster. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   CreateWorkstationClusterRequest request =
+   *       CreateWorkstationClusterRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setWorkstationClusterId("workstationClusterId351421170")
+   *           .setWorkstationCluster(WorkstationCluster.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future =
+   *       workstationsClient.createWorkstationClusterCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + createWorkstationClusterCallable() { + return stub.createWorkstationClusterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an existing workstation cluster. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   WorkstationCluster workstationCluster = WorkstationCluster.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   WorkstationCluster response =
+   *       workstationsClient.updateWorkstationClusterAsync(workstationCluster, updateMask).get();
+   * }
+   * }
+ * + * @param workstationCluster Required. Workstation cluster to update. + * @param updateMask Required. Mask that specifies which fields in the workstation cluster should + * be updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateWorkstationClusterAsync( + WorkstationCluster workstationCluster, FieldMask updateMask) { + UpdateWorkstationClusterRequest request = + UpdateWorkstationClusterRequest.newBuilder() + .setWorkstationCluster(workstationCluster) + .setUpdateMask(updateMask) + .build(); + return updateWorkstationClusterAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an existing workstation cluster. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   UpdateWorkstationClusterRequest request =
+   *       UpdateWorkstationClusterRequest.newBuilder()
+   *           .setWorkstationCluster(WorkstationCluster.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   WorkstationCluster response = workstationsClient.updateWorkstationClusterAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateWorkstationClusterAsync( + UpdateWorkstationClusterRequest request) { + return updateWorkstationClusterOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an existing workstation cluster. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   UpdateWorkstationClusterRequest request =
+   *       UpdateWorkstationClusterRequest.newBuilder()
+   *           .setWorkstationCluster(WorkstationCluster.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   OperationFuture future =
+   *       workstationsClient.updateWorkstationClusterOperationCallable().futureCall(request);
+   *   // Do something.
+   *   WorkstationCluster response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + UpdateWorkstationClusterRequest, WorkstationCluster, OperationMetadata> + updateWorkstationClusterOperationCallable() { + return stub.updateWorkstationClusterOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an existing workstation cluster. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   UpdateWorkstationClusterRequest request =
+   *       UpdateWorkstationClusterRequest.newBuilder()
+   *           .setWorkstationCluster(WorkstationCluster.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   ApiFuture future =
+   *       workstationsClient.updateWorkstationClusterCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + updateWorkstationClusterCallable() { + return stub.updateWorkstationClusterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the specified workstation cluster. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   WorkstationClusterName name =
+   *       WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]");
+   *   WorkstationCluster response = workstationsClient.deleteWorkstationClusterAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Name of the workstation cluster to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteWorkstationClusterAsync( + WorkstationClusterName name) { + DeleteWorkstationClusterRequest request = + DeleteWorkstationClusterRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return deleteWorkstationClusterAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the specified workstation cluster. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   String name =
+   *       WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]").toString();
+   *   WorkstationCluster response = workstationsClient.deleteWorkstationClusterAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Name of the workstation cluster to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteWorkstationClusterAsync( + String name) { + DeleteWorkstationClusterRequest request = + DeleteWorkstationClusterRequest.newBuilder().setName(name).build(); + return deleteWorkstationClusterAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the specified workstation cluster. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   DeleteWorkstationClusterRequest request =
+   *       DeleteWorkstationClusterRequest.newBuilder()
+   *           .setName(
+   *               WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]")
+   *                   .toString())
+   *           .setValidateOnly(true)
+   *           .setEtag("etag3123477")
+   *           .setForce(true)
+   *           .build();
+   *   WorkstationCluster response = workstationsClient.deleteWorkstationClusterAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteWorkstationClusterAsync( + DeleteWorkstationClusterRequest request) { + return deleteWorkstationClusterOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the specified workstation cluster. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   DeleteWorkstationClusterRequest request =
+   *       DeleteWorkstationClusterRequest.newBuilder()
+   *           .setName(
+   *               WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]")
+   *                   .toString())
+   *           .setValidateOnly(true)
+   *           .setEtag("etag3123477")
+   *           .setForce(true)
+   *           .build();
+   *   OperationFuture future =
+   *       workstationsClient.deleteWorkstationClusterOperationCallable().futureCall(request);
+   *   // Do something.
+   *   WorkstationCluster response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + DeleteWorkstationClusterRequest, WorkstationCluster, OperationMetadata> + deleteWorkstationClusterOperationCallable() { + return stub.deleteWorkstationClusterOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the specified workstation cluster. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   DeleteWorkstationClusterRequest request =
+   *       DeleteWorkstationClusterRequest.newBuilder()
+   *           .setName(
+   *               WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]")
+   *                   .toString())
+   *           .setValidateOnly(true)
+   *           .setEtag("etag3123477")
+   *           .setForce(true)
+   *           .build();
+   *   ApiFuture future =
+   *       workstationsClient.deleteWorkstationClusterCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + deleteWorkstationClusterCallable() { + return stub.deleteWorkstationClusterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the requested workstation configuration. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   WorkstationConfigName name =
+   *       WorkstationConfigName.of(
+   *           "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]");
+   *   WorkstationConfig response = workstationsClient.getWorkstationConfig(name);
+   * }
+   * }
+ * + * @param name Required. Name of the requested resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final WorkstationConfig getWorkstationConfig(WorkstationConfigName name) { + GetWorkstationConfigRequest request = + GetWorkstationConfigRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getWorkstationConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the requested workstation configuration. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   String name =
+   *       WorkstationConfigName.of(
+   *               "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]")
+   *           .toString();
+   *   WorkstationConfig response = workstationsClient.getWorkstationConfig(name);
+   * }
+   * }
+ * + * @param name Required. Name of the requested resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final WorkstationConfig getWorkstationConfig(String name) { + GetWorkstationConfigRequest request = + GetWorkstationConfigRequest.newBuilder().setName(name).build(); + return getWorkstationConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the requested workstation configuration. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   GetWorkstationConfigRequest request =
+   *       GetWorkstationConfigRequest.newBuilder()
+   *           .setName(
+   *               WorkstationConfigName.of(
+   *                       "[PROJECT]",
+   *                       "[LOCATION]",
+   *                       "[WORKSTATION_CLUSTER]",
+   *                       "[WORKSTATION_CONFIG]")
+   *                   .toString())
+   *           .build();
+   *   WorkstationConfig response = workstationsClient.getWorkstationConfig(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final WorkstationConfig getWorkstationConfig(GetWorkstationConfigRequest request) { + return getWorkstationConfigCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the requested workstation configuration. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   GetWorkstationConfigRequest request =
+   *       GetWorkstationConfigRequest.newBuilder()
+   *           .setName(
+   *               WorkstationConfigName.of(
+   *                       "[PROJECT]",
+   *                       "[LOCATION]",
+   *                       "[WORKSTATION_CLUSTER]",
+   *                       "[WORKSTATION_CONFIG]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       workstationsClient.getWorkstationConfigCallable().futureCall(request);
+   *   // Do something.
+   *   WorkstationConfig response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + getWorkstationConfigCallable() { + return stub.getWorkstationConfigCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns all workstation configurations in the specified cluster. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   WorkstationClusterName parent =
+   *       WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]");
+   *   for (WorkstationConfig element :
+   *       workstationsClient.listWorkstationConfigs(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListWorkstationConfigsPagedResponse listWorkstationConfigs( + WorkstationClusterName parent) { + ListWorkstationConfigsRequest request = + ListWorkstationConfigsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listWorkstationConfigs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns all workstation configurations in the specified cluster. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   String parent =
+   *       WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]").toString();
+   *   for (WorkstationConfig element :
+   *       workstationsClient.listWorkstationConfigs(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListWorkstationConfigsPagedResponse listWorkstationConfigs(String parent) { + ListWorkstationConfigsRequest request = + ListWorkstationConfigsRequest.newBuilder().setParent(parent).build(); + return listWorkstationConfigs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns all workstation configurations in the specified cluster. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   ListWorkstationConfigsRequest request =
+   *       ListWorkstationConfigsRequest.newBuilder()
+   *           .setParent(
+   *               WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (WorkstationConfig element :
+   *       workstationsClient.listWorkstationConfigs(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListWorkstationConfigsPagedResponse listWorkstationConfigs( + ListWorkstationConfigsRequest request) { + return listWorkstationConfigsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns all workstation configurations in the specified cluster. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   ListWorkstationConfigsRequest request =
+   *       ListWorkstationConfigsRequest.newBuilder()
+   *           .setParent(
+   *               WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       workstationsClient.listWorkstationConfigsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (WorkstationConfig element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listWorkstationConfigsPagedCallable() { + return stub.listWorkstationConfigsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns all workstation configurations in the specified cluster. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   ListWorkstationConfigsRequest request =
+   *       ListWorkstationConfigsRequest.newBuilder()
+   *           .setParent(
+   *               WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListWorkstationConfigsResponse response =
+   *         workstationsClient.listWorkstationConfigsCallable().call(request);
+   *     for (WorkstationConfig element : response.getWorkstationConfigsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listWorkstationConfigsCallable() { + return stub.listWorkstationConfigsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns all workstation configurations in the specified cluster on which the caller has the + * "workstations.workstation.create" permission. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   WorkstationClusterName parent =
+   *       WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]");
+   *   for (WorkstationConfig element :
+   *       workstationsClient.listUsableWorkstationConfigs(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListUsableWorkstationConfigsPagedResponse listUsableWorkstationConfigs( + WorkstationClusterName parent) { + ListUsableWorkstationConfigsRequest request = + ListUsableWorkstationConfigsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listUsableWorkstationConfigs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns all workstation configurations in the specified cluster on which the caller has the + * "workstations.workstation.create" permission. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   String parent =
+   *       WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]").toString();
+   *   for (WorkstationConfig element :
+   *       workstationsClient.listUsableWorkstationConfigs(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListUsableWorkstationConfigsPagedResponse listUsableWorkstationConfigs( + String parent) { + ListUsableWorkstationConfigsRequest request = + ListUsableWorkstationConfigsRequest.newBuilder().setParent(parent).build(); + return listUsableWorkstationConfigs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns all workstation configurations in the specified cluster on which the caller has the + * "workstations.workstation.create" permission. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   ListUsableWorkstationConfigsRequest request =
+   *       ListUsableWorkstationConfigsRequest.newBuilder()
+   *           .setParent(
+   *               WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (WorkstationConfig element :
+   *       workstationsClient.listUsableWorkstationConfigs(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListUsableWorkstationConfigsPagedResponse listUsableWorkstationConfigs( + ListUsableWorkstationConfigsRequest request) { + return listUsableWorkstationConfigsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns all workstation configurations in the specified cluster on which the caller has the + * "workstations.workstation.create" permission. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   ListUsableWorkstationConfigsRequest request =
+   *       ListUsableWorkstationConfigsRequest.newBuilder()
+   *           .setParent(
+   *               WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       workstationsClient.listUsableWorkstationConfigsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (WorkstationConfig element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable< + ListUsableWorkstationConfigsRequest, ListUsableWorkstationConfigsPagedResponse> + listUsableWorkstationConfigsPagedCallable() { + return stub.listUsableWorkstationConfigsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns all workstation configurations in the specified cluster on which the caller has the + * "workstations.workstation.create" permission. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   ListUsableWorkstationConfigsRequest request =
+   *       ListUsableWorkstationConfigsRequest.newBuilder()
+   *           .setParent(
+   *               WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListUsableWorkstationConfigsResponse response =
+   *         workstationsClient.listUsableWorkstationConfigsCallable().call(request);
+   *     for (WorkstationConfig element : response.getWorkstationConfigsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable< + ListUsableWorkstationConfigsRequest, ListUsableWorkstationConfigsResponse> + listUsableWorkstationConfigsCallable() { + return stub.listUsableWorkstationConfigsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new workstation configuration. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   WorkstationClusterName parent =
+   *       WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]");
+   *   WorkstationConfig workstationConfig = WorkstationConfig.newBuilder().build();
+   *   String workstationConfigId = "workstationConfigId798542368";
+   *   WorkstationConfig response =
+   *       workstationsClient
+   *           .createWorkstationConfigAsync(parent, workstationConfig, workstationConfigId)
+   *           .get();
+   * }
+   * }
+ * + * @param parent Required. Parent resource name. + * @param workstationConfig Required. Config to create. + * @param workstationConfigId Required. ID to use for the config. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createWorkstationConfigAsync( + WorkstationClusterName parent, + WorkstationConfig workstationConfig, + String workstationConfigId) { + CreateWorkstationConfigRequest request = + CreateWorkstationConfigRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setWorkstationConfig(workstationConfig) + .setWorkstationConfigId(workstationConfigId) + .build(); + return createWorkstationConfigAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new workstation configuration. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   String parent =
+   *       WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]").toString();
+   *   WorkstationConfig workstationConfig = WorkstationConfig.newBuilder().build();
+   *   String workstationConfigId = "workstationConfigId798542368";
+   *   WorkstationConfig response =
+   *       workstationsClient
+   *           .createWorkstationConfigAsync(parent, workstationConfig, workstationConfigId)
+   *           .get();
+   * }
+   * }
+ * + * @param parent Required. Parent resource name. + * @param workstationConfig Required. Config to create. + * @param workstationConfigId Required. ID to use for the config. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createWorkstationConfigAsync( + String parent, WorkstationConfig workstationConfig, String workstationConfigId) { + CreateWorkstationConfigRequest request = + CreateWorkstationConfigRequest.newBuilder() + .setParent(parent) + .setWorkstationConfig(workstationConfig) + .setWorkstationConfigId(workstationConfigId) + .build(); + return createWorkstationConfigAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new workstation configuration. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   CreateWorkstationConfigRequest request =
+   *       CreateWorkstationConfigRequest.newBuilder()
+   *           .setParent(
+   *               WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]")
+   *                   .toString())
+   *           .setWorkstationConfigId("workstationConfigId798542368")
+   *           .setWorkstationConfig(WorkstationConfig.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .build();
+   *   WorkstationConfig response = workstationsClient.createWorkstationConfigAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createWorkstationConfigAsync( + CreateWorkstationConfigRequest request) { + return createWorkstationConfigOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new workstation configuration. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   CreateWorkstationConfigRequest request =
+   *       CreateWorkstationConfigRequest.newBuilder()
+   *           .setParent(
+   *               WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]")
+   *                   .toString())
+   *           .setWorkstationConfigId("workstationConfigId798542368")
+   *           .setWorkstationConfig(WorkstationConfig.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       workstationsClient.createWorkstationConfigOperationCallable().futureCall(request);
+   *   // Do something.
+   *   WorkstationConfig response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + CreateWorkstationConfigRequest, WorkstationConfig, OperationMetadata> + createWorkstationConfigOperationCallable() { + return stub.createWorkstationConfigOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new workstation configuration. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   CreateWorkstationConfigRequest request =
+   *       CreateWorkstationConfigRequest.newBuilder()
+   *           .setParent(
+   *               WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]")
+   *                   .toString())
+   *           .setWorkstationConfigId("workstationConfigId798542368")
+   *           .setWorkstationConfig(WorkstationConfig.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future =
+   *       workstationsClient.createWorkstationConfigCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + createWorkstationConfigCallable() { + return stub.createWorkstationConfigCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an existing workstation configuration. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   WorkstationConfig workstationConfig = WorkstationConfig.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   WorkstationConfig response =
+   *       workstationsClient.updateWorkstationConfigAsync(workstationConfig, updateMask).get();
+   * }
+   * }
+ * + * @param workstationConfig Required. Config to update. + * @param updateMask Required. Mask specifying which fields in the config should be updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateWorkstationConfigAsync( + WorkstationConfig workstationConfig, FieldMask updateMask) { + UpdateWorkstationConfigRequest request = + UpdateWorkstationConfigRequest.newBuilder() + .setWorkstationConfig(workstationConfig) + .setUpdateMask(updateMask) + .build(); + return updateWorkstationConfigAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an existing workstation configuration. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   UpdateWorkstationConfigRequest request =
+   *       UpdateWorkstationConfigRequest.newBuilder()
+   *           .setWorkstationConfig(WorkstationConfig.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   WorkstationConfig response = workstationsClient.updateWorkstationConfigAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateWorkstationConfigAsync( + UpdateWorkstationConfigRequest request) { + return updateWorkstationConfigOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an existing workstation configuration. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   UpdateWorkstationConfigRequest request =
+   *       UpdateWorkstationConfigRequest.newBuilder()
+   *           .setWorkstationConfig(WorkstationConfig.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   OperationFuture future =
+   *       workstationsClient.updateWorkstationConfigOperationCallable().futureCall(request);
+   *   // Do something.
+   *   WorkstationConfig response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + UpdateWorkstationConfigRequest, WorkstationConfig, OperationMetadata> + updateWorkstationConfigOperationCallable() { + return stub.updateWorkstationConfigOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an existing workstation configuration. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   UpdateWorkstationConfigRequest request =
+   *       UpdateWorkstationConfigRequest.newBuilder()
+   *           .setWorkstationConfig(WorkstationConfig.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   ApiFuture future =
+   *       workstationsClient.updateWorkstationConfigCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + updateWorkstationConfigCallable() { + return stub.updateWorkstationConfigCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the specified workstation configuration. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   WorkstationConfigName name =
+   *       WorkstationConfigName.of(
+   *           "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]");
+   *   WorkstationConfig response = workstationsClient.deleteWorkstationConfigAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Name of the config to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteWorkstationConfigAsync( + WorkstationConfigName name) { + DeleteWorkstationConfigRequest request = + DeleteWorkstationConfigRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return deleteWorkstationConfigAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the specified workstation configuration. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   String name =
+   *       WorkstationConfigName.of(
+   *               "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]")
+   *           .toString();
+   *   WorkstationConfig response = workstationsClient.deleteWorkstationConfigAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Name of the config to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteWorkstationConfigAsync( + String name) { + DeleteWorkstationConfigRequest request = + DeleteWorkstationConfigRequest.newBuilder().setName(name).build(); + return deleteWorkstationConfigAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the specified workstation configuration. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   DeleteWorkstationConfigRequest request =
+   *       DeleteWorkstationConfigRequest.newBuilder()
+   *           .setName(
+   *               WorkstationConfigName.of(
+   *                       "[PROJECT]",
+   *                       "[LOCATION]",
+   *                       "[WORKSTATION_CLUSTER]",
+   *                       "[WORKSTATION_CONFIG]")
+   *                   .toString())
+   *           .setValidateOnly(true)
+   *           .setEtag("etag3123477")
+   *           .setForce(true)
+   *           .build();
+   *   WorkstationConfig response = workstationsClient.deleteWorkstationConfigAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteWorkstationConfigAsync( + DeleteWorkstationConfigRequest request) { + return deleteWorkstationConfigOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the specified workstation configuration. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   DeleteWorkstationConfigRequest request =
+   *       DeleteWorkstationConfigRequest.newBuilder()
+   *           .setName(
+   *               WorkstationConfigName.of(
+   *                       "[PROJECT]",
+   *                       "[LOCATION]",
+   *                       "[WORKSTATION_CLUSTER]",
+   *                       "[WORKSTATION_CONFIG]")
+   *                   .toString())
+   *           .setValidateOnly(true)
+   *           .setEtag("etag3123477")
+   *           .setForce(true)
+   *           .build();
+   *   OperationFuture future =
+   *       workstationsClient.deleteWorkstationConfigOperationCallable().futureCall(request);
+   *   // Do something.
+   *   WorkstationConfig response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + DeleteWorkstationConfigRequest, WorkstationConfig, OperationMetadata> + deleteWorkstationConfigOperationCallable() { + return stub.deleteWorkstationConfigOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the specified workstation configuration. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   DeleteWorkstationConfigRequest request =
+   *       DeleteWorkstationConfigRequest.newBuilder()
+   *           .setName(
+   *               WorkstationConfigName.of(
+   *                       "[PROJECT]",
+   *                       "[LOCATION]",
+   *                       "[WORKSTATION_CLUSTER]",
+   *                       "[WORKSTATION_CONFIG]")
+   *                   .toString())
+   *           .setValidateOnly(true)
+   *           .setEtag("etag3123477")
+   *           .setForce(true)
+   *           .build();
+   *   ApiFuture future =
+   *       workstationsClient.deleteWorkstationConfigCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + deleteWorkstationConfigCallable() { + return stub.deleteWorkstationConfigCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the requested workstation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   WorkstationName name =
+   *       WorkstationName.of(
+   *           "[PROJECT]",
+   *           "[LOCATION]",
+   *           "[WORKSTATION_CLUSTER]",
+   *           "[WORKSTATION_CONFIG]",
+   *           "[WORKSTATION]");
+   *   Workstation response = workstationsClient.getWorkstation(name);
+   * }
+   * }
+ * + * @param name Required. Name of the requested resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Workstation getWorkstation(WorkstationName name) { + GetWorkstationRequest request = + GetWorkstationRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getWorkstation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the requested workstation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   String name =
+   *       WorkstationName.of(
+   *               "[PROJECT]",
+   *               "[LOCATION]",
+   *               "[WORKSTATION_CLUSTER]",
+   *               "[WORKSTATION_CONFIG]",
+   *               "[WORKSTATION]")
+   *           .toString();
+   *   Workstation response = workstationsClient.getWorkstation(name);
+   * }
+   * }
+ * + * @param name Required. Name of the requested resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Workstation getWorkstation(String name) { + GetWorkstationRequest request = GetWorkstationRequest.newBuilder().setName(name).build(); + return getWorkstation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the requested workstation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   GetWorkstationRequest request =
+   *       GetWorkstationRequest.newBuilder()
+   *           .setName(
+   *               WorkstationName.of(
+   *                       "[PROJECT]",
+   *                       "[LOCATION]",
+   *                       "[WORKSTATION_CLUSTER]",
+   *                       "[WORKSTATION_CONFIG]",
+   *                       "[WORKSTATION]")
+   *                   .toString())
+   *           .build();
+   *   Workstation response = workstationsClient.getWorkstation(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Workstation getWorkstation(GetWorkstationRequest request) { + return getWorkstationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the requested workstation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   GetWorkstationRequest request =
+   *       GetWorkstationRequest.newBuilder()
+   *           .setName(
+   *               WorkstationName.of(
+   *                       "[PROJECT]",
+   *                       "[LOCATION]",
+   *                       "[WORKSTATION_CLUSTER]",
+   *                       "[WORKSTATION_CONFIG]",
+   *                       "[WORKSTATION]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       workstationsClient.getWorkstationCallable().futureCall(request);
+   *   // Do something.
+   *   Workstation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getWorkstationCallable() { + return stub.getWorkstationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns all Workstations using the specified config. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   WorkstationConfigName parent =
+   *       WorkstationConfigName.of(
+   *           "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]");
+   *   for (Workstation element : workstationsClient.listWorkstations(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListWorkstationsPagedResponse listWorkstations(WorkstationConfigName parent) { + ListWorkstationsRequest request = + ListWorkstationsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listWorkstations(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns all Workstations using the specified config. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   String parent =
+   *       WorkstationConfigName.of(
+   *               "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]")
+   *           .toString();
+   *   for (Workstation element : workstationsClient.listWorkstations(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListWorkstationsPagedResponse listWorkstations(String parent) { + ListWorkstationsRequest request = + ListWorkstationsRequest.newBuilder().setParent(parent).build(); + return listWorkstations(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns all Workstations using the specified config. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   ListWorkstationsRequest request =
+   *       ListWorkstationsRequest.newBuilder()
+   *           .setParent(
+   *               WorkstationConfigName.of(
+   *                       "[PROJECT]",
+   *                       "[LOCATION]",
+   *                       "[WORKSTATION_CLUSTER]",
+   *                       "[WORKSTATION_CONFIG]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Workstation element : workstationsClient.listWorkstations(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListWorkstationsPagedResponse listWorkstations(ListWorkstationsRequest request) { + return listWorkstationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns all Workstations using the specified config. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   ListWorkstationsRequest request =
+   *       ListWorkstationsRequest.newBuilder()
+   *           .setParent(
+   *               WorkstationConfigName.of(
+   *                       "[PROJECT]",
+   *                       "[LOCATION]",
+   *                       "[WORKSTATION_CLUSTER]",
+   *                       "[WORKSTATION_CONFIG]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       workstationsClient.listWorkstationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Workstation element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listWorkstationsPagedCallable() { + return stub.listWorkstationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns all Workstations using the specified config. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   ListWorkstationsRequest request =
+   *       ListWorkstationsRequest.newBuilder()
+   *           .setParent(
+   *               WorkstationConfigName.of(
+   *                       "[PROJECT]",
+   *                       "[LOCATION]",
+   *                       "[WORKSTATION_CLUSTER]",
+   *                       "[WORKSTATION_CONFIG]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListWorkstationsResponse response =
+   *         workstationsClient.listWorkstationsCallable().call(request);
+   *     for (Workstation element : response.getWorkstationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listWorkstationsCallable() { + return stub.listWorkstationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns all Workstations using the specified config on which the caller has the + * "workstations.workstations.use" permission. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   WorkstationConfigName parent =
+   *       WorkstationConfigName.of(
+   *           "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]");
+   *   for (Workstation element : workstationsClient.listUsableWorkstations(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListUsableWorkstationsPagedResponse listUsableWorkstations( + WorkstationConfigName parent) { + ListUsableWorkstationsRequest request = + ListUsableWorkstationsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listUsableWorkstations(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns all Workstations using the specified config on which the caller has the + * "workstations.workstations.use" permission. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   String parent =
+   *       WorkstationConfigName.of(
+   *               "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]")
+   *           .toString();
+   *   for (Workstation element : workstationsClient.listUsableWorkstations(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListUsableWorkstationsPagedResponse listUsableWorkstations(String parent) { + ListUsableWorkstationsRequest request = + ListUsableWorkstationsRequest.newBuilder().setParent(parent).build(); + return listUsableWorkstations(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns all Workstations using the specified config on which the caller has the + * "workstations.workstations.use" permission. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   ListUsableWorkstationsRequest request =
+   *       ListUsableWorkstationsRequest.newBuilder()
+   *           .setParent(
+   *               WorkstationConfigName.of(
+   *                       "[PROJECT]",
+   *                       "[LOCATION]",
+   *                       "[WORKSTATION_CLUSTER]",
+   *                       "[WORKSTATION_CONFIG]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Workstation element : workstationsClient.listUsableWorkstations(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListUsableWorkstationsPagedResponse listUsableWorkstations( + ListUsableWorkstationsRequest request) { + return listUsableWorkstationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns all Workstations using the specified config on which the caller has the + * "workstations.workstations.use" permission. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   ListUsableWorkstationsRequest request =
+   *       ListUsableWorkstationsRequest.newBuilder()
+   *           .setParent(
+   *               WorkstationConfigName.of(
+   *                       "[PROJECT]",
+   *                       "[LOCATION]",
+   *                       "[WORKSTATION_CLUSTER]",
+   *                       "[WORKSTATION_CONFIG]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       workstationsClient.listUsableWorkstationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Workstation element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listUsableWorkstationsPagedCallable() { + return stub.listUsableWorkstationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns all Workstations using the specified config on which the caller has the + * "workstations.workstations.use" permission. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   ListUsableWorkstationsRequest request =
+   *       ListUsableWorkstationsRequest.newBuilder()
+   *           .setParent(
+   *               WorkstationConfigName.of(
+   *                       "[PROJECT]",
+   *                       "[LOCATION]",
+   *                       "[WORKSTATION_CLUSTER]",
+   *                       "[WORKSTATION_CONFIG]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListUsableWorkstationsResponse response =
+   *         workstationsClient.listUsableWorkstationsCallable().call(request);
+   *     for (Workstation element : response.getWorkstationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listUsableWorkstationsCallable() { + return stub.listUsableWorkstationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new workstation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   WorkstationConfigName parent =
+   *       WorkstationConfigName.of(
+   *           "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]");
+   *   Workstation workstation = Workstation.newBuilder().build();
+   *   String workstationId = "workstationId560540030";
+   *   Workstation response =
+   *       workstationsClient.createWorkstationAsync(parent, workstation, workstationId).get();
+   * }
+   * }
+ * + * @param parent Required. Parent resource name. + * @param workstation Required. Workstation to create. + * @param workstationId Required. ID to use for the workstation. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createWorkstationAsync( + WorkstationConfigName parent, Workstation workstation, String workstationId) { + CreateWorkstationRequest request = + CreateWorkstationRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setWorkstation(workstation) + .setWorkstationId(workstationId) + .build(); + return createWorkstationAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new workstation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   String parent =
+   *       WorkstationConfigName.of(
+   *               "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]")
+   *           .toString();
+   *   Workstation workstation = Workstation.newBuilder().build();
+   *   String workstationId = "workstationId560540030";
+   *   Workstation response =
+   *       workstationsClient.createWorkstationAsync(parent, workstation, workstationId).get();
+   * }
+   * }
+ * + * @param parent Required. Parent resource name. + * @param workstation Required. Workstation to create. + * @param workstationId Required. ID to use for the workstation. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createWorkstationAsync( + String parent, Workstation workstation, String workstationId) { + CreateWorkstationRequest request = + CreateWorkstationRequest.newBuilder() + .setParent(parent) + .setWorkstation(workstation) + .setWorkstationId(workstationId) + .build(); + return createWorkstationAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new workstation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   CreateWorkstationRequest request =
+   *       CreateWorkstationRequest.newBuilder()
+   *           .setParent(
+   *               WorkstationConfigName.of(
+   *                       "[PROJECT]",
+   *                       "[LOCATION]",
+   *                       "[WORKSTATION_CLUSTER]",
+   *                       "[WORKSTATION_CONFIG]")
+   *                   .toString())
+   *           .setWorkstationId("workstationId560540030")
+   *           .setWorkstation(Workstation.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .build();
+   *   Workstation response = workstationsClient.createWorkstationAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createWorkstationAsync( + CreateWorkstationRequest request) { + return createWorkstationOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new workstation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   CreateWorkstationRequest request =
+   *       CreateWorkstationRequest.newBuilder()
+   *           .setParent(
+   *               WorkstationConfigName.of(
+   *                       "[PROJECT]",
+   *                       "[LOCATION]",
+   *                       "[WORKSTATION_CLUSTER]",
+   *                       "[WORKSTATION_CONFIG]")
+   *                   .toString())
+   *           .setWorkstationId("workstationId560540030")
+   *           .setWorkstation(Workstation.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       workstationsClient.createWorkstationOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Workstation response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createWorkstationOperationCallable() { + return stub.createWorkstationOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new workstation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   CreateWorkstationRequest request =
+   *       CreateWorkstationRequest.newBuilder()
+   *           .setParent(
+   *               WorkstationConfigName.of(
+   *                       "[PROJECT]",
+   *                       "[LOCATION]",
+   *                       "[WORKSTATION_CLUSTER]",
+   *                       "[WORKSTATION_CONFIG]")
+   *                   .toString())
+   *           .setWorkstationId("workstationId560540030")
+   *           .setWorkstation(Workstation.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future =
+   *       workstationsClient.createWorkstationCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createWorkstationCallable() { + return stub.createWorkstationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an existing workstation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   Workstation workstation = Workstation.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Workstation response =
+   *       workstationsClient.updateWorkstationAsync(workstation, updateMask).get();
+   * }
+   * }
+ * + * @param workstation Required. Workstation to update. + * @param updateMask Required. Mask specifying which fields in the config should be updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateWorkstationAsync( + Workstation workstation, FieldMask updateMask) { + UpdateWorkstationRequest request = + UpdateWorkstationRequest.newBuilder() + .setWorkstation(workstation) + .setUpdateMask(updateMask) + .build(); + return updateWorkstationAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an existing workstation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   UpdateWorkstationRequest request =
+   *       UpdateWorkstationRequest.newBuilder()
+   *           .setWorkstation(Workstation.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   Workstation response = workstationsClient.updateWorkstationAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateWorkstationAsync( + UpdateWorkstationRequest request) { + return updateWorkstationOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an existing workstation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   UpdateWorkstationRequest request =
+   *       UpdateWorkstationRequest.newBuilder()
+   *           .setWorkstation(Workstation.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   OperationFuture future =
+   *       workstationsClient.updateWorkstationOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Workstation response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + updateWorkstationOperationCallable() { + return stub.updateWorkstationOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an existing workstation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   UpdateWorkstationRequest request =
+   *       UpdateWorkstationRequest.newBuilder()
+   *           .setWorkstation(Workstation.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .setAllowMissing(true)
+   *           .build();
+   *   ApiFuture future =
+   *       workstationsClient.updateWorkstationCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateWorkstationCallable() { + return stub.updateWorkstationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the specified workstation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   WorkstationName name =
+   *       WorkstationName.of(
+   *           "[PROJECT]",
+   *           "[LOCATION]",
+   *           "[WORKSTATION_CLUSTER]",
+   *           "[WORKSTATION_CONFIG]",
+   *           "[WORKSTATION]");
+   *   Workstation response = workstationsClient.deleteWorkstationAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Name of the workstation to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteWorkstationAsync( + WorkstationName name) { + DeleteWorkstationRequest request = + DeleteWorkstationRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return deleteWorkstationAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the specified workstation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   String name =
+   *       WorkstationName.of(
+   *               "[PROJECT]",
+   *               "[LOCATION]",
+   *               "[WORKSTATION_CLUSTER]",
+   *               "[WORKSTATION_CONFIG]",
+   *               "[WORKSTATION]")
+   *           .toString();
+   *   Workstation response = workstationsClient.deleteWorkstationAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Name of the workstation to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteWorkstationAsync(String name) { + DeleteWorkstationRequest request = DeleteWorkstationRequest.newBuilder().setName(name).build(); + return deleteWorkstationAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the specified workstation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   DeleteWorkstationRequest request =
+   *       DeleteWorkstationRequest.newBuilder()
+   *           .setName(
+   *               WorkstationName.of(
+   *                       "[PROJECT]",
+   *                       "[LOCATION]",
+   *                       "[WORKSTATION_CLUSTER]",
+   *                       "[WORKSTATION_CONFIG]",
+   *                       "[WORKSTATION]")
+   *                   .toString())
+   *           .setValidateOnly(true)
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   Workstation response = workstationsClient.deleteWorkstationAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteWorkstationAsync( + DeleteWorkstationRequest request) { + return deleteWorkstationOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the specified workstation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   DeleteWorkstationRequest request =
+   *       DeleteWorkstationRequest.newBuilder()
+   *           .setName(
+   *               WorkstationName.of(
+   *                       "[PROJECT]",
+   *                       "[LOCATION]",
+   *                       "[WORKSTATION_CLUSTER]",
+   *                       "[WORKSTATION_CONFIG]",
+   *                       "[WORKSTATION]")
+   *                   .toString())
+   *           .setValidateOnly(true)
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   OperationFuture future =
+   *       workstationsClient.deleteWorkstationOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Workstation response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteWorkstationOperationCallable() { + return stub.deleteWorkstationOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the specified workstation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   DeleteWorkstationRequest request =
+   *       DeleteWorkstationRequest.newBuilder()
+   *           .setName(
+   *               WorkstationName.of(
+   *                       "[PROJECT]",
+   *                       "[LOCATION]",
+   *                       "[WORKSTATION_CLUSTER]",
+   *                       "[WORKSTATION_CONFIG]",
+   *                       "[WORKSTATION]")
+   *                   .toString())
+   *           .setValidateOnly(true)
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   ApiFuture future =
+   *       workstationsClient.deleteWorkstationCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteWorkstationCallable() { + return stub.deleteWorkstationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Starts running a workstation so that users can connect to it. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   WorkstationName name =
+   *       WorkstationName.of(
+   *           "[PROJECT]",
+   *           "[LOCATION]",
+   *           "[WORKSTATION_CLUSTER]",
+   *           "[WORKSTATION_CONFIG]",
+   *           "[WORKSTATION]");
+   *   Workstation response = workstationsClient.startWorkstationAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Name of the workstation to start. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture startWorkstationAsync( + WorkstationName name) { + StartWorkstationRequest request = + StartWorkstationRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return startWorkstationAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Starts running a workstation so that users can connect to it. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   String name =
+   *       WorkstationName.of(
+   *               "[PROJECT]",
+   *               "[LOCATION]",
+   *               "[WORKSTATION_CLUSTER]",
+   *               "[WORKSTATION_CONFIG]",
+   *               "[WORKSTATION]")
+   *           .toString();
+   *   Workstation response = workstationsClient.startWorkstationAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Name of the workstation to start. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture startWorkstationAsync(String name) { + StartWorkstationRequest request = StartWorkstationRequest.newBuilder().setName(name).build(); + return startWorkstationAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Starts running a workstation so that users can connect to it. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   StartWorkstationRequest request =
+   *       StartWorkstationRequest.newBuilder()
+   *           .setName(
+   *               WorkstationName.of(
+   *                       "[PROJECT]",
+   *                       "[LOCATION]",
+   *                       "[WORKSTATION_CLUSTER]",
+   *                       "[WORKSTATION_CONFIG]",
+   *                       "[WORKSTATION]")
+   *                   .toString())
+   *           .setValidateOnly(true)
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   Workstation response = workstationsClient.startWorkstationAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture startWorkstationAsync( + StartWorkstationRequest request) { + return startWorkstationOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Starts running a workstation so that users can connect to it. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   StartWorkstationRequest request =
+   *       StartWorkstationRequest.newBuilder()
+   *           .setName(
+   *               WorkstationName.of(
+   *                       "[PROJECT]",
+   *                       "[LOCATION]",
+   *                       "[WORKSTATION_CLUSTER]",
+   *                       "[WORKSTATION_CONFIG]",
+   *                       "[WORKSTATION]")
+   *                   .toString())
+   *           .setValidateOnly(true)
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   OperationFuture future =
+   *       workstationsClient.startWorkstationOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Workstation response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + startWorkstationOperationCallable() { + return stub.startWorkstationOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Starts running a workstation so that users can connect to it. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   StartWorkstationRequest request =
+   *       StartWorkstationRequest.newBuilder()
+   *           .setName(
+   *               WorkstationName.of(
+   *                       "[PROJECT]",
+   *                       "[LOCATION]",
+   *                       "[WORKSTATION_CLUSTER]",
+   *                       "[WORKSTATION_CONFIG]",
+   *                       "[WORKSTATION]")
+   *                   .toString())
+   *           .setValidateOnly(true)
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   ApiFuture future =
+   *       workstationsClient.startWorkstationCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable startWorkstationCallable() { + return stub.startWorkstationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Stops running a workstation, reducing costs. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   WorkstationName name =
+   *       WorkstationName.of(
+   *           "[PROJECT]",
+   *           "[LOCATION]",
+   *           "[WORKSTATION_CLUSTER]",
+   *           "[WORKSTATION_CONFIG]",
+   *           "[WORKSTATION]");
+   *   Workstation response = workstationsClient.stopWorkstationAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Name of the workstation to stop. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture stopWorkstationAsync( + WorkstationName name) { + StopWorkstationRequest request = + StopWorkstationRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return stopWorkstationAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Stops running a workstation, reducing costs. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   String name =
+   *       WorkstationName.of(
+   *               "[PROJECT]",
+   *               "[LOCATION]",
+   *               "[WORKSTATION_CLUSTER]",
+   *               "[WORKSTATION_CONFIG]",
+   *               "[WORKSTATION]")
+   *           .toString();
+   *   Workstation response = workstationsClient.stopWorkstationAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Name of the workstation to stop. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture stopWorkstationAsync(String name) { + StopWorkstationRequest request = StopWorkstationRequest.newBuilder().setName(name).build(); + return stopWorkstationAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Stops running a workstation, reducing costs. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   StopWorkstationRequest request =
+   *       StopWorkstationRequest.newBuilder()
+   *           .setName(
+   *               WorkstationName.of(
+   *                       "[PROJECT]",
+   *                       "[LOCATION]",
+   *                       "[WORKSTATION_CLUSTER]",
+   *                       "[WORKSTATION_CONFIG]",
+   *                       "[WORKSTATION]")
+   *                   .toString())
+   *           .setValidateOnly(true)
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   Workstation response = workstationsClient.stopWorkstationAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture stopWorkstationAsync( + StopWorkstationRequest request) { + return stopWorkstationOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Stops running a workstation, reducing costs. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   StopWorkstationRequest request =
+   *       StopWorkstationRequest.newBuilder()
+   *           .setName(
+   *               WorkstationName.of(
+   *                       "[PROJECT]",
+   *                       "[LOCATION]",
+   *                       "[WORKSTATION_CLUSTER]",
+   *                       "[WORKSTATION_CONFIG]",
+   *                       "[WORKSTATION]")
+   *                   .toString())
+   *           .setValidateOnly(true)
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   OperationFuture future =
+   *       workstationsClient.stopWorkstationOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Workstation response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + stopWorkstationOperationCallable() { + return stub.stopWorkstationOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Stops running a workstation, reducing costs. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   StopWorkstationRequest request =
+   *       StopWorkstationRequest.newBuilder()
+   *           .setName(
+   *               WorkstationName.of(
+   *                       "[PROJECT]",
+   *                       "[LOCATION]",
+   *                       "[WORKSTATION_CLUSTER]",
+   *                       "[WORKSTATION_CONFIG]",
+   *                       "[WORKSTATION]")
+   *                   .toString())
+   *           .setValidateOnly(true)
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   ApiFuture future =
+   *       workstationsClient.stopWorkstationCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable stopWorkstationCallable() { + return stub.stopWorkstationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a short-lived credential that can be used to send authenticated and authorized traffic + * to a workstation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   WorkstationName workstation =
+   *       WorkstationName.of(
+   *           "[PROJECT]",
+   *           "[LOCATION]",
+   *           "[WORKSTATION_CLUSTER]",
+   *           "[WORKSTATION_CONFIG]",
+   *           "[WORKSTATION]");
+   *   GenerateAccessTokenResponse response = workstationsClient.generateAccessToken(workstation);
+   * }
+   * }
+ * + * @param workstation Required. Name of the workstation for which the access token should be + * generated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final GenerateAccessTokenResponse generateAccessToken(WorkstationName workstation) { + GenerateAccessTokenRequest request = + GenerateAccessTokenRequest.newBuilder() + .setWorkstation(workstation == null ? null : workstation.toString()) + .build(); + return generateAccessToken(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a short-lived credential that can be used to send authenticated and authorized traffic + * to a workstation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   String workstation =
+   *       WorkstationName.of(
+   *               "[PROJECT]",
+   *               "[LOCATION]",
+   *               "[WORKSTATION_CLUSTER]",
+   *               "[WORKSTATION_CONFIG]",
+   *               "[WORKSTATION]")
+   *           .toString();
+   *   GenerateAccessTokenResponse response = workstationsClient.generateAccessToken(workstation);
+   * }
+   * }
+ * + * @param workstation Required. Name of the workstation for which the access token should be + * generated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final GenerateAccessTokenResponse generateAccessToken(String workstation) { + GenerateAccessTokenRequest request = + GenerateAccessTokenRequest.newBuilder().setWorkstation(workstation).build(); + return generateAccessToken(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a short-lived credential that can be used to send authenticated and authorized traffic + * to a workstation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   GenerateAccessTokenRequest request =
+   *       GenerateAccessTokenRequest.newBuilder()
+   *           .setWorkstation(
+   *               WorkstationName.of(
+   *                       "[PROJECT]",
+   *                       "[LOCATION]",
+   *                       "[WORKSTATION_CLUSTER]",
+   *                       "[WORKSTATION_CONFIG]",
+   *                       "[WORKSTATION]")
+   *                   .toString())
+   *           .build();
+   *   GenerateAccessTokenResponse response = workstationsClient.generateAccessToken(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final GenerateAccessTokenResponse generateAccessToken(GenerateAccessTokenRequest request) { + return generateAccessTokenCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a short-lived credential that can be used to send authenticated and authorized traffic + * to a workstation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   GenerateAccessTokenRequest request =
+   *       GenerateAccessTokenRequest.newBuilder()
+   *           .setWorkstation(
+   *               WorkstationName.of(
+   *                       "[PROJECT]",
+   *                       "[LOCATION]",
+   *                       "[WORKSTATION_CLUSTER]",
+   *                       "[WORKSTATION_CONFIG]",
+   *                       "[WORKSTATION]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       workstationsClient.generateAccessTokenCallable().futureCall(request);
+   *   // Do something.
+   *   GenerateAccessTokenResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + generateAccessTokenCallable() { + return stub.generateAccessTokenCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replacesany existing policy. + * + *

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               WorkstationName.of(
+   *                       "[PROJECT]",
+   *                       "[LOCATION]",
+   *                       "[WORKSTATION_CLUSTER]",
+   *                       "[WORKSTATION_CONFIG]",
+   *                       "[WORKSTATION]")
+   *                   .toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Policy response = workstationsClient.setIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replacesany existing policy. + * + *

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               WorkstationName.of(
+   *                       "[PROJECT]",
+   *                       "[LOCATION]",
+   *                       "[WORKSTATION_CLUSTER]",
+   *                       "[WORKSTATION_CONFIG]",
+   *                       "[WORKSTATION]")
+   *                   .toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = workstationsClient.setIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policyif the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               WorkstationName.of(
+   *                       "[PROJECT]",
+   *                       "[LOCATION]",
+   *                       "[WORKSTATION_CLUSTER]",
+   *                       "[WORKSTATION_CONFIG]",
+   *                       "[WORKSTATION]")
+   *                   .toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   Policy response = workstationsClient.getIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policyif the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               WorkstationName.of(
+   *                       "[PROJECT]",
+   *                       "[LOCATION]",
+   *                       "[WORKSTATION_CLUSTER]",
+   *                       "[WORKSTATION_CONFIG]",
+   *                       "[WORKSTATION]")
+   *                   .toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = workstationsClient.getIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If theresource does not exist, + * this will return an empty set ofpermissions, not a `NOT_FOUND` error. + * + *

Note: This operation is designed to be used for buildingpermission-aware UIs and + * command-line tools, not for authorizationchecking. This operation may "fail open" without + * warning. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(
+   *               WorkstationName.of(
+   *                       "[PROJECT]",
+   *                       "[LOCATION]",
+   *                       "[WORKSTATION_CLUSTER]",
+   *                       "[WORKSTATION_CONFIG]",
+   *                       "[WORKSTATION]")
+   *                   .toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   TestIamPermissionsResponse response = workstationsClient.testIamPermissions(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If theresource does not exist, + * this will return an empty set ofpermissions, not a `NOT_FOUND` error. + * + *

Note: This operation is designed to be used for buildingpermission-aware UIs and + * command-line tools, not for authorizationchecking. This operation may "fail open" without + * warning. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(
+   *               WorkstationName.of(
+   *                       "[PROJECT]",
+   *                       "[LOCATION]",
+   *                       "[WORKSTATION_CLUSTER]",
+   *                       "[WORKSTATION_CONFIG]",
+   *                       "[WORKSTATION]")
+   *                   .toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       workstationsClient.testIamPermissionsCallable().futureCall(request);
+   *   // Do something.
+   *   TestIamPermissionsResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListWorkstationClustersPagedResponse + extends AbstractPagedListResponse< + ListWorkstationClustersRequest, + ListWorkstationClustersResponse, + WorkstationCluster, + ListWorkstationClustersPage, + ListWorkstationClustersFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + ListWorkstationClustersRequest, ListWorkstationClustersResponse, WorkstationCluster> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListWorkstationClustersPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListWorkstationClustersPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListWorkstationClustersPagedResponse(ListWorkstationClustersPage page) { + super(page, ListWorkstationClustersFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListWorkstationClustersPage + extends AbstractPage< + ListWorkstationClustersRequest, + ListWorkstationClustersResponse, + WorkstationCluster, + ListWorkstationClustersPage> { + + private ListWorkstationClustersPage( + PageContext< + ListWorkstationClustersRequest, ListWorkstationClustersResponse, WorkstationCluster> + context, + ListWorkstationClustersResponse response) { + super(context, response); + } + + private static ListWorkstationClustersPage createEmptyPage() { + return new ListWorkstationClustersPage(null, null); + } + + @Override + protected ListWorkstationClustersPage createPage( + PageContext< + ListWorkstationClustersRequest, ListWorkstationClustersResponse, WorkstationCluster> + context, + ListWorkstationClustersResponse response) { + return new ListWorkstationClustersPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + ListWorkstationClustersRequest, ListWorkstationClustersResponse, WorkstationCluster> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListWorkstationClustersFixedSizeCollection + extends AbstractFixedSizeCollection< + ListWorkstationClustersRequest, + ListWorkstationClustersResponse, + WorkstationCluster, + ListWorkstationClustersPage, + ListWorkstationClustersFixedSizeCollection> { + + private ListWorkstationClustersFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListWorkstationClustersFixedSizeCollection createEmptyCollection() { + return new ListWorkstationClustersFixedSizeCollection(null, 0); + } + + @Override + protected ListWorkstationClustersFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListWorkstationClustersFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListWorkstationConfigsPagedResponse + extends AbstractPagedListResponse< + ListWorkstationConfigsRequest, + ListWorkstationConfigsResponse, + WorkstationConfig, + ListWorkstationConfigsPage, + ListWorkstationConfigsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + ListWorkstationConfigsRequest, ListWorkstationConfigsResponse, WorkstationConfig> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListWorkstationConfigsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListWorkstationConfigsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListWorkstationConfigsPagedResponse(ListWorkstationConfigsPage page) { + super(page, ListWorkstationConfigsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListWorkstationConfigsPage + extends AbstractPage< + ListWorkstationConfigsRequest, + ListWorkstationConfigsResponse, + WorkstationConfig, + ListWorkstationConfigsPage> { + + private ListWorkstationConfigsPage( + PageContext< + ListWorkstationConfigsRequest, ListWorkstationConfigsResponse, WorkstationConfig> + context, + ListWorkstationConfigsResponse response) { + super(context, response); + } + + private static ListWorkstationConfigsPage createEmptyPage() { + return new ListWorkstationConfigsPage(null, null); + } + + @Override + protected ListWorkstationConfigsPage createPage( + PageContext< + ListWorkstationConfigsRequest, ListWorkstationConfigsResponse, WorkstationConfig> + context, + ListWorkstationConfigsResponse response) { + return new ListWorkstationConfigsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + ListWorkstationConfigsRequest, ListWorkstationConfigsResponse, WorkstationConfig> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListWorkstationConfigsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListWorkstationConfigsRequest, + ListWorkstationConfigsResponse, + WorkstationConfig, + ListWorkstationConfigsPage, + ListWorkstationConfigsFixedSizeCollection> { + + private ListWorkstationConfigsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListWorkstationConfigsFixedSizeCollection createEmptyCollection() { + return new ListWorkstationConfigsFixedSizeCollection(null, 0); + } + + @Override + protected ListWorkstationConfigsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListWorkstationConfigsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListUsableWorkstationConfigsPagedResponse + extends AbstractPagedListResponse< + ListUsableWorkstationConfigsRequest, + ListUsableWorkstationConfigsResponse, + WorkstationConfig, + ListUsableWorkstationConfigsPage, + ListUsableWorkstationConfigsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + ListUsableWorkstationConfigsRequest, + ListUsableWorkstationConfigsResponse, + WorkstationConfig> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListUsableWorkstationConfigsPage.createEmptyPage() + .createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListUsableWorkstationConfigsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListUsableWorkstationConfigsPagedResponse(ListUsableWorkstationConfigsPage page) { + super(page, ListUsableWorkstationConfigsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListUsableWorkstationConfigsPage + extends AbstractPage< + ListUsableWorkstationConfigsRequest, + ListUsableWorkstationConfigsResponse, + WorkstationConfig, + ListUsableWorkstationConfigsPage> { + + private ListUsableWorkstationConfigsPage( + PageContext< + ListUsableWorkstationConfigsRequest, + ListUsableWorkstationConfigsResponse, + WorkstationConfig> + context, + ListUsableWorkstationConfigsResponse response) { + super(context, response); + } + + private static ListUsableWorkstationConfigsPage createEmptyPage() { + return new ListUsableWorkstationConfigsPage(null, null); + } + + @Override + protected ListUsableWorkstationConfigsPage createPage( + PageContext< + ListUsableWorkstationConfigsRequest, + ListUsableWorkstationConfigsResponse, + WorkstationConfig> + context, + ListUsableWorkstationConfigsResponse response) { + return new ListUsableWorkstationConfigsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + ListUsableWorkstationConfigsRequest, + ListUsableWorkstationConfigsResponse, + WorkstationConfig> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListUsableWorkstationConfigsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListUsableWorkstationConfigsRequest, + ListUsableWorkstationConfigsResponse, + WorkstationConfig, + ListUsableWorkstationConfigsPage, + ListUsableWorkstationConfigsFixedSizeCollection> { + + private ListUsableWorkstationConfigsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListUsableWorkstationConfigsFixedSizeCollection createEmptyCollection() { + return new ListUsableWorkstationConfigsFixedSizeCollection(null, 0); + } + + @Override + protected ListUsableWorkstationConfigsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListUsableWorkstationConfigsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListWorkstationsPagedResponse + extends AbstractPagedListResponse< + ListWorkstationsRequest, + ListWorkstationsResponse, + Workstation, + ListWorkstationsPage, + ListWorkstationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListWorkstationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListWorkstationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListWorkstationsPagedResponse(ListWorkstationsPage page) { + super(page, ListWorkstationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListWorkstationsPage + extends AbstractPage< + ListWorkstationsRequest, ListWorkstationsResponse, Workstation, ListWorkstationsPage> { + + private ListWorkstationsPage( + PageContext context, + ListWorkstationsResponse response) { + super(context, response); + } + + private static ListWorkstationsPage createEmptyPage() { + return new ListWorkstationsPage(null, null); + } + + @Override + protected ListWorkstationsPage createPage( + PageContext context, + ListWorkstationsResponse response) { + return new ListWorkstationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListWorkstationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListWorkstationsRequest, + ListWorkstationsResponse, + Workstation, + ListWorkstationsPage, + ListWorkstationsFixedSizeCollection> { + + private ListWorkstationsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListWorkstationsFixedSizeCollection createEmptyCollection() { + return new ListWorkstationsFixedSizeCollection(null, 0); + } + + @Override + protected ListWorkstationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListWorkstationsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListUsableWorkstationsPagedResponse + extends AbstractPagedListResponse< + ListUsableWorkstationsRequest, + ListUsableWorkstationsResponse, + Workstation, + ListUsableWorkstationsPage, + ListUsableWorkstationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListUsableWorkstationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListUsableWorkstationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListUsableWorkstationsPagedResponse(ListUsableWorkstationsPage page) { + super(page, ListUsableWorkstationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListUsableWorkstationsPage + extends AbstractPage< + ListUsableWorkstationsRequest, + ListUsableWorkstationsResponse, + Workstation, + ListUsableWorkstationsPage> { + + private ListUsableWorkstationsPage( + PageContext + context, + ListUsableWorkstationsResponse response) { + super(context, response); + } + + private static ListUsableWorkstationsPage createEmptyPage() { + return new ListUsableWorkstationsPage(null, null); + } + + @Override + protected ListUsableWorkstationsPage createPage( + PageContext + context, + ListUsableWorkstationsResponse response) { + return new ListUsableWorkstationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListUsableWorkstationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListUsableWorkstationsRequest, + ListUsableWorkstationsResponse, + Workstation, + ListUsableWorkstationsPage, + ListUsableWorkstationsFixedSizeCollection> { + + private ListUsableWorkstationsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListUsableWorkstationsFixedSizeCollection createEmptyCollection() { + return new ListUsableWorkstationsFixedSizeCollection(null, 0); + } + + @Override + protected ListUsableWorkstationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListUsableWorkstationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-workstations/google-cloud-workstations/src/main/java/com/google/cloud/workstations/v1beta/WorkstationsSettings.java b/java-workstations/google-cloud-workstations/src/main/java/com/google/cloud/workstations/v1beta/WorkstationsSettings.java new file mode 100644 index 000000000000..e793dc609bd1 --- /dev/null +++ b/java-workstations/google-cloud-workstations/src/main/java/com/google/cloud/workstations/v1beta/WorkstationsSettings.java @@ -0,0 +1,646 @@ +/* + * Copyright 2022 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.workstations.v1beta; + +import static com.google.cloud.workstations.v1beta.WorkstationsClient.ListUsableWorkstationConfigsPagedResponse; +import static com.google.cloud.workstations.v1beta.WorkstationsClient.ListUsableWorkstationsPagedResponse; +import static com.google.cloud.workstations.v1beta.WorkstationsClient.ListWorkstationClustersPagedResponse; +import static com.google.cloud.workstations.v1beta.WorkstationsClient.ListWorkstationConfigsPagedResponse; +import static com.google.cloud.workstations.v1beta.WorkstationsClient.ListWorkstationsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.workstations.v1beta.stub.WorkstationsStubSettings; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link WorkstationsClient}. + * + *

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

    + *
  • The default service address (workstations.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of getWorkstationCluster to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * WorkstationsSettings.Builder workstationsSettingsBuilder = WorkstationsSettings.newBuilder();
+ * workstationsSettingsBuilder
+ *     .getWorkstationClusterSettings()
+ *     .setRetrySettings(
+ *         workstationsSettingsBuilder
+ *             .getWorkstationClusterSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * WorkstationsSettings workstationsSettings = workstationsSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class WorkstationsSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to getWorkstationCluster. */ + public UnaryCallSettings + getWorkstationClusterSettings() { + return ((WorkstationsStubSettings) getStubSettings()).getWorkstationClusterSettings(); + } + + /** Returns the object with the settings used for calls to listWorkstationClusters. */ + public PagedCallSettings< + ListWorkstationClustersRequest, + ListWorkstationClustersResponse, + ListWorkstationClustersPagedResponse> + listWorkstationClustersSettings() { + return ((WorkstationsStubSettings) getStubSettings()).listWorkstationClustersSettings(); + } + + /** Returns the object with the settings used for calls to createWorkstationCluster. */ + public UnaryCallSettings + createWorkstationClusterSettings() { + return ((WorkstationsStubSettings) getStubSettings()).createWorkstationClusterSettings(); + } + + /** Returns the object with the settings used for calls to createWorkstationCluster. */ + public OperationCallSettings< + CreateWorkstationClusterRequest, WorkstationCluster, OperationMetadata> + createWorkstationClusterOperationSettings() { + return ((WorkstationsStubSettings) getStubSettings()) + .createWorkstationClusterOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateWorkstationCluster. */ + public UnaryCallSettings + updateWorkstationClusterSettings() { + return ((WorkstationsStubSettings) getStubSettings()).updateWorkstationClusterSettings(); + } + + /** Returns the object with the settings used for calls to updateWorkstationCluster. */ + public OperationCallSettings< + UpdateWorkstationClusterRequest, WorkstationCluster, OperationMetadata> + updateWorkstationClusterOperationSettings() { + return ((WorkstationsStubSettings) getStubSettings()) + .updateWorkstationClusterOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteWorkstationCluster. */ + public UnaryCallSettings + deleteWorkstationClusterSettings() { + return ((WorkstationsStubSettings) getStubSettings()).deleteWorkstationClusterSettings(); + } + + /** Returns the object with the settings used for calls to deleteWorkstationCluster. */ + public OperationCallSettings< + DeleteWorkstationClusterRequest, WorkstationCluster, OperationMetadata> + deleteWorkstationClusterOperationSettings() { + return ((WorkstationsStubSettings) getStubSettings()) + .deleteWorkstationClusterOperationSettings(); + } + + /** Returns the object with the settings used for calls to getWorkstationConfig. */ + public UnaryCallSettings + getWorkstationConfigSettings() { + return ((WorkstationsStubSettings) getStubSettings()).getWorkstationConfigSettings(); + } + + /** Returns the object with the settings used for calls to listWorkstationConfigs. */ + public PagedCallSettings< + ListWorkstationConfigsRequest, + ListWorkstationConfigsResponse, + ListWorkstationConfigsPagedResponse> + listWorkstationConfigsSettings() { + return ((WorkstationsStubSettings) getStubSettings()).listWorkstationConfigsSettings(); + } + + /** Returns the object with the settings used for calls to listUsableWorkstationConfigs. */ + public PagedCallSettings< + ListUsableWorkstationConfigsRequest, + ListUsableWorkstationConfigsResponse, + ListUsableWorkstationConfigsPagedResponse> + listUsableWorkstationConfigsSettings() { + return ((WorkstationsStubSettings) getStubSettings()).listUsableWorkstationConfigsSettings(); + } + + /** Returns the object with the settings used for calls to createWorkstationConfig. */ + public UnaryCallSettings + createWorkstationConfigSettings() { + return ((WorkstationsStubSettings) getStubSettings()).createWorkstationConfigSettings(); + } + + /** Returns the object with the settings used for calls to createWorkstationConfig. */ + public OperationCallSettings + createWorkstationConfigOperationSettings() { + return ((WorkstationsStubSettings) getStubSettings()) + .createWorkstationConfigOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateWorkstationConfig. */ + public UnaryCallSettings + updateWorkstationConfigSettings() { + return ((WorkstationsStubSettings) getStubSettings()).updateWorkstationConfigSettings(); + } + + /** Returns the object with the settings used for calls to updateWorkstationConfig. */ + public OperationCallSettings + updateWorkstationConfigOperationSettings() { + return ((WorkstationsStubSettings) getStubSettings()) + .updateWorkstationConfigOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteWorkstationConfig. */ + public UnaryCallSettings + deleteWorkstationConfigSettings() { + return ((WorkstationsStubSettings) getStubSettings()).deleteWorkstationConfigSettings(); + } + + /** Returns the object with the settings used for calls to deleteWorkstationConfig. */ + public OperationCallSettings + deleteWorkstationConfigOperationSettings() { + return ((WorkstationsStubSettings) getStubSettings()) + .deleteWorkstationConfigOperationSettings(); + } + + /** Returns the object with the settings used for calls to getWorkstation. */ + public UnaryCallSettings getWorkstationSettings() { + return ((WorkstationsStubSettings) getStubSettings()).getWorkstationSettings(); + } + + /** Returns the object with the settings used for calls to listWorkstations. */ + public PagedCallSettings< + ListWorkstationsRequest, ListWorkstationsResponse, ListWorkstationsPagedResponse> + listWorkstationsSettings() { + return ((WorkstationsStubSettings) getStubSettings()).listWorkstationsSettings(); + } + + /** Returns the object with the settings used for calls to listUsableWorkstations. */ + public PagedCallSettings< + ListUsableWorkstationsRequest, + ListUsableWorkstationsResponse, + ListUsableWorkstationsPagedResponse> + listUsableWorkstationsSettings() { + return ((WorkstationsStubSettings) getStubSettings()).listUsableWorkstationsSettings(); + } + + /** Returns the object with the settings used for calls to createWorkstation. */ + public UnaryCallSettings createWorkstationSettings() { + return ((WorkstationsStubSettings) getStubSettings()).createWorkstationSettings(); + } + + /** Returns the object with the settings used for calls to createWorkstation. */ + public OperationCallSettings + createWorkstationOperationSettings() { + return ((WorkstationsStubSettings) getStubSettings()).createWorkstationOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateWorkstation. */ + public UnaryCallSettings updateWorkstationSettings() { + return ((WorkstationsStubSettings) getStubSettings()).updateWorkstationSettings(); + } + + /** Returns the object with the settings used for calls to updateWorkstation. */ + public OperationCallSettings + updateWorkstationOperationSettings() { + return ((WorkstationsStubSettings) getStubSettings()).updateWorkstationOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteWorkstation. */ + public UnaryCallSettings deleteWorkstationSettings() { + return ((WorkstationsStubSettings) getStubSettings()).deleteWorkstationSettings(); + } + + /** Returns the object with the settings used for calls to deleteWorkstation. */ + public OperationCallSettings + deleteWorkstationOperationSettings() { + return ((WorkstationsStubSettings) getStubSettings()).deleteWorkstationOperationSettings(); + } + + /** Returns the object with the settings used for calls to startWorkstation. */ + public UnaryCallSettings startWorkstationSettings() { + return ((WorkstationsStubSettings) getStubSettings()).startWorkstationSettings(); + } + + /** Returns the object with the settings used for calls to startWorkstation. */ + public OperationCallSettings + startWorkstationOperationSettings() { + return ((WorkstationsStubSettings) getStubSettings()).startWorkstationOperationSettings(); + } + + /** Returns the object with the settings used for calls to stopWorkstation. */ + public UnaryCallSettings stopWorkstationSettings() { + return ((WorkstationsStubSettings) getStubSettings()).stopWorkstationSettings(); + } + + /** Returns the object with the settings used for calls to stopWorkstation. */ + public OperationCallSettings + stopWorkstationOperationSettings() { + return ((WorkstationsStubSettings) getStubSettings()).stopWorkstationOperationSettings(); + } + + /** Returns the object with the settings used for calls to generateAccessToken. */ + public UnaryCallSettings + generateAccessTokenSettings() { + return ((WorkstationsStubSettings) getStubSettings()).generateAccessTokenSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((WorkstationsStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((WorkstationsStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((WorkstationsStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + public static final WorkstationsSettings create(WorkstationsStubSettings stub) + throws IOException { + return new WorkstationsSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return WorkstationsStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return WorkstationsStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return WorkstationsStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return WorkstationsStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return WorkstationsStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return WorkstationsStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return WorkstationsStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return WorkstationsStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected WorkstationsSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for WorkstationsSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(WorkstationsStubSettings.newBuilder(clientContext)); + } + + protected Builder(WorkstationsSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(WorkstationsStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(WorkstationsStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(WorkstationsStubSettings.newHttpJsonBuilder()); + } + + public WorkstationsStubSettings.Builder getStubSettingsBuilder() { + return ((WorkstationsStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to getWorkstationCluster. */ + public UnaryCallSettings.Builder + getWorkstationClusterSettings() { + return getStubSettingsBuilder().getWorkstationClusterSettings(); + } + + /** Returns the builder for the settings used for calls to listWorkstationClusters. */ + public PagedCallSettings.Builder< + ListWorkstationClustersRequest, + ListWorkstationClustersResponse, + ListWorkstationClustersPagedResponse> + listWorkstationClustersSettings() { + return getStubSettingsBuilder().listWorkstationClustersSettings(); + } + + /** Returns the builder for the settings used for calls to createWorkstationCluster. */ + public UnaryCallSettings.Builder + createWorkstationClusterSettings() { + return getStubSettingsBuilder().createWorkstationClusterSettings(); + } + + /** Returns the builder for the settings used for calls to createWorkstationCluster. */ + public OperationCallSettings.Builder< + CreateWorkstationClusterRequest, WorkstationCluster, OperationMetadata> + createWorkstationClusterOperationSettings() { + return getStubSettingsBuilder().createWorkstationClusterOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateWorkstationCluster. */ + public UnaryCallSettings.Builder + updateWorkstationClusterSettings() { + return getStubSettingsBuilder().updateWorkstationClusterSettings(); + } + + /** Returns the builder for the settings used for calls to updateWorkstationCluster. */ + public OperationCallSettings.Builder< + UpdateWorkstationClusterRequest, WorkstationCluster, OperationMetadata> + updateWorkstationClusterOperationSettings() { + return getStubSettingsBuilder().updateWorkstationClusterOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteWorkstationCluster. */ + public UnaryCallSettings.Builder + deleteWorkstationClusterSettings() { + return getStubSettingsBuilder().deleteWorkstationClusterSettings(); + } + + /** Returns the builder for the settings used for calls to deleteWorkstationCluster. */ + public OperationCallSettings.Builder< + DeleteWorkstationClusterRequest, WorkstationCluster, OperationMetadata> + deleteWorkstationClusterOperationSettings() { + return getStubSettingsBuilder().deleteWorkstationClusterOperationSettings(); + } + + /** Returns the builder for the settings used for calls to getWorkstationConfig. */ + public UnaryCallSettings.Builder + getWorkstationConfigSettings() { + return getStubSettingsBuilder().getWorkstationConfigSettings(); + } + + /** Returns the builder for the settings used for calls to listWorkstationConfigs. */ + public PagedCallSettings.Builder< + ListWorkstationConfigsRequest, + ListWorkstationConfigsResponse, + ListWorkstationConfigsPagedResponse> + listWorkstationConfigsSettings() { + return getStubSettingsBuilder().listWorkstationConfigsSettings(); + } + + /** Returns the builder for the settings used for calls to listUsableWorkstationConfigs. */ + public PagedCallSettings.Builder< + ListUsableWorkstationConfigsRequest, + ListUsableWorkstationConfigsResponse, + ListUsableWorkstationConfigsPagedResponse> + listUsableWorkstationConfigsSettings() { + return getStubSettingsBuilder().listUsableWorkstationConfigsSettings(); + } + + /** Returns the builder for the settings used for calls to createWorkstationConfig. */ + public UnaryCallSettings.Builder + createWorkstationConfigSettings() { + return getStubSettingsBuilder().createWorkstationConfigSettings(); + } + + /** Returns the builder for the settings used for calls to createWorkstationConfig. */ + public OperationCallSettings.Builder< + CreateWorkstationConfigRequest, WorkstationConfig, OperationMetadata> + createWorkstationConfigOperationSettings() { + return getStubSettingsBuilder().createWorkstationConfigOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateWorkstationConfig. */ + public UnaryCallSettings.Builder + updateWorkstationConfigSettings() { + return getStubSettingsBuilder().updateWorkstationConfigSettings(); + } + + /** Returns the builder for the settings used for calls to updateWorkstationConfig. */ + public OperationCallSettings.Builder< + UpdateWorkstationConfigRequest, WorkstationConfig, OperationMetadata> + updateWorkstationConfigOperationSettings() { + return getStubSettingsBuilder().updateWorkstationConfigOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteWorkstationConfig. */ + public UnaryCallSettings.Builder + deleteWorkstationConfigSettings() { + return getStubSettingsBuilder().deleteWorkstationConfigSettings(); + } + + /** Returns the builder for the settings used for calls to deleteWorkstationConfig. */ + public OperationCallSettings.Builder< + DeleteWorkstationConfigRequest, WorkstationConfig, OperationMetadata> + deleteWorkstationConfigOperationSettings() { + return getStubSettingsBuilder().deleteWorkstationConfigOperationSettings(); + } + + /** Returns the builder for the settings used for calls to getWorkstation. */ + public UnaryCallSettings.Builder getWorkstationSettings() { + return getStubSettingsBuilder().getWorkstationSettings(); + } + + /** Returns the builder for the settings used for calls to listWorkstations. */ + public PagedCallSettings.Builder< + ListWorkstationsRequest, ListWorkstationsResponse, ListWorkstationsPagedResponse> + listWorkstationsSettings() { + return getStubSettingsBuilder().listWorkstationsSettings(); + } + + /** Returns the builder for the settings used for calls to listUsableWorkstations. */ + public PagedCallSettings.Builder< + ListUsableWorkstationsRequest, + ListUsableWorkstationsResponse, + ListUsableWorkstationsPagedResponse> + listUsableWorkstationsSettings() { + return getStubSettingsBuilder().listUsableWorkstationsSettings(); + } + + /** Returns the builder for the settings used for calls to createWorkstation. */ + public UnaryCallSettings.Builder + createWorkstationSettings() { + return getStubSettingsBuilder().createWorkstationSettings(); + } + + /** Returns the builder for the settings used for calls to createWorkstation. */ + public OperationCallSettings.Builder + createWorkstationOperationSettings() { + return getStubSettingsBuilder().createWorkstationOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateWorkstation. */ + public UnaryCallSettings.Builder + updateWorkstationSettings() { + return getStubSettingsBuilder().updateWorkstationSettings(); + } + + /** Returns the builder for the settings used for calls to updateWorkstation. */ + public OperationCallSettings.Builder + updateWorkstationOperationSettings() { + return getStubSettingsBuilder().updateWorkstationOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteWorkstation. */ + public UnaryCallSettings.Builder + deleteWorkstationSettings() { + return getStubSettingsBuilder().deleteWorkstationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteWorkstation. */ + public OperationCallSettings.Builder + deleteWorkstationOperationSettings() { + return getStubSettingsBuilder().deleteWorkstationOperationSettings(); + } + + /** Returns the builder for the settings used for calls to startWorkstation. */ + public UnaryCallSettings.Builder + startWorkstationSettings() { + return getStubSettingsBuilder().startWorkstationSettings(); + } + + /** Returns the builder for the settings used for calls to startWorkstation. */ + public OperationCallSettings.Builder + startWorkstationOperationSettings() { + return getStubSettingsBuilder().startWorkstationOperationSettings(); + } + + /** Returns the builder for the settings used for calls to stopWorkstation. */ + public UnaryCallSettings.Builder stopWorkstationSettings() { + return getStubSettingsBuilder().stopWorkstationSettings(); + } + + /** Returns the builder for the settings used for calls to stopWorkstation. */ + public OperationCallSettings.Builder + stopWorkstationOperationSettings() { + return getStubSettingsBuilder().stopWorkstationOperationSettings(); + } + + /** Returns the builder for the settings used for calls to generateAccessToken. */ + public UnaryCallSettings.Builder + generateAccessTokenSettings() { + return getStubSettingsBuilder().generateAccessTokenSettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public WorkstationsSettings build() throws IOException { + return new WorkstationsSettings(this); + } + } +} diff --git a/java-workstations/google-cloud-workstations/src/main/java/com/google/cloud/workstations/v1beta/gapic_metadata.json b/java-workstations/google-cloud-workstations/src/main/java/com/google/cloud/workstations/v1beta/gapic_metadata.json new file mode 100644 index 000000000000..43d1f65780c5 --- /dev/null +++ b/java-workstations/google-cloud-workstations/src/main/java/com/google/cloud/workstations/v1beta/gapic_metadata.json @@ -0,0 +1,87 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.workstations.v1beta", + "libraryPackage": "com.google.cloud.workstations.v1beta", + "services": { + "Workstations": { + "clients": { + "grpc": { + "libraryClient": "WorkstationsClient", + "rpcs": { + "CreateWorkstation": { + "methods": ["createWorkstationAsync", "createWorkstationAsync", "createWorkstationAsync", "createWorkstationOperationCallable", "createWorkstationCallable"] + }, + "CreateWorkstationCluster": { + "methods": ["createWorkstationClusterAsync", "createWorkstationClusterAsync", "createWorkstationClusterAsync", "createWorkstationClusterOperationCallable", "createWorkstationClusterCallable"] + }, + "CreateWorkstationConfig": { + "methods": ["createWorkstationConfigAsync", "createWorkstationConfigAsync", "createWorkstationConfigAsync", "createWorkstationConfigOperationCallable", "createWorkstationConfigCallable"] + }, + "DeleteWorkstation": { + "methods": ["deleteWorkstationAsync", "deleteWorkstationAsync", "deleteWorkstationAsync", "deleteWorkstationOperationCallable", "deleteWorkstationCallable"] + }, + "DeleteWorkstationCluster": { + "methods": ["deleteWorkstationClusterAsync", "deleteWorkstationClusterAsync", "deleteWorkstationClusterAsync", "deleteWorkstationClusterOperationCallable", "deleteWorkstationClusterCallable"] + }, + "DeleteWorkstationConfig": { + "methods": ["deleteWorkstationConfigAsync", "deleteWorkstationConfigAsync", "deleteWorkstationConfigAsync", "deleteWorkstationConfigOperationCallable", "deleteWorkstationConfigCallable"] + }, + "GenerateAccessToken": { + "methods": ["generateAccessToken", "generateAccessToken", "generateAccessToken", "generateAccessTokenCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, + "GetWorkstation": { + "methods": ["getWorkstation", "getWorkstation", "getWorkstation", "getWorkstationCallable"] + }, + "GetWorkstationCluster": { + "methods": ["getWorkstationCluster", "getWorkstationCluster", "getWorkstationCluster", "getWorkstationClusterCallable"] + }, + "GetWorkstationConfig": { + "methods": ["getWorkstationConfig", "getWorkstationConfig", "getWorkstationConfig", "getWorkstationConfigCallable"] + }, + "ListUsableWorkstationConfigs": { + "methods": ["listUsableWorkstationConfigs", "listUsableWorkstationConfigs", "listUsableWorkstationConfigs", "listUsableWorkstationConfigsPagedCallable", "listUsableWorkstationConfigsCallable"] + }, + "ListUsableWorkstations": { + "methods": ["listUsableWorkstations", "listUsableWorkstations", "listUsableWorkstations", "listUsableWorkstationsPagedCallable", "listUsableWorkstationsCallable"] + }, + "ListWorkstationClusters": { + "methods": ["listWorkstationClusters", "listWorkstationClusters", "listWorkstationClusters", "listWorkstationClustersPagedCallable", "listWorkstationClustersCallable"] + }, + "ListWorkstationConfigs": { + "methods": ["listWorkstationConfigs", "listWorkstationConfigs", "listWorkstationConfigs", "listWorkstationConfigsPagedCallable", "listWorkstationConfigsCallable"] + }, + "ListWorkstations": { + "methods": ["listWorkstations", "listWorkstations", "listWorkstations", "listWorkstationsPagedCallable", "listWorkstationsCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, + "StartWorkstation": { + "methods": ["startWorkstationAsync", "startWorkstationAsync", "startWorkstationAsync", "startWorkstationOperationCallable", "startWorkstationCallable"] + }, + "StopWorkstation": { + "methods": ["stopWorkstationAsync", "stopWorkstationAsync", "stopWorkstationAsync", "stopWorkstationOperationCallable", "stopWorkstationCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + }, + "UpdateWorkstation": { + "methods": ["updateWorkstationAsync", "updateWorkstationAsync", "updateWorkstationOperationCallable", "updateWorkstationCallable"] + }, + "UpdateWorkstationCluster": { + "methods": ["updateWorkstationClusterAsync", "updateWorkstationClusterAsync", "updateWorkstationClusterOperationCallable", "updateWorkstationClusterCallable"] + }, + "UpdateWorkstationConfig": { + "methods": ["updateWorkstationConfigAsync", "updateWorkstationConfigAsync", "updateWorkstationConfigOperationCallable", "updateWorkstationConfigCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-workstations/google-cloud-workstations/src/main/java/com/google/cloud/workstations/v1beta/package-info.java b/java-workstations/google-cloud-workstations/src/main/java/com/google/cloud/workstations/v1beta/package-info.java new file mode 100644 index 000000000000..93021631c449 --- /dev/null +++ b/java-workstations/google-cloud-workstations/src/main/java/com/google/cloud/workstations/v1beta/package-info.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 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. + */ + +/** + * A client to Cloud Workstations API + * + *

The interfaces provided are listed below, along with usage samples. + * + *

======================= WorkstationsClient ======================= + * + *

Service Description: Service for interacting with Cloud Workstations. + * + *

Sample for WorkstationsClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
+ *   WorkstationClusterName name =
+ *       WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]");
+ *   WorkstationCluster response = workstationsClient.getWorkstationCluster(name);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.workstations.v1beta; + +import javax.annotation.Generated; diff --git a/java-workstations/google-cloud-workstations/src/main/java/com/google/cloud/workstations/v1beta/stub/GrpcWorkstationsCallableFactory.java b/java-workstations/google-cloud-workstations/src/main/java/com/google/cloud/workstations/v1beta/stub/GrpcWorkstationsCallableFactory.java new file mode 100644 index 000000000000..58c544abd8a8 --- /dev/null +++ b/java-workstations/google-cloud-workstations/src/main/java/com/google/cloud/workstations/v1beta/stub/GrpcWorkstationsCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2022 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.workstations.v1beta.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the Workstations service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcWorkstationsCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-workstations/google-cloud-workstations/src/main/java/com/google/cloud/workstations/v1beta/stub/GrpcWorkstationsStub.java b/java-workstations/google-cloud-workstations/src/main/java/com/google/cloud/workstations/v1beta/stub/GrpcWorkstationsStub.java new file mode 100644 index 000000000000..f7ce0523e88e --- /dev/null +++ b/java-workstations/google-cloud-workstations/src/main/java/com/google/cloud/workstations/v1beta/stub/GrpcWorkstationsStub.java @@ -0,0 +1,1181 @@ +/* + * Copyright 2022 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.workstations.v1beta.stub; + +import static com.google.cloud.workstations.v1beta.WorkstationsClient.ListUsableWorkstationConfigsPagedResponse; +import static com.google.cloud.workstations.v1beta.WorkstationsClient.ListUsableWorkstationsPagedResponse; +import static com.google.cloud.workstations.v1beta.WorkstationsClient.ListWorkstationClustersPagedResponse; +import static com.google.cloud.workstations.v1beta.WorkstationsClient.ListWorkstationConfigsPagedResponse; +import static com.google.cloud.workstations.v1beta.WorkstationsClient.ListWorkstationsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest; +import com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest; +import com.google.cloud.workstations.v1beta.CreateWorkstationRequest; +import com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest; +import com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest; +import com.google.cloud.workstations.v1beta.DeleteWorkstationRequest; +import com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest; +import com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse; +import com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest; +import com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest; +import com.google.cloud.workstations.v1beta.GetWorkstationRequest; +import com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest; +import com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse; +import com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest; +import com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse; +import com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest; +import com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse; +import com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest; +import com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse; +import com.google.cloud.workstations.v1beta.ListWorkstationsRequest; +import com.google.cloud.workstations.v1beta.ListWorkstationsResponse; +import com.google.cloud.workstations.v1beta.OperationMetadata; +import com.google.cloud.workstations.v1beta.StartWorkstationRequest; +import com.google.cloud.workstations.v1beta.StopWorkstationRequest; +import com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest; +import com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest; +import com.google.cloud.workstations.v1beta.UpdateWorkstationRequest; +import com.google.cloud.workstations.v1beta.Workstation; +import com.google.cloud.workstations.v1beta.WorkstationCluster; +import com.google.cloud.workstations.v1beta.WorkstationConfig; +import com.google.common.collect.ImmutableMap; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the Workstations service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcWorkstationsStub extends WorkstationsStub { + private static final MethodDescriptor + getWorkstationClusterMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.workstations.v1beta.Workstations/GetWorkstationCluster") + .setRequestMarshaller( + ProtoUtils.marshaller(GetWorkstationClusterRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(WorkstationCluster.getDefaultInstance())) + .build(); + + private static final MethodDescriptor< + ListWorkstationClustersRequest, ListWorkstationClustersResponse> + listWorkstationClustersMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.workstations.v1beta.Workstations/ListWorkstationClusters") + .setRequestMarshaller( + ProtoUtils.marshaller(ListWorkstationClustersRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListWorkstationClustersResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createWorkstationClusterMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.workstations.v1beta.Workstations/CreateWorkstationCluster") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateWorkstationClusterRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateWorkstationClusterMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.workstations.v1beta.Workstations/UpdateWorkstationCluster") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateWorkstationClusterRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteWorkstationClusterMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.workstations.v1beta.Workstations/DeleteWorkstationCluster") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteWorkstationClusterRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getWorkstationConfigMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.workstations.v1beta.Workstations/GetWorkstationConfig") + .setRequestMarshaller( + ProtoUtils.marshaller(GetWorkstationConfigRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(WorkstationConfig.getDefaultInstance())) + .build(); + + private static final MethodDescriptor< + ListWorkstationConfigsRequest, ListWorkstationConfigsResponse> + listWorkstationConfigsMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.workstations.v1beta.Workstations/ListWorkstationConfigs") + .setRequestMarshaller( + ProtoUtils.marshaller(ListWorkstationConfigsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListWorkstationConfigsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor< + ListUsableWorkstationConfigsRequest, ListUsableWorkstationConfigsResponse> + listUsableWorkstationConfigsMethodDescriptor = + MethodDescriptor + . + newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.workstations.v1beta.Workstations/ListUsableWorkstationConfigs") + .setRequestMarshaller( + ProtoUtils.marshaller(ListUsableWorkstationConfigsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListUsableWorkstationConfigsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createWorkstationConfigMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.workstations.v1beta.Workstations/CreateWorkstationConfig") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateWorkstationConfigRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateWorkstationConfigMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.workstations.v1beta.Workstations/UpdateWorkstationConfig") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateWorkstationConfigRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteWorkstationConfigMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.workstations.v1beta.Workstations/DeleteWorkstationConfig") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteWorkstationConfigRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getWorkstationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.workstations.v1beta.Workstations/GetWorkstation") + .setRequestMarshaller( + ProtoUtils.marshaller(GetWorkstationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Workstation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listWorkstationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.workstations.v1beta.Workstations/ListWorkstations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListWorkstationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListWorkstationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor< + ListUsableWorkstationsRequest, ListUsableWorkstationsResponse> + listUsableWorkstationsMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.workstations.v1beta.Workstations/ListUsableWorkstations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListUsableWorkstationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListUsableWorkstationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createWorkstationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.workstations.v1beta.Workstations/CreateWorkstation") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateWorkstationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateWorkstationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.workstations.v1beta.Workstations/UpdateWorkstation") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateWorkstationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteWorkstationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.workstations.v1beta.Workstations/DeleteWorkstation") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteWorkstationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + startWorkstationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.workstations.v1beta.Workstations/StartWorkstation") + .setRequestMarshaller( + ProtoUtils.marshaller(StartWorkstationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + stopWorkstationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.workstations.v1beta.Workstations/StopWorkstation") + .setRequestMarshaller( + ProtoUtils.marshaller(StopWorkstationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + generateAccessTokenMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.workstations.v1beta.Workstations/GenerateAccessToken") + .setRequestMarshaller( + ProtoUtils.marshaller(GenerateAccessTokenRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(GenerateAccessTokenResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable + getWorkstationClusterCallable; + private final UnaryCallable + listWorkstationClustersCallable; + private final UnaryCallable + listWorkstationClustersPagedCallable; + private final UnaryCallable + createWorkstationClusterCallable; + private final OperationCallable< + CreateWorkstationClusterRequest, WorkstationCluster, OperationMetadata> + createWorkstationClusterOperationCallable; + private final UnaryCallable + updateWorkstationClusterCallable; + private final OperationCallable< + UpdateWorkstationClusterRequest, WorkstationCluster, OperationMetadata> + updateWorkstationClusterOperationCallable; + private final UnaryCallable + deleteWorkstationClusterCallable; + private final OperationCallable< + DeleteWorkstationClusterRequest, WorkstationCluster, OperationMetadata> + deleteWorkstationClusterOperationCallable; + private final UnaryCallable + getWorkstationConfigCallable; + private final UnaryCallable + listWorkstationConfigsCallable; + private final UnaryCallable + listWorkstationConfigsPagedCallable; + private final UnaryCallable< + ListUsableWorkstationConfigsRequest, ListUsableWorkstationConfigsResponse> + listUsableWorkstationConfigsCallable; + private final UnaryCallable< + ListUsableWorkstationConfigsRequest, ListUsableWorkstationConfigsPagedResponse> + listUsableWorkstationConfigsPagedCallable; + private final UnaryCallable + createWorkstationConfigCallable; + private final OperationCallable< + CreateWorkstationConfigRequest, WorkstationConfig, OperationMetadata> + createWorkstationConfigOperationCallable; + private final UnaryCallable + updateWorkstationConfigCallable; + private final OperationCallable< + UpdateWorkstationConfigRequest, WorkstationConfig, OperationMetadata> + updateWorkstationConfigOperationCallable; + private final UnaryCallable + deleteWorkstationConfigCallable; + private final OperationCallable< + DeleteWorkstationConfigRequest, WorkstationConfig, OperationMetadata> + deleteWorkstationConfigOperationCallable; + private final UnaryCallable getWorkstationCallable; + private final UnaryCallable + listWorkstationsCallable; + private final UnaryCallable + listWorkstationsPagedCallable; + private final UnaryCallable + listUsableWorkstationsCallable; + private final UnaryCallable + listUsableWorkstationsPagedCallable; + private final UnaryCallable createWorkstationCallable; + private final OperationCallable + createWorkstationOperationCallable; + private final UnaryCallable updateWorkstationCallable; + private final OperationCallable + updateWorkstationOperationCallable; + private final UnaryCallable deleteWorkstationCallable; + private final OperationCallable + deleteWorkstationOperationCallable; + private final UnaryCallable startWorkstationCallable; + private final OperationCallable + startWorkstationOperationCallable; + private final UnaryCallable stopWorkstationCallable; + private final OperationCallable + stopWorkstationOperationCallable; + private final UnaryCallable + generateAccessTokenCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcWorkstationsStub create(WorkstationsStubSettings settings) + throws IOException { + return new GrpcWorkstationsStub(settings, ClientContext.create(settings)); + } + + public static final GrpcWorkstationsStub create(ClientContext clientContext) throws IOException { + return new GrpcWorkstationsStub(WorkstationsStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcWorkstationsStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcWorkstationsStub( + WorkstationsStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcWorkstationsStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcWorkstationsStub(WorkstationsStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcWorkstationsCallableFactory()); + } + + /** + * Constructs an instance of GrpcWorkstationsStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcWorkstationsStub( + WorkstationsStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + getWorkstationClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getWorkstationClusterMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + listWorkstationClustersTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(listWorkstationClustersMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings + createWorkstationClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createWorkstationClusterMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings + updateWorkstationClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateWorkstationClusterMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "workstation_cluster.name", + String.valueOf(request.getWorkstationCluster().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + deleteWorkstationClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteWorkstationClusterMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + getWorkstationConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getWorkstationConfigMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + listWorkstationConfigsTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(listWorkstationConfigsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings + listUsableWorkstationConfigsTransportSettings = + GrpcCallSettings + . + newBuilder() + .setMethodDescriptor(listUsableWorkstationConfigsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings + createWorkstationConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createWorkstationConfigMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings + updateWorkstationConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateWorkstationConfigMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "workstation_config.name", + String.valueOf(request.getWorkstationConfig().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + deleteWorkstationConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteWorkstationConfigMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings getWorkstationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getWorkstationMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + listWorkstationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listWorkstationsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings + listUsableWorkstationsTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(listUsableWorkstationsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings createWorkstationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createWorkstationMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings updateWorkstationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateWorkstationMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "workstation.name", String.valueOf(request.getWorkstation().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteWorkstationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteWorkstationMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings startWorkstationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(startWorkstationMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings stopWorkstationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(stopWorkstationMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + generateAccessTokenTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(generateAccessTokenMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("workstation", String.valueOf(request.getWorkstation())); + return params.build(); + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); + + this.getWorkstationClusterCallable = + callableFactory.createUnaryCallable( + getWorkstationClusterTransportSettings, + settings.getWorkstationClusterSettings(), + clientContext); + this.listWorkstationClustersCallable = + callableFactory.createUnaryCallable( + listWorkstationClustersTransportSettings, + settings.listWorkstationClustersSettings(), + clientContext); + this.listWorkstationClustersPagedCallable = + callableFactory.createPagedCallable( + listWorkstationClustersTransportSettings, + settings.listWorkstationClustersSettings(), + clientContext); + this.createWorkstationClusterCallable = + callableFactory.createUnaryCallable( + createWorkstationClusterTransportSettings, + settings.createWorkstationClusterSettings(), + clientContext); + this.createWorkstationClusterOperationCallable = + callableFactory.createOperationCallable( + createWorkstationClusterTransportSettings, + settings.createWorkstationClusterOperationSettings(), + clientContext, + operationsStub); + this.updateWorkstationClusterCallable = + callableFactory.createUnaryCallable( + updateWorkstationClusterTransportSettings, + settings.updateWorkstationClusterSettings(), + clientContext); + this.updateWorkstationClusterOperationCallable = + callableFactory.createOperationCallable( + updateWorkstationClusterTransportSettings, + settings.updateWorkstationClusterOperationSettings(), + clientContext, + operationsStub); + this.deleteWorkstationClusterCallable = + callableFactory.createUnaryCallable( + deleteWorkstationClusterTransportSettings, + settings.deleteWorkstationClusterSettings(), + clientContext); + this.deleteWorkstationClusterOperationCallable = + callableFactory.createOperationCallable( + deleteWorkstationClusterTransportSettings, + settings.deleteWorkstationClusterOperationSettings(), + clientContext, + operationsStub); + this.getWorkstationConfigCallable = + callableFactory.createUnaryCallable( + getWorkstationConfigTransportSettings, + settings.getWorkstationConfigSettings(), + clientContext); + this.listWorkstationConfigsCallable = + callableFactory.createUnaryCallable( + listWorkstationConfigsTransportSettings, + settings.listWorkstationConfigsSettings(), + clientContext); + this.listWorkstationConfigsPagedCallable = + callableFactory.createPagedCallable( + listWorkstationConfigsTransportSettings, + settings.listWorkstationConfigsSettings(), + clientContext); + this.listUsableWorkstationConfigsCallable = + callableFactory.createUnaryCallable( + listUsableWorkstationConfigsTransportSettings, + settings.listUsableWorkstationConfigsSettings(), + clientContext); + this.listUsableWorkstationConfigsPagedCallable = + callableFactory.createPagedCallable( + listUsableWorkstationConfigsTransportSettings, + settings.listUsableWorkstationConfigsSettings(), + clientContext); + this.createWorkstationConfigCallable = + callableFactory.createUnaryCallable( + createWorkstationConfigTransportSettings, + settings.createWorkstationConfigSettings(), + clientContext); + this.createWorkstationConfigOperationCallable = + callableFactory.createOperationCallable( + createWorkstationConfigTransportSettings, + settings.createWorkstationConfigOperationSettings(), + clientContext, + operationsStub); + this.updateWorkstationConfigCallable = + callableFactory.createUnaryCallable( + updateWorkstationConfigTransportSettings, + settings.updateWorkstationConfigSettings(), + clientContext); + this.updateWorkstationConfigOperationCallable = + callableFactory.createOperationCallable( + updateWorkstationConfigTransportSettings, + settings.updateWorkstationConfigOperationSettings(), + clientContext, + operationsStub); + this.deleteWorkstationConfigCallable = + callableFactory.createUnaryCallable( + deleteWorkstationConfigTransportSettings, + settings.deleteWorkstationConfigSettings(), + clientContext); + this.deleteWorkstationConfigOperationCallable = + callableFactory.createOperationCallable( + deleteWorkstationConfigTransportSettings, + settings.deleteWorkstationConfigOperationSettings(), + clientContext, + operationsStub); + this.getWorkstationCallable = + callableFactory.createUnaryCallable( + getWorkstationTransportSettings, settings.getWorkstationSettings(), clientContext); + this.listWorkstationsCallable = + callableFactory.createUnaryCallable( + listWorkstationsTransportSettings, settings.listWorkstationsSettings(), clientContext); + this.listWorkstationsPagedCallable = + callableFactory.createPagedCallable( + listWorkstationsTransportSettings, settings.listWorkstationsSettings(), clientContext); + this.listUsableWorkstationsCallable = + callableFactory.createUnaryCallable( + listUsableWorkstationsTransportSettings, + settings.listUsableWorkstationsSettings(), + clientContext); + this.listUsableWorkstationsPagedCallable = + callableFactory.createPagedCallable( + listUsableWorkstationsTransportSettings, + settings.listUsableWorkstationsSettings(), + clientContext); + this.createWorkstationCallable = + callableFactory.createUnaryCallable( + createWorkstationTransportSettings, + settings.createWorkstationSettings(), + clientContext); + this.createWorkstationOperationCallable = + callableFactory.createOperationCallable( + createWorkstationTransportSettings, + settings.createWorkstationOperationSettings(), + clientContext, + operationsStub); + this.updateWorkstationCallable = + callableFactory.createUnaryCallable( + updateWorkstationTransportSettings, + settings.updateWorkstationSettings(), + clientContext); + this.updateWorkstationOperationCallable = + callableFactory.createOperationCallable( + updateWorkstationTransportSettings, + settings.updateWorkstationOperationSettings(), + clientContext, + operationsStub); + this.deleteWorkstationCallable = + callableFactory.createUnaryCallable( + deleteWorkstationTransportSettings, + settings.deleteWorkstationSettings(), + clientContext); + this.deleteWorkstationOperationCallable = + callableFactory.createOperationCallable( + deleteWorkstationTransportSettings, + settings.deleteWorkstationOperationSettings(), + clientContext, + operationsStub); + this.startWorkstationCallable = + callableFactory.createUnaryCallable( + startWorkstationTransportSettings, settings.startWorkstationSettings(), clientContext); + this.startWorkstationOperationCallable = + callableFactory.createOperationCallable( + startWorkstationTransportSettings, + settings.startWorkstationOperationSettings(), + clientContext, + operationsStub); + this.stopWorkstationCallable = + callableFactory.createUnaryCallable( + stopWorkstationTransportSettings, settings.stopWorkstationSettings(), clientContext); + this.stopWorkstationOperationCallable = + callableFactory.createOperationCallable( + stopWorkstationTransportSettings, + settings.stopWorkstationOperationSettings(), + clientContext, + operationsStub); + this.generateAccessTokenCallable = + callableFactory.createUnaryCallable( + generateAccessTokenTransportSettings, + settings.generateAccessTokenSettings(), + clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable + getWorkstationClusterCallable() { + return getWorkstationClusterCallable; + } + + @Override + public UnaryCallable + listWorkstationClustersCallable() { + return listWorkstationClustersCallable; + } + + @Override + public UnaryCallable + listWorkstationClustersPagedCallable() { + return listWorkstationClustersPagedCallable; + } + + @Override + public UnaryCallable + createWorkstationClusterCallable() { + return createWorkstationClusterCallable; + } + + @Override + public OperationCallable + createWorkstationClusterOperationCallable() { + return createWorkstationClusterOperationCallable; + } + + @Override + public UnaryCallable + updateWorkstationClusterCallable() { + return updateWorkstationClusterCallable; + } + + @Override + public OperationCallable + updateWorkstationClusterOperationCallable() { + return updateWorkstationClusterOperationCallable; + } + + @Override + public UnaryCallable + deleteWorkstationClusterCallable() { + return deleteWorkstationClusterCallable; + } + + @Override + public OperationCallable + deleteWorkstationClusterOperationCallable() { + return deleteWorkstationClusterOperationCallable; + } + + @Override + public UnaryCallable + getWorkstationConfigCallable() { + return getWorkstationConfigCallable; + } + + @Override + public UnaryCallable + listWorkstationConfigsCallable() { + return listWorkstationConfigsCallable; + } + + @Override + public UnaryCallable + listWorkstationConfigsPagedCallable() { + return listWorkstationConfigsPagedCallable; + } + + @Override + public UnaryCallable + listUsableWorkstationConfigsCallable() { + return listUsableWorkstationConfigsCallable; + } + + @Override + public UnaryCallable< + ListUsableWorkstationConfigsRequest, ListUsableWorkstationConfigsPagedResponse> + listUsableWorkstationConfigsPagedCallable() { + return listUsableWorkstationConfigsPagedCallable; + } + + @Override + public UnaryCallable + createWorkstationConfigCallable() { + return createWorkstationConfigCallable; + } + + @Override + public OperationCallable + createWorkstationConfigOperationCallable() { + return createWorkstationConfigOperationCallable; + } + + @Override + public UnaryCallable + updateWorkstationConfigCallable() { + return updateWorkstationConfigCallable; + } + + @Override + public OperationCallable + updateWorkstationConfigOperationCallable() { + return updateWorkstationConfigOperationCallable; + } + + @Override + public UnaryCallable + deleteWorkstationConfigCallable() { + return deleteWorkstationConfigCallable; + } + + @Override + public OperationCallable + deleteWorkstationConfigOperationCallable() { + return deleteWorkstationConfigOperationCallable; + } + + @Override + public UnaryCallable getWorkstationCallable() { + return getWorkstationCallable; + } + + @Override + public UnaryCallable + listWorkstationsCallable() { + return listWorkstationsCallable; + } + + @Override + public UnaryCallable + listWorkstationsPagedCallable() { + return listWorkstationsPagedCallable; + } + + @Override + public UnaryCallable + listUsableWorkstationsCallable() { + return listUsableWorkstationsCallable; + } + + @Override + public UnaryCallable + listUsableWorkstationsPagedCallable() { + return listUsableWorkstationsPagedCallable; + } + + @Override + public UnaryCallable createWorkstationCallable() { + return createWorkstationCallable; + } + + @Override + public OperationCallable + createWorkstationOperationCallable() { + return createWorkstationOperationCallable; + } + + @Override + public UnaryCallable updateWorkstationCallable() { + return updateWorkstationCallable; + } + + @Override + public OperationCallable + updateWorkstationOperationCallable() { + return updateWorkstationOperationCallable; + } + + @Override + public UnaryCallable deleteWorkstationCallable() { + return deleteWorkstationCallable; + } + + @Override + public OperationCallable + deleteWorkstationOperationCallable() { + return deleteWorkstationOperationCallable; + } + + @Override + public UnaryCallable startWorkstationCallable() { + return startWorkstationCallable; + } + + @Override + public OperationCallable + startWorkstationOperationCallable() { + return startWorkstationOperationCallable; + } + + @Override + public UnaryCallable stopWorkstationCallable() { + return stopWorkstationCallable; + } + + @Override + public OperationCallable + stopWorkstationOperationCallable() { + return stopWorkstationOperationCallable; + } + + @Override + public UnaryCallable + generateAccessTokenCallable() { + return generateAccessTokenCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-workstations/google-cloud-workstations/src/main/java/com/google/cloud/workstations/v1beta/stub/HttpJsonWorkstationsCallableFactory.java b/java-workstations/google-cloud-workstations/src/main/java/com/google/cloud/workstations/v1beta/stub/HttpJsonWorkstationsCallableFactory.java new file mode 100644 index 000000000000..02911d11a548 --- /dev/null +++ b/java-workstations/google-cloud-workstations/src/main/java/com/google/cloud/workstations/v1beta/stub/HttpJsonWorkstationsCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2022 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.workstations.v1beta.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the Workstations service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonWorkstationsCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-workstations/google-cloud-workstations/src/main/java/com/google/cloud/workstations/v1beta/stub/HttpJsonWorkstationsStub.java b/java-workstations/google-cloud-workstations/src/main/java/com/google/cloud/workstations/v1beta/stub/HttpJsonWorkstationsStub.java new file mode 100644 index 000000000000..43202f50f1f9 --- /dev/null +++ b/java-workstations/google-cloud-workstations/src/main/java/com/google/cloud/workstations/v1beta/stub/HttpJsonWorkstationsStub.java @@ -0,0 +1,1819 @@ +/* + * Copyright 2022 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.workstations.v1beta.stub; + +import static com.google.cloud.workstations.v1beta.WorkstationsClient.ListUsableWorkstationConfigsPagedResponse; +import static com.google.cloud.workstations.v1beta.WorkstationsClient.ListUsableWorkstationsPagedResponse; +import static com.google.cloud.workstations.v1beta.WorkstationsClient.ListWorkstationClustersPagedResponse; +import static com.google.cloud.workstations.v1beta.WorkstationsClient.ListWorkstationConfigsPagedResponse; +import static com.google.cloud.workstations.v1beta.WorkstationsClient.ListWorkstationsPagedResponse; + +import com.google.api.HttpRule; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest; +import com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest; +import com.google.cloud.workstations.v1beta.CreateWorkstationRequest; +import com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest; +import com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest; +import com.google.cloud.workstations.v1beta.DeleteWorkstationRequest; +import com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest; +import com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse; +import com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest; +import com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest; +import com.google.cloud.workstations.v1beta.GetWorkstationRequest; +import com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest; +import com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse; +import com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest; +import com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse; +import com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest; +import com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse; +import com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest; +import com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse; +import com.google.cloud.workstations.v1beta.ListWorkstationsRequest; +import com.google.cloud.workstations.v1beta.ListWorkstationsResponse; +import com.google.cloud.workstations.v1beta.OperationMetadata; +import com.google.cloud.workstations.v1beta.StartWorkstationRequest; +import com.google.cloud.workstations.v1beta.StopWorkstationRequest; +import com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest; +import com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest; +import com.google.cloud.workstations.v1beta.UpdateWorkstationRequest; +import com.google.cloud.workstations.v1beta.Workstation; +import com.google.cloud.workstations.v1beta.WorkstationCluster; +import com.google.cloud.workstations.v1beta.WorkstationConfig; +import com.google.common.collect.ImmutableMap; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the Workstations service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonWorkstationsStub extends WorkstationsStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(WorkstationCluster.getDescriptor()) + .add(WorkstationConfig.getDescriptor()) + .add(Workstation.getDescriptor()) + .add(OperationMetadata.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + getWorkstationClusterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.workstations.v1beta.Workstations/GetWorkstationCluster") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=projects/*/locations/*/workstationClusters/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(WorkstationCluster.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + ListWorkstationClustersRequest, ListWorkstationClustersResponse> + listWorkstationClustersMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.cloud.workstations.v1beta.Workstations/ListWorkstationClusters") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{parent=projects/*/locations/*}/workstationClusters", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListWorkstationClustersResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createWorkstationClusterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.workstations.v1beta.Workstations/CreateWorkstationCluster") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{parent=projects/*/locations/*}/workstationClusters", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam( + fields, "workstationClusterId", request.getWorkstationClusterId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody( + "workstationCluster", request.getWorkstationCluster(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateWorkstationClusterRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updateWorkstationClusterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.workstations.v1beta.Workstations/UpdateWorkstationCluster") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{workstationCluster.name=projects/*/locations/*/workstationClusters/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, + "workstationCluster.name", + request.getWorkstationCluster().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "allowMissing", request.getAllowMissing()); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody( + "workstationCluster", request.getWorkstationCluster(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateWorkstationClusterRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteWorkstationClusterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.workstations.v1beta.Workstations/DeleteWorkstationCluster") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=projects/*/locations/*/workstationClusters/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "etag", request.getEtag()); + serializer.putQueryParam(fields, "force", request.getForce()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteWorkstationClusterRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + getWorkstationConfigMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.workstations.v1beta.Workstations/GetWorkstationConfig") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(WorkstationConfig.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + ListWorkstationConfigsRequest, ListWorkstationConfigsResponse> + listWorkstationConfigsMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.cloud.workstations.v1beta.Workstations/ListWorkstationConfigs") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{parent=projects/*/locations/*/workstationClusters/*}/workstationConfigs", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListWorkstationConfigsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + ListUsableWorkstationConfigsRequest, ListUsableWorkstationConfigsResponse> + listUsableWorkstationConfigsMethodDescriptor = + ApiMethodDescriptor + . + newBuilder() + .setFullMethodName( + "google.cloud.workstations.v1beta.Workstations/ListUsableWorkstationConfigs") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{parent=projects/*/locations/*/workstationClusters/*}/workstationConfigs:listUsable", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListUsableWorkstationConfigsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createWorkstationConfigMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.workstations.v1beta.Workstations/CreateWorkstationConfig") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{parent=projects/*/locations/*/workstationClusters/*}/workstationConfigs", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam( + fields, "workstationConfigId", request.getWorkstationConfigId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody( + "workstationConfig", request.getWorkstationConfig(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateWorkstationConfigRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updateWorkstationConfigMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.workstations.v1beta.Workstations/UpdateWorkstationConfig") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{workstationConfig.name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, + "workstationConfig.name", + request.getWorkstationConfig().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "allowMissing", request.getAllowMissing()); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody( + "workstationConfig", request.getWorkstationConfig(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateWorkstationConfigRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteWorkstationConfigMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.workstations.v1beta.Workstations/DeleteWorkstationConfig") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "etag", request.getEtag()); + serializer.putQueryParam(fields, "force", request.getForce()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteWorkstationConfigRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + getWorkstationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.workstations.v1beta.Workstations/GetWorkstation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Workstation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listWorkstationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.workstations.v1beta.Workstations/ListWorkstations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{parent=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}/workstations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListWorkstationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + ListUsableWorkstationsRequest, ListUsableWorkstationsResponse> + listUsableWorkstationsMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.cloud.workstations.v1beta.Workstations/ListUsableWorkstations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{parent=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}/workstations:listUsable", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListUsableWorkstationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createWorkstationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.workstations.v1beta.Workstations/CreateWorkstation") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{parent=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}/workstations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam( + fields, "workstationId", request.getWorkstationId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("workstation", request.getWorkstation(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateWorkstationRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updateWorkstationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.workstations.v1beta.Workstations/UpdateWorkstation") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{workstation.name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "workstation.name", request.getWorkstation().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "allowMissing", request.getAllowMissing()); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("workstation", request.getWorkstation(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateWorkstationRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteWorkstationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.workstations.v1beta.Workstations/DeleteWorkstation") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "etag", request.getEtag()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteWorkstationRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + startWorkstationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.workstations.v1beta.Workstations/StartWorkstation") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}:start", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (StartWorkstationRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + stopWorkstationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.workstations.v1beta.Workstations/StopWorkstation") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}:stop", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (StopWorkstationRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + generateAccessTokenMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.workstations.v1beta.Workstations/GenerateAccessToken") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{workstation=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}:generateAccessToken", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "workstation", request.getWorkstation()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody( + "*", request.toBuilder().clearWorkstation().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(GenerateAccessTokenResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + setIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{resource=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}:setIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta/{resource=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}:setIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{resource=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}:getIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta/{resource=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}:getIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + testIamPermissionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{resource=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}:testIamPermissions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta/{resource=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}:testIamPermissions") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(TestIamPermissionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable + getWorkstationClusterCallable; + private final UnaryCallable + listWorkstationClustersCallable; + private final UnaryCallable + listWorkstationClustersPagedCallable; + private final UnaryCallable + createWorkstationClusterCallable; + private final OperationCallable< + CreateWorkstationClusterRequest, WorkstationCluster, OperationMetadata> + createWorkstationClusterOperationCallable; + private final UnaryCallable + updateWorkstationClusterCallable; + private final OperationCallable< + UpdateWorkstationClusterRequest, WorkstationCluster, OperationMetadata> + updateWorkstationClusterOperationCallable; + private final UnaryCallable + deleteWorkstationClusterCallable; + private final OperationCallable< + DeleteWorkstationClusterRequest, WorkstationCluster, OperationMetadata> + deleteWorkstationClusterOperationCallable; + private final UnaryCallable + getWorkstationConfigCallable; + private final UnaryCallable + listWorkstationConfigsCallable; + private final UnaryCallable + listWorkstationConfigsPagedCallable; + private final UnaryCallable< + ListUsableWorkstationConfigsRequest, ListUsableWorkstationConfigsResponse> + listUsableWorkstationConfigsCallable; + private final UnaryCallable< + ListUsableWorkstationConfigsRequest, ListUsableWorkstationConfigsPagedResponse> + listUsableWorkstationConfigsPagedCallable; + private final UnaryCallable + createWorkstationConfigCallable; + private final OperationCallable< + CreateWorkstationConfigRequest, WorkstationConfig, OperationMetadata> + createWorkstationConfigOperationCallable; + private final UnaryCallable + updateWorkstationConfigCallable; + private final OperationCallable< + UpdateWorkstationConfigRequest, WorkstationConfig, OperationMetadata> + updateWorkstationConfigOperationCallable; + private final UnaryCallable + deleteWorkstationConfigCallable; + private final OperationCallable< + DeleteWorkstationConfigRequest, WorkstationConfig, OperationMetadata> + deleteWorkstationConfigOperationCallable; + private final UnaryCallable getWorkstationCallable; + private final UnaryCallable + listWorkstationsCallable; + private final UnaryCallable + listWorkstationsPagedCallable; + private final UnaryCallable + listUsableWorkstationsCallable; + private final UnaryCallable + listUsableWorkstationsPagedCallable; + private final UnaryCallable createWorkstationCallable; + private final OperationCallable + createWorkstationOperationCallable; + private final UnaryCallable updateWorkstationCallable; + private final OperationCallable + updateWorkstationOperationCallable; + private final UnaryCallable deleteWorkstationCallable; + private final OperationCallable + deleteWorkstationOperationCallable; + private final UnaryCallable startWorkstationCallable; + private final OperationCallable + startWorkstationOperationCallable; + private final UnaryCallable stopWorkstationCallable; + private final OperationCallable + stopWorkstationOperationCallable; + private final UnaryCallable + generateAccessTokenCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonWorkstationsStub create(WorkstationsStubSettings settings) + throws IOException { + return new HttpJsonWorkstationsStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonWorkstationsStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonWorkstationsStub( + WorkstationsStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonWorkstationsStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonWorkstationsStub( + WorkstationsStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonWorkstationsStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected HttpJsonWorkstationsStub(WorkstationsStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonWorkstationsCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonWorkstationsStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected HttpJsonWorkstationsStub( + WorkstationsStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create( + clientContext, + callableFactory, + typeRegistry, + ImmutableMap.builder() + .put( + "google.longrunning.Operations.CancelOperation", + HttpRule.newBuilder() + .setPost("/v1beta/{name=projects/*/locations/*/operations/*}:cancel") + .build()) + .put( + "google.longrunning.Operations.DeleteOperation", + HttpRule.newBuilder() + .setDelete("/v1beta/{name=projects/*/locations/*/operations/*}") + .build()) + .put( + "google.longrunning.Operations.GetOperation", + HttpRule.newBuilder() + .setGet("/v1beta/{name=projects/*/locations/*/operations/*}") + .build()) + .put( + "google.longrunning.Operations.ListOperations", + HttpRule.newBuilder() + .setGet("/v1beta/{name=projects/*/locations/*}/operations") + .build()) + .build()); + + HttpJsonCallSettings + getWorkstationClusterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getWorkstationClusterMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listWorkstationClustersTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listWorkstationClustersMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + createWorkstationClusterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createWorkstationClusterMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + updateWorkstationClusterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateWorkstationClusterMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + deleteWorkstationClusterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteWorkstationClusterMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + getWorkstationConfigTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getWorkstationConfigMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listWorkstationConfigsTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listWorkstationConfigsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listUsableWorkstationConfigsTransportSettings = + HttpJsonCallSettings + . + newBuilder() + .setMethodDescriptor(listUsableWorkstationConfigsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + createWorkstationConfigTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createWorkstationConfigMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + updateWorkstationConfigTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateWorkstationConfigMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + deleteWorkstationConfigTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteWorkstationConfigMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getWorkstationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getWorkstationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listWorkstationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listWorkstationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listUsableWorkstationsTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listUsableWorkstationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createWorkstationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createWorkstationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateWorkstationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateWorkstationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteWorkstationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteWorkstationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings startWorkstationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(startWorkstationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings stopWorkstationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(stopWorkstationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + generateAccessTokenTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(generateAccessTokenMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings setIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + testIamPermissionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.getWorkstationClusterCallable = + callableFactory.createUnaryCallable( + getWorkstationClusterTransportSettings, + settings.getWorkstationClusterSettings(), + clientContext); + this.listWorkstationClustersCallable = + callableFactory.createUnaryCallable( + listWorkstationClustersTransportSettings, + settings.listWorkstationClustersSettings(), + clientContext); + this.listWorkstationClustersPagedCallable = + callableFactory.createPagedCallable( + listWorkstationClustersTransportSettings, + settings.listWorkstationClustersSettings(), + clientContext); + this.createWorkstationClusterCallable = + callableFactory.createUnaryCallable( + createWorkstationClusterTransportSettings, + settings.createWorkstationClusterSettings(), + clientContext); + this.createWorkstationClusterOperationCallable = + callableFactory.createOperationCallable( + createWorkstationClusterTransportSettings, + settings.createWorkstationClusterOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updateWorkstationClusterCallable = + callableFactory.createUnaryCallable( + updateWorkstationClusterTransportSettings, + settings.updateWorkstationClusterSettings(), + clientContext); + this.updateWorkstationClusterOperationCallable = + callableFactory.createOperationCallable( + updateWorkstationClusterTransportSettings, + settings.updateWorkstationClusterOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteWorkstationClusterCallable = + callableFactory.createUnaryCallable( + deleteWorkstationClusterTransportSettings, + settings.deleteWorkstationClusterSettings(), + clientContext); + this.deleteWorkstationClusterOperationCallable = + callableFactory.createOperationCallable( + deleteWorkstationClusterTransportSettings, + settings.deleteWorkstationClusterOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.getWorkstationConfigCallable = + callableFactory.createUnaryCallable( + getWorkstationConfigTransportSettings, + settings.getWorkstationConfigSettings(), + clientContext); + this.listWorkstationConfigsCallable = + callableFactory.createUnaryCallable( + listWorkstationConfigsTransportSettings, + settings.listWorkstationConfigsSettings(), + clientContext); + this.listWorkstationConfigsPagedCallable = + callableFactory.createPagedCallable( + listWorkstationConfigsTransportSettings, + settings.listWorkstationConfigsSettings(), + clientContext); + this.listUsableWorkstationConfigsCallable = + callableFactory.createUnaryCallable( + listUsableWorkstationConfigsTransportSettings, + settings.listUsableWorkstationConfigsSettings(), + clientContext); + this.listUsableWorkstationConfigsPagedCallable = + callableFactory.createPagedCallable( + listUsableWorkstationConfigsTransportSettings, + settings.listUsableWorkstationConfigsSettings(), + clientContext); + this.createWorkstationConfigCallable = + callableFactory.createUnaryCallable( + createWorkstationConfigTransportSettings, + settings.createWorkstationConfigSettings(), + clientContext); + this.createWorkstationConfigOperationCallable = + callableFactory.createOperationCallable( + createWorkstationConfigTransportSettings, + settings.createWorkstationConfigOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updateWorkstationConfigCallable = + callableFactory.createUnaryCallable( + updateWorkstationConfigTransportSettings, + settings.updateWorkstationConfigSettings(), + clientContext); + this.updateWorkstationConfigOperationCallable = + callableFactory.createOperationCallable( + updateWorkstationConfigTransportSettings, + settings.updateWorkstationConfigOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteWorkstationConfigCallable = + callableFactory.createUnaryCallable( + deleteWorkstationConfigTransportSettings, + settings.deleteWorkstationConfigSettings(), + clientContext); + this.deleteWorkstationConfigOperationCallable = + callableFactory.createOperationCallable( + deleteWorkstationConfigTransportSettings, + settings.deleteWorkstationConfigOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.getWorkstationCallable = + callableFactory.createUnaryCallable( + getWorkstationTransportSettings, settings.getWorkstationSettings(), clientContext); + this.listWorkstationsCallable = + callableFactory.createUnaryCallable( + listWorkstationsTransportSettings, settings.listWorkstationsSettings(), clientContext); + this.listWorkstationsPagedCallable = + callableFactory.createPagedCallable( + listWorkstationsTransportSettings, settings.listWorkstationsSettings(), clientContext); + this.listUsableWorkstationsCallable = + callableFactory.createUnaryCallable( + listUsableWorkstationsTransportSettings, + settings.listUsableWorkstationsSettings(), + clientContext); + this.listUsableWorkstationsPagedCallable = + callableFactory.createPagedCallable( + listUsableWorkstationsTransportSettings, + settings.listUsableWorkstationsSettings(), + clientContext); + this.createWorkstationCallable = + callableFactory.createUnaryCallable( + createWorkstationTransportSettings, + settings.createWorkstationSettings(), + clientContext); + this.createWorkstationOperationCallable = + callableFactory.createOperationCallable( + createWorkstationTransportSettings, + settings.createWorkstationOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updateWorkstationCallable = + callableFactory.createUnaryCallable( + updateWorkstationTransportSettings, + settings.updateWorkstationSettings(), + clientContext); + this.updateWorkstationOperationCallable = + callableFactory.createOperationCallable( + updateWorkstationTransportSettings, + settings.updateWorkstationOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteWorkstationCallable = + callableFactory.createUnaryCallable( + deleteWorkstationTransportSettings, + settings.deleteWorkstationSettings(), + clientContext); + this.deleteWorkstationOperationCallable = + callableFactory.createOperationCallable( + deleteWorkstationTransportSettings, + settings.deleteWorkstationOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.startWorkstationCallable = + callableFactory.createUnaryCallable( + startWorkstationTransportSettings, settings.startWorkstationSettings(), clientContext); + this.startWorkstationOperationCallable = + callableFactory.createOperationCallable( + startWorkstationTransportSettings, + settings.startWorkstationOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.stopWorkstationCallable = + callableFactory.createUnaryCallable( + stopWorkstationTransportSettings, settings.stopWorkstationSettings(), clientContext); + this.stopWorkstationOperationCallable = + callableFactory.createOperationCallable( + stopWorkstationTransportSettings, + settings.stopWorkstationOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.generateAccessTokenCallable = + callableFactory.createUnaryCallable( + generateAccessTokenTransportSettings, + settings.generateAccessTokenSettings(), + clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(getWorkstationClusterMethodDescriptor); + methodDescriptors.add(listWorkstationClustersMethodDescriptor); + methodDescriptors.add(createWorkstationClusterMethodDescriptor); + methodDescriptors.add(updateWorkstationClusterMethodDescriptor); + methodDescriptors.add(deleteWorkstationClusterMethodDescriptor); + methodDescriptors.add(getWorkstationConfigMethodDescriptor); + methodDescriptors.add(listWorkstationConfigsMethodDescriptor); + methodDescriptors.add(listUsableWorkstationConfigsMethodDescriptor); + methodDescriptors.add(createWorkstationConfigMethodDescriptor); + methodDescriptors.add(updateWorkstationConfigMethodDescriptor); + methodDescriptors.add(deleteWorkstationConfigMethodDescriptor); + methodDescriptors.add(getWorkstationMethodDescriptor); + methodDescriptors.add(listWorkstationsMethodDescriptor); + methodDescriptors.add(listUsableWorkstationsMethodDescriptor); + methodDescriptors.add(createWorkstationMethodDescriptor); + methodDescriptors.add(updateWorkstationMethodDescriptor); + methodDescriptors.add(deleteWorkstationMethodDescriptor); + methodDescriptors.add(startWorkstationMethodDescriptor); + methodDescriptors.add(stopWorkstationMethodDescriptor); + methodDescriptors.add(generateAccessTokenMethodDescriptor); + methodDescriptors.add(setIamPolicyMethodDescriptor); + methodDescriptors.add(getIamPolicyMethodDescriptor); + methodDescriptors.add(testIamPermissionsMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable + getWorkstationClusterCallable() { + return getWorkstationClusterCallable; + } + + @Override + public UnaryCallable + listWorkstationClustersCallable() { + return listWorkstationClustersCallable; + } + + @Override + public UnaryCallable + listWorkstationClustersPagedCallable() { + return listWorkstationClustersPagedCallable; + } + + @Override + public UnaryCallable + createWorkstationClusterCallable() { + return createWorkstationClusterCallable; + } + + @Override + public OperationCallable + createWorkstationClusterOperationCallable() { + return createWorkstationClusterOperationCallable; + } + + @Override + public UnaryCallable + updateWorkstationClusterCallable() { + return updateWorkstationClusterCallable; + } + + @Override + public OperationCallable + updateWorkstationClusterOperationCallable() { + return updateWorkstationClusterOperationCallable; + } + + @Override + public UnaryCallable + deleteWorkstationClusterCallable() { + return deleteWorkstationClusterCallable; + } + + @Override + public OperationCallable + deleteWorkstationClusterOperationCallable() { + return deleteWorkstationClusterOperationCallable; + } + + @Override + public UnaryCallable + getWorkstationConfigCallable() { + return getWorkstationConfigCallable; + } + + @Override + public UnaryCallable + listWorkstationConfigsCallable() { + return listWorkstationConfigsCallable; + } + + @Override + public UnaryCallable + listWorkstationConfigsPagedCallable() { + return listWorkstationConfigsPagedCallable; + } + + @Override + public UnaryCallable + listUsableWorkstationConfigsCallable() { + return listUsableWorkstationConfigsCallable; + } + + @Override + public UnaryCallable< + ListUsableWorkstationConfigsRequest, ListUsableWorkstationConfigsPagedResponse> + listUsableWorkstationConfigsPagedCallable() { + return listUsableWorkstationConfigsPagedCallable; + } + + @Override + public UnaryCallable + createWorkstationConfigCallable() { + return createWorkstationConfigCallable; + } + + @Override + public OperationCallable + createWorkstationConfigOperationCallable() { + return createWorkstationConfigOperationCallable; + } + + @Override + public UnaryCallable + updateWorkstationConfigCallable() { + return updateWorkstationConfigCallable; + } + + @Override + public OperationCallable + updateWorkstationConfigOperationCallable() { + return updateWorkstationConfigOperationCallable; + } + + @Override + public UnaryCallable + deleteWorkstationConfigCallable() { + return deleteWorkstationConfigCallable; + } + + @Override + public OperationCallable + deleteWorkstationConfigOperationCallable() { + return deleteWorkstationConfigOperationCallable; + } + + @Override + public UnaryCallable getWorkstationCallable() { + return getWorkstationCallable; + } + + @Override + public UnaryCallable + listWorkstationsCallable() { + return listWorkstationsCallable; + } + + @Override + public UnaryCallable + listWorkstationsPagedCallable() { + return listWorkstationsPagedCallable; + } + + @Override + public UnaryCallable + listUsableWorkstationsCallable() { + return listUsableWorkstationsCallable; + } + + @Override + public UnaryCallable + listUsableWorkstationsPagedCallable() { + return listUsableWorkstationsPagedCallable; + } + + @Override + public UnaryCallable createWorkstationCallable() { + return createWorkstationCallable; + } + + @Override + public OperationCallable + createWorkstationOperationCallable() { + return createWorkstationOperationCallable; + } + + @Override + public UnaryCallable updateWorkstationCallable() { + return updateWorkstationCallable; + } + + @Override + public OperationCallable + updateWorkstationOperationCallable() { + return updateWorkstationOperationCallable; + } + + @Override + public UnaryCallable deleteWorkstationCallable() { + return deleteWorkstationCallable; + } + + @Override + public OperationCallable + deleteWorkstationOperationCallable() { + return deleteWorkstationOperationCallable; + } + + @Override + public UnaryCallable startWorkstationCallable() { + return startWorkstationCallable; + } + + @Override + public OperationCallable + startWorkstationOperationCallable() { + return startWorkstationOperationCallable; + } + + @Override + public UnaryCallable stopWorkstationCallable() { + return stopWorkstationCallable; + } + + @Override + public OperationCallable + stopWorkstationOperationCallable() { + return stopWorkstationOperationCallable; + } + + @Override + public UnaryCallable + generateAccessTokenCallable() { + return generateAccessTokenCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-workstations/google-cloud-workstations/src/main/java/com/google/cloud/workstations/v1beta/stub/WorkstationsStub.java b/java-workstations/google-cloud-workstations/src/main/java/com/google/cloud/workstations/v1beta/stub/WorkstationsStub.java new file mode 100644 index 000000000000..c53cfe6b8621 --- /dev/null +++ b/java-workstations/google-cloud-workstations/src/main/java/com/google/cloud/workstations/v1beta/stub/WorkstationsStub.java @@ -0,0 +1,290 @@ +/* + * Copyright 2022 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.workstations.v1beta.stub; + +import static com.google.cloud.workstations.v1beta.WorkstationsClient.ListUsableWorkstationConfigsPagedResponse; +import static com.google.cloud.workstations.v1beta.WorkstationsClient.ListUsableWorkstationsPagedResponse; +import static com.google.cloud.workstations.v1beta.WorkstationsClient.ListWorkstationClustersPagedResponse; +import static com.google.cloud.workstations.v1beta.WorkstationsClient.ListWorkstationConfigsPagedResponse; +import static com.google.cloud.workstations.v1beta.WorkstationsClient.ListWorkstationsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest; +import com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest; +import com.google.cloud.workstations.v1beta.CreateWorkstationRequest; +import com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest; +import com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest; +import com.google.cloud.workstations.v1beta.DeleteWorkstationRequest; +import com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest; +import com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse; +import com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest; +import com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest; +import com.google.cloud.workstations.v1beta.GetWorkstationRequest; +import com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest; +import com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse; +import com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest; +import com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse; +import com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest; +import com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse; +import com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest; +import com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse; +import com.google.cloud.workstations.v1beta.ListWorkstationsRequest; +import com.google.cloud.workstations.v1beta.ListWorkstationsResponse; +import com.google.cloud.workstations.v1beta.OperationMetadata; +import com.google.cloud.workstations.v1beta.StartWorkstationRequest; +import com.google.cloud.workstations.v1beta.StopWorkstationRequest; +import com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest; +import com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest; +import com.google.cloud.workstations.v1beta.UpdateWorkstationRequest; +import com.google.cloud.workstations.v1beta.Workstation; +import com.google.cloud.workstations.v1beta.WorkstationCluster; +import com.google.cloud.workstations.v1beta.WorkstationConfig; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the Workstations service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class WorkstationsStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; + } + + public UnaryCallable + getWorkstationClusterCallable() { + throw new UnsupportedOperationException("Not implemented: getWorkstationClusterCallable()"); + } + + public UnaryCallable + listWorkstationClustersPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listWorkstationClustersPagedCallable()"); + } + + public UnaryCallable + listWorkstationClustersCallable() { + throw new UnsupportedOperationException("Not implemented: listWorkstationClustersCallable()"); + } + + public OperationCallable + createWorkstationClusterOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: createWorkstationClusterOperationCallable()"); + } + + public UnaryCallable + createWorkstationClusterCallable() { + throw new UnsupportedOperationException("Not implemented: createWorkstationClusterCallable()"); + } + + public OperationCallable + updateWorkstationClusterOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: updateWorkstationClusterOperationCallable()"); + } + + public UnaryCallable + updateWorkstationClusterCallable() { + throw new UnsupportedOperationException("Not implemented: updateWorkstationClusterCallable()"); + } + + public OperationCallable + deleteWorkstationClusterOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: deleteWorkstationClusterOperationCallable()"); + } + + public UnaryCallable + deleteWorkstationClusterCallable() { + throw new UnsupportedOperationException("Not implemented: deleteWorkstationClusterCallable()"); + } + + public UnaryCallable + getWorkstationConfigCallable() { + throw new UnsupportedOperationException("Not implemented: getWorkstationConfigCallable()"); + } + + public UnaryCallable + listWorkstationConfigsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listWorkstationConfigsPagedCallable()"); + } + + public UnaryCallable + listWorkstationConfigsCallable() { + throw new UnsupportedOperationException("Not implemented: listWorkstationConfigsCallable()"); + } + + public UnaryCallable< + ListUsableWorkstationConfigsRequest, ListUsableWorkstationConfigsPagedResponse> + listUsableWorkstationConfigsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listUsableWorkstationConfigsPagedCallable()"); + } + + public UnaryCallable + listUsableWorkstationConfigsCallable() { + throw new UnsupportedOperationException( + "Not implemented: listUsableWorkstationConfigsCallable()"); + } + + public OperationCallable + createWorkstationConfigOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: createWorkstationConfigOperationCallable()"); + } + + public UnaryCallable + createWorkstationConfigCallable() { + throw new UnsupportedOperationException("Not implemented: createWorkstationConfigCallable()"); + } + + public OperationCallable + updateWorkstationConfigOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: updateWorkstationConfigOperationCallable()"); + } + + public UnaryCallable + updateWorkstationConfigCallable() { + throw new UnsupportedOperationException("Not implemented: updateWorkstationConfigCallable()"); + } + + public OperationCallable + deleteWorkstationConfigOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: deleteWorkstationConfigOperationCallable()"); + } + + public UnaryCallable + deleteWorkstationConfigCallable() { + throw new UnsupportedOperationException("Not implemented: deleteWorkstationConfigCallable()"); + } + + public UnaryCallable getWorkstationCallable() { + throw new UnsupportedOperationException("Not implemented: getWorkstationCallable()"); + } + + public UnaryCallable + listWorkstationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listWorkstationsPagedCallable()"); + } + + public UnaryCallable + listWorkstationsCallable() { + throw new UnsupportedOperationException("Not implemented: listWorkstationsCallable()"); + } + + public UnaryCallable + listUsableWorkstationsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listUsableWorkstationsPagedCallable()"); + } + + public UnaryCallable + listUsableWorkstationsCallable() { + throw new UnsupportedOperationException("Not implemented: listUsableWorkstationsCallable()"); + } + + public OperationCallable + createWorkstationOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: createWorkstationOperationCallable()"); + } + + public UnaryCallable createWorkstationCallable() { + throw new UnsupportedOperationException("Not implemented: createWorkstationCallable()"); + } + + public OperationCallable + updateWorkstationOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: updateWorkstationOperationCallable()"); + } + + public UnaryCallable updateWorkstationCallable() { + throw new UnsupportedOperationException("Not implemented: updateWorkstationCallable()"); + } + + public OperationCallable + deleteWorkstationOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: deleteWorkstationOperationCallable()"); + } + + public UnaryCallable deleteWorkstationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteWorkstationCallable()"); + } + + public OperationCallable + startWorkstationOperationCallable() { + throw new UnsupportedOperationException("Not implemented: startWorkstationOperationCallable()"); + } + + public UnaryCallable startWorkstationCallable() { + throw new UnsupportedOperationException("Not implemented: startWorkstationCallable()"); + } + + public OperationCallable + stopWorkstationOperationCallable() { + throw new UnsupportedOperationException("Not implemented: stopWorkstationOperationCallable()"); + } + + public UnaryCallable stopWorkstationCallable() { + throw new UnsupportedOperationException("Not implemented: stopWorkstationCallable()"); + } + + public UnaryCallable + generateAccessTokenCallable() { + throw new UnsupportedOperationException("Not implemented: generateAccessTokenCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-workstations/google-cloud-workstations/src/main/java/com/google/cloud/workstations/v1beta/stub/WorkstationsStubSettings.java b/java-workstations/google-cloud-workstations/src/main/java/com/google/cloud/workstations/v1beta/stub/WorkstationsStubSettings.java new file mode 100644 index 000000000000..ae2a82acb0a8 --- /dev/null +++ b/java-workstations/google-cloud-workstations/src/main/java/com/google/cloud/workstations/v1beta/stub/WorkstationsStubSettings.java @@ -0,0 +1,1889 @@ +/* + * Copyright 2022 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.workstations.v1beta.stub; + +import static com.google.cloud.workstations.v1beta.WorkstationsClient.ListUsableWorkstationConfigsPagedResponse; +import static com.google.cloud.workstations.v1beta.WorkstationsClient.ListUsableWorkstationsPagedResponse; +import static com.google.cloud.workstations.v1beta.WorkstationsClient.ListWorkstationClustersPagedResponse; +import static com.google.cloud.workstations.v1beta.WorkstationsClient.ListWorkstationConfigsPagedResponse; +import static com.google.cloud.workstations.v1beta.WorkstationsClient.ListWorkstationsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest; +import com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest; +import com.google.cloud.workstations.v1beta.CreateWorkstationRequest; +import com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest; +import com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest; +import com.google.cloud.workstations.v1beta.DeleteWorkstationRequest; +import com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest; +import com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse; +import com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest; +import com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest; +import com.google.cloud.workstations.v1beta.GetWorkstationRequest; +import com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest; +import com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse; +import com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest; +import com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse; +import com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest; +import com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse; +import com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest; +import com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse; +import com.google.cloud.workstations.v1beta.ListWorkstationsRequest; +import com.google.cloud.workstations.v1beta.ListWorkstationsResponse; +import com.google.cloud.workstations.v1beta.OperationMetadata; +import com.google.cloud.workstations.v1beta.StartWorkstationRequest; +import com.google.cloud.workstations.v1beta.StopWorkstationRequest; +import com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest; +import com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest; +import com.google.cloud.workstations.v1beta.UpdateWorkstationRequest; +import com.google.cloud.workstations.v1beta.Workstation; +import com.google.cloud.workstations.v1beta.WorkstationCluster; +import com.google.cloud.workstations.v1beta.WorkstationConfig; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link WorkstationsStub}. + * + *

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

    + *
  • The default service address (workstations.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of getWorkstationCluster to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * WorkstationsStubSettings.Builder workstationsSettingsBuilder =
+ *     WorkstationsStubSettings.newBuilder();
+ * workstationsSettingsBuilder
+ *     .getWorkstationClusterSettings()
+ *     .setRetrySettings(
+ *         workstationsSettingsBuilder
+ *             .getWorkstationClusterSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * WorkstationsStubSettings workstationsSettings = workstationsSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class WorkstationsStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final UnaryCallSettings + getWorkstationClusterSettings; + private final PagedCallSettings< + ListWorkstationClustersRequest, + ListWorkstationClustersResponse, + ListWorkstationClustersPagedResponse> + listWorkstationClustersSettings; + private final UnaryCallSettings + createWorkstationClusterSettings; + private final OperationCallSettings< + CreateWorkstationClusterRequest, WorkstationCluster, OperationMetadata> + createWorkstationClusterOperationSettings; + private final UnaryCallSettings + updateWorkstationClusterSettings; + private final OperationCallSettings< + UpdateWorkstationClusterRequest, WorkstationCluster, OperationMetadata> + updateWorkstationClusterOperationSettings; + private final UnaryCallSettings + deleteWorkstationClusterSettings; + private final OperationCallSettings< + DeleteWorkstationClusterRequest, WorkstationCluster, OperationMetadata> + deleteWorkstationClusterOperationSettings; + private final UnaryCallSettings + getWorkstationConfigSettings; + private final PagedCallSettings< + ListWorkstationConfigsRequest, + ListWorkstationConfigsResponse, + ListWorkstationConfigsPagedResponse> + listWorkstationConfigsSettings; + private final PagedCallSettings< + ListUsableWorkstationConfigsRequest, + ListUsableWorkstationConfigsResponse, + ListUsableWorkstationConfigsPagedResponse> + listUsableWorkstationConfigsSettings; + private final UnaryCallSettings + createWorkstationConfigSettings; + private final OperationCallSettings< + CreateWorkstationConfigRequest, WorkstationConfig, OperationMetadata> + createWorkstationConfigOperationSettings; + private final UnaryCallSettings + updateWorkstationConfigSettings; + private final OperationCallSettings< + UpdateWorkstationConfigRequest, WorkstationConfig, OperationMetadata> + updateWorkstationConfigOperationSettings; + private final UnaryCallSettings + deleteWorkstationConfigSettings; + private final OperationCallSettings< + DeleteWorkstationConfigRequest, WorkstationConfig, OperationMetadata> + deleteWorkstationConfigOperationSettings; + private final UnaryCallSettings getWorkstationSettings; + private final PagedCallSettings< + ListWorkstationsRequest, ListWorkstationsResponse, ListWorkstationsPagedResponse> + listWorkstationsSettings; + private final PagedCallSettings< + ListUsableWorkstationsRequest, + ListUsableWorkstationsResponse, + ListUsableWorkstationsPagedResponse> + listUsableWorkstationsSettings; + private final UnaryCallSettings createWorkstationSettings; + private final OperationCallSettings + createWorkstationOperationSettings; + private final UnaryCallSettings updateWorkstationSettings; + private final OperationCallSettings + updateWorkstationOperationSettings; + private final UnaryCallSettings deleteWorkstationSettings; + private final OperationCallSettings + deleteWorkstationOperationSettings; + private final UnaryCallSettings startWorkstationSettings; + private final OperationCallSettings + startWorkstationOperationSettings; + private final UnaryCallSettings stopWorkstationSettings; + private final OperationCallSettings + stopWorkstationOperationSettings; + private final UnaryCallSettings + generateAccessTokenSettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + private static final PagedListDescriptor< + ListWorkstationClustersRequest, ListWorkstationClustersResponse, WorkstationCluster> + LIST_WORKSTATION_CLUSTERS_PAGE_STR_DESC = + new PagedListDescriptor< + ListWorkstationClustersRequest, + ListWorkstationClustersResponse, + WorkstationCluster>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListWorkstationClustersRequest injectToken( + ListWorkstationClustersRequest payload, String token) { + return ListWorkstationClustersRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListWorkstationClustersRequest injectPageSize( + ListWorkstationClustersRequest payload, int pageSize) { + return ListWorkstationClustersRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListWorkstationClustersRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListWorkstationClustersResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListWorkstationClustersResponse payload) { + return payload.getWorkstationClustersList() == null + ? ImmutableList.of() + : payload.getWorkstationClustersList(); + } + }; + + private static final PagedListDescriptor< + ListWorkstationConfigsRequest, ListWorkstationConfigsResponse, WorkstationConfig> + LIST_WORKSTATION_CONFIGS_PAGE_STR_DESC = + new PagedListDescriptor< + ListWorkstationConfigsRequest, ListWorkstationConfigsResponse, WorkstationConfig>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListWorkstationConfigsRequest injectToken( + ListWorkstationConfigsRequest payload, String token) { + return ListWorkstationConfigsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListWorkstationConfigsRequest injectPageSize( + ListWorkstationConfigsRequest payload, int pageSize) { + return ListWorkstationConfigsRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListWorkstationConfigsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListWorkstationConfigsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListWorkstationConfigsResponse payload) { + return payload.getWorkstationConfigsList() == null + ? ImmutableList.of() + : payload.getWorkstationConfigsList(); + } + }; + + private static final PagedListDescriptor< + ListUsableWorkstationConfigsRequest, + ListUsableWorkstationConfigsResponse, + WorkstationConfig> + LIST_USABLE_WORKSTATION_CONFIGS_PAGE_STR_DESC = + new PagedListDescriptor< + ListUsableWorkstationConfigsRequest, + ListUsableWorkstationConfigsResponse, + WorkstationConfig>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListUsableWorkstationConfigsRequest injectToken( + ListUsableWorkstationConfigsRequest payload, String token) { + return ListUsableWorkstationConfigsRequest.newBuilder(payload) + .setPageToken(token) + .build(); + } + + @Override + public ListUsableWorkstationConfigsRequest injectPageSize( + ListUsableWorkstationConfigsRequest payload, int pageSize) { + return ListUsableWorkstationConfigsRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListUsableWorkstationConfigsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListUsableWorkstationConfigsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListUsableWorkstationConfigsResponse payload) { + return payload.getWorkstationConfigsList() == null + ? ImmutableList.of() + : payload.getWorkstationConfigsList(); + } + }; + + private static final PagedListDescriptor< + ListWorkstationsRequest, ListWorkstationsResponse, Workstation> + LIST_WORKSTATIONS_PAGE_STR_DESC = + new PagedListDescriptor< + ListWorkstationsRequest, ListWorkstationsResponse, Workstation>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListWorkstationsRequest injectToken( + ListWorkstationsRequest payload, String token) { + return ListWorkstationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListWorkstationsRequest injectPageSize( + ListWorkstationsRequest payload, int pageSize) { + return ListWorkstationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListWorkstationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListWorkstationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListWorkstationsResponse payload) { + return payload.getWorkstationsList() == null + ? ImmutableList.of() + : payload.getWorkstationsList(); + } + }; + + private static final PagedListDescriptor< + ListUsableWorkstationsRequest, ListUsableWorkstationsResponse, Workstation> + LIST_USABLE_WORKSTATIONS_PAGE_STR_DESC = + new PagedListDescriptor< + ListUsableWorkstationsRequest, ListUsableWorkstationsResponse, Workstation>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListUsableWorkstationsRequest injectToken( + ListUsableWorkstationsRequest payload, String token) { + return ListUsableWorkstationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListUsableWorkstationsRequest injectPageSize( + ListUsableWorkstationsRequest payload, int pageSize) { + return ListUsableWorkstationsRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListUsableWorkstationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListUsableWorkstationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListUsableWorkstationsResponse payload) { + return payload.getWorkstationsList() == null + ? ImmutableList.of() + : payload.getWorkstationsList(); + } + }; + + private static final PagedListResponseFactory< + ListWorkstationClustersRequest, + ListWorkstationClustersResponse, + ListWorkstationClustersPagedResponse> + LIST_WORKSTATION_CLUSTERS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListWorkstationClustersRequest, + ListWorkstationClustersResponse, + ListWorkstationClustersPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable + callable, + ListWorkstationClustersRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListWorkstationClustersRequest, + ListWorkstationClustersResponse, + WorkstationCluster> + pageContext = + PageContext.create( + callable, LIST_WORKSTATION_CLUSTERS_PAGE_STR_DESC, request, context); + return ListWorkstationClustersPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListWorkstationConfigsRequest, + ListWorkstationConfigsResponse, + ListWorkstationConfigsPagedResponse> + LIST_WORKSTATION_CONFIGS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListWorkstationConfigsRequest, + ListWorkstationConfigsResponse, + ListWorkstationConfigsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable + callable, + ListWorkstationConfigsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListWorkstationConfigsRequest, + ListWorkstationConfigsResponse, + WorkstationConfig> + pageContext = + PageContext.create( + callable, LIST_WORKSTATION_CONFIGS_PAGE_STR_DESC, request, context); + return ListWorkstationConfigsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListUsableWorkstationConfigsRequest, + ListUsableWorkstationConfigsResponse, + ListUsableWorkstationConfigsPagedResponse> + LIST_USABLE_WORKSTATION_CONFIGS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListUsableWorkstationConfigsRequest, + ListUsableWorkstationConfigsResponse, + ListUsableWorkstationConfigsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable< + ListUsableWorkstationConfigsRequest, ListUsableWorkstationConfigsResponse> + callable, + ListUsableWorkstationConfigsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListUsableWorkstationConfigsRequest, + ListUsableWorkstationConfigsResponse, + WorkstationConfig> + pageContext = + PageContext.create( + callable, + LIST_USABLE_WORKSTATION_CONFIGS_PAGE_STR_DESC, + request, + context); + return ListUsableWorkstationConfigsPagedResponse.createAsync( + pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListWorkstationsRequest, ListWorkstationsResponse, ListWorkstationsPagedResponse> + LIST_WORKSTATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListWorkstationsRequest, ListWorkstationsResponse, ListWorkstationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListWorkstationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_WORKSTATIONS_PAGE_STR_DESC, request, context); + return ListWorkstationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListUsableWorkstationsRequest, + ListUsableWorkstationsResponse, + ListUsableWorkstationsPagedResponse> + LIST_USABLE_WORKSTATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListUsableWorkstationsRequest, + ListUsableWorkstationsResponse, + ListUsableWorkstationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable + callable, + ListUsableWorkstationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListUsableWorkstationsRequest, ListUsableWorkstationsResponse, Workstation> + pageContext = + PageContext.create( + callable, LIST_USABLE_WORKSTATIONS_PAGE_STR_DESC, request, context); + return ListUsableWorkstationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to getWorkstationCluster. */ + public UnaryCallSettings + getWorkstationClusterSettings() { + return getWorkstationClusterSettings; + } + + /** Returns the object with the settings used for calls to listWorkstationClusters. */ + public PagedCallSettings< + ListWorkstationClustersRequest, + ListWorkstationClustersResponse, + ListWorkstationClustersPagedResponse> + listWorkstationClustersSettings() { + return listWorkstationClustersSettings; + } + + /** Returns the object with the settings used for calls to createWorkstationCluster. */ + public UnaryCallSettings + createWorkstationClusterSettings() { + return createWorkstationClusterSettings; + } + + /** Returns the object with the settings used for calls to createWorkstationCluster. */ + public OperationCallSettings< + CreateWorkstationClusterRequest, WorkstationCluster, OperationMetadata> + createWorkstationClusterOperationSettings() { + return createWorkstationClusterOperationSettings; + } + + /** Returns the object with the settings used for calls to updateWorkstationCluster. */ + public UnaryCallSettings + updateWorkstationClusterSettings() { + return updateWorkstationClusterSettings; + } + + /** Returns the object with the settings used for calls to updateWorkstationCluster. */ + public OperationCallSettings< + UpdateWorkstationClusterRequest, WorkstationCluster, OperationMetadata> + updateWorkstationClusterOperationSettings() { + return updateWorkstationClusterOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteWorkstationCluster. */ + public UnaryCallSettings + deleteWorkstationClusterSettings() { + return deleteWorkstationClusterSettings; + } + + /** Returns the object with the settings used for calls to deleteWorkstationCluster. */ + public OperationCallSettings< + DeleteWorkstationClusterRequest, WorkstationCluster, OperationMetadata> + deleteWorkstationClusterOperationSettings() { + return deleteWorkstationClusterOperationSettings; + } + + /** Returns the object with the settings used for calls to getWorkstationConfig. */ + public UnaryCallSettings + getWorkstationConfigSettings() { + return getWorkstationConfigSettings; + } + + /** Returns the object with the settings used for calls to listWorkstationConfigs. */ + public PagedCallSettings< + ListWorkstationConfigsRequest, + ListWorkstationConfigsResponse, + ListWorkstationConfigsPagedResponse> + listWorkstationConfigsSettings() { + return listWorkstationConfigsSettings; + } + + /** Returns the object with the settings used for calls to listUsableWorkstationConfigs. */ + public PagedCallSettings< + ListUsableWorkstationConfigsRequest, + ListUsableWorkstationConfigsResponse, + ListUsableWorkstationConfigsPagedResponse> + listUsableWorkstationConfigsSettings() { + return listUsableWorkstationConfigsSettings; + } + + /** Returns the object with the settings used for calls to createWorkstationConfig. */ + public UnaryCallSettings + createWorkstationConfigSettings() { + return createWorkstationConfigSettings; + } + + /** Returns the object with the settings used for calls to createWorkstationConfig. */ + public OperationCallSettings + createWorkstationConfigOperationSettings() { + return createWorkstationConfigOperationSettings; + } + + /** Returns the object with the settings used for calls to updateWorkstationConfig. */ + public UnaryCallSettings + updateWorkstationConfigSettings() { + return updateWorkstationConfigSettings; + } + + /** Returns the object with the settings used for calls to updateWorkstationConfig. */ + public OperationCallSettings + updateWorkstationConfigOperationSettings() { + return updateWorkstationConfigOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteWorkstationConfig. */ + public UnaryCallSettings + deleteWorkstationConfigSettings() { + return deleteWorkstationConfigSettings; + } + + /** Returns the object with the settings used for calls to deleteWorkstationConfig. */ + public OperationCallSettings + deleteWorkstationConfigOperationSettings() { + return deleteWorkstationConfigOperationSettings; + } + + /** Returns the object with the settings used for calls to getWorkstation. */ + public UnaryCallSettings getWorkstationSettings() { + return getWorkstationSettings; + } + + /** Returns the object with the settings used for calls to listWorkstations. */ + public PagedCallSettings< + ListWorkstationsRequest, ListWorkstationsResponse, ListWorkstationsPagedResponse> + listWorkstationsSettings() { + return listWorkstationsSettings; + } + + /** Returns the object with the settings used for calls to listUsableWorkstations. */ + public PagedCallSettings< + ListUsableWorkstationsRequest, + ListUsableWorkstationsResponse, + ListUsableWorkstationsPagedResponse> + listUsableWorkstationsSettings() { + return listUsableWorkstationsSettings; + } + + /** Returns the object with the settings used for calls to createWorkstation. */ + public UnaryCallSettings createWorkstationSettings() { + return createWorkstationSettings; + } + + /** Returns the object with the settings used for calls to createWorkstation. */ + public OperationCallSettings + createWorkstationOperationSettings() { + return createWorkstationOperationSettings; + } + + /** Returns the object with the settings used for calls to updateWorkstation. */ + public UnaryCallSettings updateWorkstationSettings() { + return updateWorkstationSettings; + } + + /** Returns the object with the settings used for calls to updateWorkstation. */ + public OperationCallSettings + updateWorkstationOperationSettings() { + return updateWorkstationOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteWorkstation. */ + public UnaryCallSettings deleteWorkstationSettings() { + return deleteWorkstationSettings; + } + + /** Returns the object with the settings used for calls to deleteWorkstation. */ + public OperationCallSettings + deleteWorkstationOperationSettings() { + return deleteWorkstationOperationSettings; + } + + /** Returns the object with the settings used for calls to startWorkstation. */ + public UnaryCallSettings startWorkstationSettings() { + return startWorkstationSettings; + } + + /** Returns the object with the settings used for calls to startWorkstation. */ + public OperationCallSettings + startWorkstationOperationSettings() { + return startWorkstationOperationSettings; + } + + /** Returns the object with the settings used for calls to stopWorkstation. */ + public UnaryCallSettings stopWorkstationSettings() { + return stopWorkstationSettings; + } + + /** Returns the object with the settings used for calls to stopWorkstation. */ + public OperationCallSettings + stopWorkstationOperationSettings() { + return stopWorkstationOperationSettings; + } + + /** Returns the object with the settings used for calls to generateAccessToken. */ + public UnaryCallSettings + generateAccessTokenSettings() { + return generateAccessTokenSettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + public WorkstationsStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcWorkstationsStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonWorkstationsStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "workstations.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "workstations.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(WorkstationsStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(WorkstationsStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return WorkstationsStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected WorkstationsStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + getWorkstationClusterSettings = settingsBuilder.getWorkstationClusterSettings().build(); + listWorkstationClustersSettings = settingsBuilder.listWorkstationClustersSettings().build(); + createWorkstationClusterSettings = settingsBuilder.createWorkstationClusterSettings().build(); + createWorkstationClusterOperationSettings = + settingsBuilder.createWorkstationClusterOperationSettings().build(); + updateWorkstationClusterSettings = settingsBuilder.updateWorkstationClusterSettings().build(); + updateWorkstationClusterOperationSettings = + settingsBuilder.updateWorkstationClusterOperationSettings().build(); + deleteWorkstationClusterSettings = settingsBuilder.deleteWorkstationClusterSettings().build(); + deleteWorkstationClusterOperationSettings = + settingsBuilder.deleteWorkstationClusterOperationSettings().build(); + getWorkstationConfigSettings = settingsBuilder.getWorkstationConfigSettings().build(); + listWorkstationConfigsSettings = settingsBuilder.listWorkstationConfigsSettings().build(); + listUsableWorkstationConfigsSettings = + settingsBuilder.listUsableWorkstationConfigsSettings().build(); + createWorkstationConfigSettings = settingsBuilder.createWorkstationConfigSettings().build(); + createWorkstationConfigOperationSettings = + settingsBuilder.createWorkstationConfigOperationSettings().build(); + updateWorkstationConfigSettings = settingsBuilder.updateWorkstationConfigSettings().build(); + updateWorkstationConfigOperationSettings = + settingsBuilder.updateWorkstationConfigOperationSettings().build(); + deleteWorkstationConfigSettings = settingsBuilder.deleteWorkstationConfigSettings().build(); + deleteWorkstationConfigOperationSettings = + settingsBuilder.deleteWorkstationConfigOperationSettings().build(); + getWorkstationSettings = settingsBuilder.getWorkstationSettings().build(); + listWorkstationsSettings = settingsBuilder.listWorkstationsSettings().build(); + listUsableWorkstationsSettings = settingsBuilder.listUsableWorkstationsSettings().build(); + createWorkstationSettings = settingsBuilder.createWorkstationSettings().build(); + createWorkstationOperationSettings = + settingsBuilder.createWorkstationOperationSettings().build(); + updateWorkstationSettings = settingsBuilder.updateWorkstationSettings().build(); + updateWorkstationOperationSettings = + settingsBuilder.updateWorkstationOperationSettings().build(); + deleteWorkstationSettings = settingsBuilder.deleteWorkstationSettings().build(); + deleteWorkstationOperationSettings = + settingsBuilder.deleteWorkstationOperationSettings().build(); + startWorkstationSettings = settingsBuilder.startWorkstationSettings().build(); + startWorkstationOperationSettings = settingsBuilder.startWorkstationOperationSettings().build(); + stopWorkstationSettings = settingsBuilder.stopWorkstationSettings().build(); + stopWorkstationOperationSettings = settingsBuilder.stopWorkstationOperationSettings().build(); + generateAccessTokenSettings = settingsBuilder.generateAccessTokenSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + /** Builder for WorkstationsStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + getWorkstationClusterSettings; + private final PagedCallSettings.Builder< + ListWorkstationClustersRequest, + ListWorkstationClustersResponse, + ListWorkstationClustersPagedResponse> + listWorkstationClustersSettings; + private final UnaryCallSettings.Builder + createWorkstationClusterSettings; + private final OperationCallSettings.Builder< + CreateWorkstationClusterRequest, WorkstationCluster, OperationMetadata> + createWorkstationClusterOperationSettings; + private final UnaryCallSettings.Builder + updateWorkstationClusterSettings; + private final OperationCallSettings.Builder< + UpdateWorkstationClusterRequest, WorkstationCluster, OperationMetadata> + updateWorkstationClusterOperationSettings; + private final UnaryCallSettings.Builder + deleteWorkstationClusterSettings; + private final OperationCallSettings.Builder< + DeleteWorkstationClusterRequest, WorkstationCluster, OperationMetadata> + deleteWorkstationClusterOperationSettings; + private final UnaryCallSettings.Builder + getWorkstationConfigSettings; + private final PagedCallSettings.Builder< + ListWorkstationConfigsRequest, + ListWorkstationConfigsResponse, + ListWorkstationConfigsPagedResponse> + listWorkstationConfigsSettings; + private final PagedCallSettings.Builder< + ListUsableWorkstationConfigsRequest, + ListUsableWorkstationConfigsResponse, + ListUsableWorkstationConfigsPagedResponse> + listUsableWorkstationConfigsSettings; + private final UnaryCallSettings.Builder + createWorkstationConfigSettings; + private final OperationCallSettings.Builder< + CreateWorkstationConfigRequest, WorkstationConfig, OperationMetadata> + createWorkstationConfigOperationSettings; + private final UnaryCallSettings.Builder + updateWorkstationConfigSettings; + private final OperationCallSettings.Builder< + UpdateWorkstationConfigRequest, WorkstationConfig, OperationMetadata> + updateWorkstationConfigOperationSettings; + private final UnaryCallSettings.Builder + deleteWorkstationConfigSettings; + private final OperationCallSettings.Builder< + DeleteWorkstationConfigRequest, WorkstationConfig, OperationMetadata> + deleteWorkstationConfigOperationSettings; + private final UnaryCallSettings.Builder + getWorkstationSettings; + private final PagedCallSettings.Builder< + ListWorkstationsRequest, ListWorkstationsResponse, ListWorkstationsPagedResponse> + listWorkstationsSettings; + private final PagedCallSettings.Builder< + ListUsableWorkstationsRequest, + ListUsableWorkstationsResponse, + ListUsableWorkstationsPagedResponse> + listUsableWorkstationsSettings; + private final UnaryCallSettings.Builder + createWorkstationSettings; + private final OperationCallSettings.Builder< + CreateWorkstationRequest, Workstation, OperationMetadata> + createWorkstationOperationSettings; + private final UnaryCallSettings.Builder + updateWorkstationSettings; + private final OperationCallSettings.Builder< + UpdateWorkstationRequest, Workstation, OperationMetadata> + updateWorkstationOperationSettings; + private final UnaryCallSettings.Builder + deleteWorkstationSettings; + private final OperationCallSettings.Builder< + DeleteWorkstationRequest, Workstation, OperationMetadata> + deleteWorkstationOperationSettings; + private final UnaryCallSettings.Builder + startWorkstationSettings; + private final OperationCallSettings.Builder< + StartWorkstationRequest, Workstation, OperationMetadata> + startWorkstationOperationSettings; + private final UnaryCallSettings.Builder + stopWorkstationSettings; + private final OperationCallSettings.Builder< + StopWorkstationRequest, Workstation, OperationMetadata> + stopWorkstationOperationSettings; + private final UnaryCallSettings.Builder + generateAccessTokenSettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(10000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_1_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + getWorkstationClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listWorkstationClustersSettings = + PagedCallSettings.newBuilder(LIST_WORKSTATION_CLUSTERS_PAGE_STR_FACT); + createWorkstationClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createWorkstationClusterOperationSettings = OperationCallSettings.newBuilder(); + updateWorkstationClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateWorkstationClusterOperationSettings = OperationCallSettings.newBuilder(); + deleteWorkstationClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteWorkstationClusterOperationSettings = OperationCallSettings.newBuilder(); + getWorkstationConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listWorkstationConfigsSettings = + PagedCallSettings.newBuilder(LIST_WORKSTATION_CONFIGS_PAGE_STR_FACT); + listUsableWorkstationConfigsSettings = + PagedCallSettings.newBuilder(LIST_USABLE_WORKSTATION_CONFIGS_PAGE_STR_FACT); + createWorkstationConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createWorkstationConfigOperationSettings = OperationCallSettings.newBuilder(); + updateWorkstationConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateWorkstationConfigOperationSettings = OperationCallSettings.newBuilder(); + deleteWorkstationConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteWorkstationConfigOperationSettings = OperationCallSettings.newBuilder(); + getWorkstationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listWorkstationsSettings = PagedCallSettings.newBuilder(LIST_WORKSTATIONS_PAGE_STR_FACT); + listUsableWorkstationsSettings = + PagedCallSettings.newBuilder(LIST_USABLE_WORKSTATIONS_PAGE_STR_FACT); + createWorkstationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createWorkstationOperationSettings = OperationCallSettings.newBuilder(); + updateWorkstationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateWorkstationOperationSettings = OperationCallSettings.newBuilder(); + deleteWorkstationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteWorkstationOperationSettings = OperationCallSettings.newBuilder(); + startWorkstationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + startWorkstationOperationSettings = OperationCallSettings.newBuilder(); + stopWorkstationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + stopWorkstationOperationSettings = OperationCallSettings.newBuilder(); + generateAccessTokenSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getWorkstationClusterSettings, + listWorkstationClustersSettings, + createWorkstationClusterSettings, + updateWorkstationClusterSettings, + deleteWorkstationClusterSettings, + getWorkstationConfigSettings, + listWorkstationConfigsSettings, + listUsableWorkstationConfigsSettings, + createWorkstationConfigSettings, + updateWorkstationConfigSettings, + deleteWorkstationConfigSettings, + getWorkstationSettings, + listWorkstationsSettings, + listUsableWorkstationsSettings, + createWorkstationSettings, + updateWorkstationSettings, + deleteWorkstationSettings, + startWorkstationSettings, + stopWorkstationSettings, + generateAccessTokenSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + initDefaults(this); + } + + protected Builder(WorkstationsStubSettings settings) { + super(settings); + + getWorkstationClusterSettings = settings.getWorkstationClusterSettings.toBuilder(); + listWorkstationClustersSettings = settings.listWorkstationClustersSettings.toBuilder(); + createWorkstationClusterSettings = settings.createWorkstationClusterSettings.toBuilder(); + createWorkstationClusterOperationSettings = + settings.createWorkstationClusterOperationSettings.toBuilder(); + updateWorkstationClusterSettings = settings.updateWorkstationClusterSettings.toBuilder(); + updateWorkstationClusterOperationSettings = + settings.updateWorkstationClusterOperationSettings.toBuilder(); + deleteWorkstationClusterSettings = settings.deleteWorkstationClusterSettings.toBuilder(); + deleteWorkstationClusterOperationSettings = + settings.deleteWorkstationClusterOperationSettings.toBuilder(); + getWorkstationConfigSettings = settings.getWorkstationConfigSettings.toBuilder(); + listWorkstationConfigsSettings = settings.listWorkstationConfigsSettings.toBuilder(); + listUsableWorkstationConfigsSettings = + settings.listUsableWorkstationConfigsSettings.toBuilder(); + createWorkstationConfigSettings = settings.createWorkstationConfigSettings.toBuilder(); + createWorkstationConfigOperationSettings = + settings.createWorkstationConfigOperationSettings.toBuilder(); + updateWorkstationConfigSettings = settings.updateWorkstationConfigSettings.toBuilder(); + updateWorkstationConfigOperationSettings = + settings.updateWorkstationConfigOperationSettings.toBuilder(); + deleteWorkstationConfigSettings = settings.deleteWorkstationConfigSettings.toBuilder(); + deleteWorkstationConfigOperationSettings = + settings.deleteWorkstationConfigOperationSettings.toBuilder(); + getWorkstationSettings = settings.getWorkstationSettings.toBuilder(); + listWorkstationsSettings = settings.listWorkstationsSettings.toBuilder(); + listUsableWorkstationsSettings = settings.listUsableWorkstationsSettings.toBuilder(); + createWorkstationSettings = settings.createWorkstationSettings.toBuilder(); + createWorkstationOperationSettings = settings.createWorkstationOperationSettings.toBuilder(); + updateWorkstationSettings = settings.updateWorkstationSettings.toBuilder(); + updateWorkstationOperationSettings = settings.updateWorkstationOperationSettings.toBuilder(); + deleteWorkstationSettings = settings.deleteWorkstationSettings.toBuilder(); + deleteWorkstationOperationSettings = settings.deleteWorkstationOperationSettings.toBuilder(); + startWorkstationSettings = settings.startWorkstationSettings.toBuilder(); + startWorkstationOperationSettings = settings.startWorkstationOperationSettings.toBuilder(); + stopWorkstationSettings = settings.stopWorkstationSettings.toBuilder(); + stopWorkstationOperationSettings = settings.stopWorkstationOperationSettings.toBuilder(); + generateAccessTokenSettings = settings.generateAccessTokenSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getWorkstationClusterSettings, + listWorkstationClustersSettings, + createWorkstationClusterSettings, + updateWorkstationClusterSettings, + deleteWorkstationClusterSettings, + getWorkstationConfigSettings, + listWorkstationConfigsSettings, + listUsableWorkstationConfigsSettings, + createWorkstationConfigSettings, + updateWorkstationConfigSettings, + deleteWorkstationConfigSettings, + getWorkstationSettings, + listWorkstationsSettings, + listUsableWorkstationsSettings, + createWorkstationSettings, + updateWorkstationSettings, + deleteWorkstationSettings, + startWorkstationSettings, + stopWorkstationSettings, + generateAccessTokenSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .getWorkstationClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listWorkstationClustersSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createWorkstationClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .updateWorkstationClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteWorkstationClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .getWorkstationConfigSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listWorkstationConfigsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listUsableWorkstationConfigsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createWorkstationConfigSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .updateWorkstationConfigSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteWorkstationConfigSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .getWorkstationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listWorkstationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listUsableWorkstationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createWorkstationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .updateWorkstationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteWorkstationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .startWorkstationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .stopWorkstationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .generateAccessTokenSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .createWorkstationClusterOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(WorkstationCluster.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .updateWorkstationClusterOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(WorkstationCluster.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .deleteWorkstationClusterOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(WorkstationCluster.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .createWorkstationConfigOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(WorkstationConfig.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .updateWorkstationConfigOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(WorkstationConfig.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .deleteWorkstationConfigOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(WorkstationConfig.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .createWorkstationOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Workstation.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .updateWorkstationOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Workstation.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .deleteWorkstationOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Workstation.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .startWorkstationOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Workstation.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .stopWorkstationOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Workstation.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to getWorkstationCluster. */ + public UnaryCallSettings.Builder + getWorkstationClusterSettings() { + return getWorkstationClusterSettings; + } + + /** Returns the builder for the settings used for calls to listWorkstationClusters. */ + public PagedCallSettings.Builder< + ListWorkstationClustersRequest, + ListWorkstationClustersResponse, + ListWorkstationClustersPagedResponse> + listWorkstationClustersSettings() { + return listWorkstationClustersSettings; + } + + /** Returns the builder for the settings used for calls to createWorkstationCluster. */ + public UnaryCallSettings.Builder + createWorkstationClusterSettings() { + return createWorkstationClusterSettings; + } + + /** Returns the builder for the settings used for calls to createWorkstationCluster. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + CreateWorkstationClusterRequest, WorkstationCluster, OperationMetadata> + createWorkstationClusterOperationSettings() { + return createWorkstationClusterOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateWorkstationCluster. */ + public UnaryCallSettings.Builder + updateWorkstationClusterSettings() { + return updateWorkstationClusterSettings; + } + + /** Returns the builder for the settings used for calls to updateWorkstationCluster. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + UpdateWorkstationClusterRequest, WorkstationCluster, OperationMetadata> + updateWorkstationClusterOperationSettings() { + return updateWorkstationClusterOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteWorkstationCluster. */ + public UnaryCallSettings.Builder + deleteWorkstationClusterSettings() { + return deleteWorkstationClusterSettings; + } + + /** Returns the builder for the settings used for calls to deleteWorkstationCluster. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + DeleteWorkstationClusterRequest, WorkstationCluster, OperationMetadata> + deleteWorkstationClusterOperationSettings() { + return deleteWorkstationClusterOperationSettings; + } + + /** Returns the builder for the settings used for calls to getWorkstationConfig. */ + public UnaryCallSettings.Builder + getWorkstationConfigSettings() { + return getWorkstationConfigSettings; + } + + /** Returns the builder for the settings used for calls to listWorkstationConfigs. */ + public PagedCallSettings.Builder< + ListWorkstationConfigsRequest, + ListWorkstationConfigsResponse, + ListWorkstationConfigsPagedResponse> + listWorkstationConfigsSettings() { + return listWorkstationConfigsSettings; + } + + /** Returns the builder for the settings used for calls to listUsableWorkstationConfigs. */ + public PagedCallSettings.Builder< + ListUsableWorkstationConfigsRequest, + ListUsableWorkstationConfigsResponse, + ListUsableWorkstationConfigsPagedResponse> + listUsableWorkstationConfigsSettings() { + return listUsableWorkstationConfigsSettings; + } + + /** Returns the builder for the settings used for calls to createWorkstationConfig. */ + public UnaryCallSettings.Builder + createWorkstationConfigSettings() { + return createWorkstationConfigSettings; + } + + /** Returns the builder for the settings used for calls to createWorkstationConfig. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + CreateWorkstationConfigRequest, WorkstationConfig, OperationMetadata> + createWorkstationConfigOperationSettings() { + return createWorkstationConfigOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateWorkstationConfig. */ + public UnaryCallSettings.Builder + updateWorkstationConfigSettings() { + return updateWorkstationConfigSettings; + } + + /** Returns the builder for the settings used for calls to updateWorkstationConfig. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + UpdateWorkstationConfigRequest, WorkstationConfig, OperationMetadata> + updateWorkstationConfigOperationSettings() { + return updateWorkstationConfigOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteWorkstationConfig. */ + public UnaryCallSettings.Builder + deleteWorkstationConfigSettings() { + return deleteWorkstationConfigSettings; + } + + /** Returns the builder for the settings used for calls to deleteWorkstationConfig. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + DeleteWorkstationConfigRequest, WorkstationConfig, OperationMetadata> + deleteWorkstationConfigOperationSettings() { + return deleteWorkstationConfigOperationSettings; + } + + /** Returns the builder for the settings used for calls to getWorkstation. */ + public UnaryCallSettings.Builder getWorkstationSettings() { + return getWorkstationSettings; + } + + /** Returns the builder for the settings used for calls to listWorkstations. */ + public PagedCallSettings.Builder< + ListWorkstationsRequest, ListWorkstationsResponse, ListWorkstationsPagedResponse> + listWorkstationsSettings() { + return listWorkstationsSettings; + } + + /** Returns the builder for the settings used for calls to listUsableWorkstations. */ + public PagedCallSettings.Builder< + ListUsableWorkstationsRequest, + ListUsableWorkstationsResponse, + ListUsableWorkstationsPagedResponse> + listUsableWorkstationsSettings() { + return listUsableWorkstationsSettings; + } + + /** Returns the builder for the settings used for calls to createWorkstation. */ + public UnaryCallSettings.Builder + createWorkstationSettings() { + return createWorkstationSettings; + } + + /** Returns the builder for the settings used for calls to createWorkstation. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createWorkstationOperationSettings() { + return createWorkstationOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateWorkstation. */ + public UnaryCallSettings.Builder + updateWorkstationSettings() { + return updateWorkstationSettings; + } + + /** Returns the builder for the settings used for calls to updateWorkstation. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateWorkstationOperationSettings() { + return updateWorkstationOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteWorkstation. */ + public UnaryCallSettings.Builder + deleteWorkstationSettings() { + return deleteWorkstationSettings; + } + + /** Returns the builder for the settings used for calls to deleteWorkstation. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteWorkstationOperationSettings() { + return deleteWorkstationOperationSettings; + } + + /** Returns the builder for the settings used for calls to startWorkstation. */ + public UnaryCallSettings.Builder + startWorkstationSettings() { + return startWorkstationSettings; + } + + /** Returns the builder for the settings used for calls to startWorkstation. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + startWorkstationOperationSettings() { + return startWorkstationOperationSettings; + } + + /** Returns the builder for the settings used for calls to stopWorkstation. */ + public UnaryCallSettings.Builder stopWorkstationSettings() { + return stopWorkstationSettings; + } + + /** Returns the builder for the settings used for calls to stopWorkstation. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + stopWorkstationOperationSettings() { + return stopWorkstationOperationSettings; + } + + /** Returns the builder for the settings used for calls to generateAccessToken. */ + public UnaryCallSettings.Builder + generateAccessTokenSettings() { + return generateAccessTokenSettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public WorkstationsStubSettings build() throws IOException { + return new WorkstationsStubSettings(this); + } + } +} diff --git a/java-workstations/google-cloud-workstations/src/test/java/com/google/cloud/workstations/v1beta/MockIAMPolicy.java b/java-workstations/google-cloud-workstations/src/test/java/com/google/cloud/workstations/v1beta/MockIAMPolicy.java new file mode 100644 index 000000000000..7f5061878caa --- /dev/null +++ b/java-workstations/google-cloud-workstations/src/test/java/com/google/cloud/workstations/v1beta/MockIAMPolicy.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 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.workstations.v1beta; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockIAMPolicy implements MockGrpcService { + private final MockIAMPolicyImpl serviceImpl; + + public MockIAMPolicy() { + serviceImpl = new MockIAMPolicyImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-workstations/google-cloud-workstations/src/test/java/com/google/cloud/workstations/v1beta/MockIAMPolicyImpl.java b/java-workstations/google-cloud-workstations/src/test/java/com/google/cloud/workstations/v1beta/MockIAMPolicyImpl.java new file mode 100644 index 000000000000..26c29b629b07 --- /dev/null +++ b/java-workstations/google-cloud-workstations/src/test/java/com/google/cloud/workstations/v1beta/MockIAMPolicyImpl.java @@ -0,0 +1,127 @@ +/* + * Copyright 2022 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.workstations.v1beta; + +import com.google.api.core.BetaApi; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.IAMPolicyGrpc.IAMPolicyImplBase; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockIAMPolicyImpl extends IAMPolicyImplBase { + private List requests; + private Queue responses; + + public MockIAMPolicyImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void testIamPermissions( + TestIamPermissionsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof TestIamPermissionsResponse) { + requests.add(request); + responseObserver.onNext(((TestIamPermissionsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method TestIamPermissions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + TestIamPermissionsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void setIamPolicy(SetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getIamPolicy(GetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-workstations/google-cloud-workstations/src/test/java/com/google/cloud/workstations/v1beta/MockLocations.java b/java-workstations/google-cloud-workstations/src/test/java/com/google/cloud/workstations/v1beta/MockLocations.java new file mode 100644 index 000000000000..870b74e42c17 --- /dev/null +++ b/java-workstations/google-cloud-workstations/src/test/java/com/google/cloud/workstations/v1beta/MockLocations.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 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.workstations.v1beta; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocations implements MockGrpcService { + private final MockLocationsImpl serviceImpl; + + public MockLocations() { + serviceImpl = new MockLocationsImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-workstations/google-cloud-workstations/src/test/java/com/google/cloud/workstations/v1beta/MockLocationsImpl.java b/java-workstations/google-cloud-workstations/src/test/java/com/google/cloud/workstations/v1beta/MockLocationsImpl.java new file mode 100644 index 000000000000..136f113a65ca --- /dev/null +++ b/java-workstations/google-cloud-workstations/src/test/java/com/google/cloud/workstations/v1beta/MockLocationsImpl.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 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.workstations.v1beta; + +import com.google.api.core.BetaApi; +import com.google.cloud.location.LocationsGrpc.LocationsImplBase; +import com.google.protobuf.AbstractMessage; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocationsImpl extends LocationsImplBase { + private List requests; + private Queue responses; + + public MockLocationsImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } +} diff --git a/java-workstations/google-cloud-workstations/src/test/java/com/google/cloud/workstations/v1beta/MockWorkstations.java b/java-workstations/google-cloud-workstations/src/test/java/com/google/cloud/workstations/v1beta/MockWorkstations.java new file mode 100644 index 000000000000..165d703f37fb --- /dev/null +++ b/java-workstations/google-cloud-workstations/src/test/java/com/google/cloud/workstations/v1beta/MockWorkstations.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 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.workstations.v1beta; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockWorkstations implements MockGrpcService { + private final MockWorkstationsImpl serviceImpl; + + public MockWorkstations() { + serviceImpl = new MockWorkstationsImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-workstations/google-cloud-workstations/src/test/java/com/google/cloud/workstations/v1beta/MockWorkstationsImpl.java b/java-workstations/google-cloud-workstations/src/test/java/com/google/cloud/workstations/v1beta/MockWorkstationsImpl.java new file mode 100644 index 000000000000..fdae5d9681bf --- /dev/null +++ b/java-workstations/google-cloud-workstations/src/test/java/com/google/cloud/workstations/v1beta/MockWorkstationsImpl.java @@ -0,0 +1,486 @@ +/* + * Copyright 2022 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.workstations.v1beta; + +import com.google.api.core.BetaApi; +import com.google.cloud.workstations.v1beta.WorkstationsGrpc.WorkstationsImplBase; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockWorkstationsImpl extends WorkstationsImplBase { + private List requests; + private Queue responses; + + public MockWorkstationsImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void getWorkstationCluster( + GetWorkstationClusterRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof WorkstationCluster) { + requests.add(request); + responseObserver.onNext(((WorkstationCluster) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetWorkstationCluster, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + WorkstationCluster.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listWorkstationClusters( + ListWorkstationClustersRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListWorkstationClustersResponse) { + requests.add(request); + responseObserver.onNext(((ListWorkstationClustersResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListWorkstationClusters, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListWorkstationClustersResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createWorkstationCluster( + CreateWorkstationClusterRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateWorkstationCluster, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateWorkstationCluster( + UpdateWorkstationClusterRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateWorkstationCluster, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteWorkstationCluster( + DeleteWorkstationClusterRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteWorkstationCluster, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getWorkstationConfig( + GetWorkstationConfigRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof WorkstationConfig) { + requests.add(request); + responseObserver.onNext(((WorkstationConfig) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetWorkstationConfig, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + WorkstationConfig.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listWorkstationConfigs( + ListWorkstationConfigsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListWorkstationConfigsResponse) { + requests.add(request); + responseObserver.onNext(((ListWorkstationConfigsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListWorkstationConfigs, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListWorkstationConfigsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listUsableWorkstationConfigs( + ListUsableWorkstationConfigsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListUsableWorkstationConfigsResponse) { + requests.add(request); + responseObserver.onNext(((ListUsableWorkstationConfigsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListUsableWorkstationConfigs, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListUsableWorkstationConfigsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createWorkstationConfig( + CreateWorkstationConfigRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateWorkstationConfig, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateWorkstationConfig( + UpdateWorkstationConfigRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateWorkstationConfig, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteWorkstationConfig( + DeleteWorkstationConfigRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteWorkstationConfig, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getWorkstation( + GetWorkstationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Workstation) { + requests.add(request); + responseObserver.onNext(((Workstation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetWorkstation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Workstation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listWorkstations( + ListWorkstationsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListWorkstationsResponse) { + requests.add(request); + responseObserver.onNext(((ListWorkstationsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListWorkstations, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListWorkstationsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listUsableWorkstations( + ListUsableWorkstationsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListUsableWorkstationsResponse) { + requests.add(request); + responseObserver.onNext(((ListUsableWorkstationsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListUsableWorkstations, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListUsableWorkstationsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createWorkstation( + CreateWorkstationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateWorkstation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateWorkstation( + UpdateWorkstationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateWorkstation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteWorkstation( + DeleteWorkstationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteWorkstation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void startWorkstation( + StartWorkstationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method StartWorkstation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void stopWorkstation( + StopWorkstationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method StopWorkstation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void generateAccessToken( + GenerateAccessTokenRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof GenerateAccessTokenResponse) { + requests.add(request); + responseObserver.onNext(((GenerateAccessTokenResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GenerateAccessToken, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + GenerateAccessTokenResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-workstations/google-cloud-workstations/src/test/java/com/google/cloud/workstations/v1beta/WorkstationsClientHttpJsonTest.java b/java-workstations/google-cloud-workstations/src/test/java/com/google/cloud/workstations/v1beta/WorkstationsClientHttpJsonTest.java new file mode 100644 index 000000000000..12332ffd77f9 --- /dev/null +++ b/java-workstations/google-cloud-workstations/src/test/java/com/google/cloud/workstations/v1beta/WorkstationsClientHttpJsonTest.java @@ -0,0 +1,2818 @@ +/* + * Copyright 2022 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.workstations.v1beta; + +import static com.google.cloud.workstations.v1beta.WorkstationsClient.ListUsableWorkstationConfigsPagedResponse; +import static com.google.cloud.workstations.v1beta.WorkstationsClient.ListUsableWorkstationsPagedResponse; +import static com.google.cloud.workstations.v1beta.WorkstationsClient.ListWorkstationClustersPagedResponse; +import static com.google.cloud.workstations.v1beta.WorkstationsClient.ListWorkstationConfigsPagedResponse; +import static com.google.cloud.workstations.v1beta.WorkstationsClient.ListWorkstationsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.workstations.v1beta.stub.HttpJsonWorkstationsStub; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Duration; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import com.google.rpc.Status; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class WorkstationsClientHttpJsonTest { + private static MockHttpService mockService; + private static WorkstationsClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonWorkstationsStub.getMethodDescriptors(), + WorkstationsSettings.getDefaultEndpoint()); + WorkstationsSettings settings = + WorkstationsSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + WorkstationsSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = WorkstationsClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void getWorkstationClusterTest() throws Exception { + WorkstationCluster expectedResponse = + WorkstationCluster.newBuilder() + .setName( + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setNetwork("network1843485230") + .setSubnetwork("subnetwork-1302785042") + .setPrivateClusterConfig(WorkstationCluster.PrivateClusterConfig.newBuilder().build()) + .setDegraded(true) + .addAllConditions(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + WorkstationClusterName name = + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]"); + + WorkstationCluster actualResponse = client.getWorkstationCluster(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getWorkstationClusterExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + WorkstationClusterName name = + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]"); + client.getWorkstationCluster(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getWorkstationClusterTest2() throws Exception { + WorkstationCluster expectedResponse = + WorkstationCluster.newBuilder() + .setName( + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setNetwork("network1843485230") + .setSubnetwork("subnetwork-1302785042") + .setPrivateClusterConfig(WorkstationCluster.PrivateClusterConfig.newBuilder().build()) + .setDegraded(true) + .addAllConditions(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-7538/locations/location-7538/workstationClusters/workstationCluster-7538"; + + WorkstationCluster actualResponse = client.getWorkstationCluster(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getWorkstationClusterExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-7538/locations/location-7538/workstationClusters/workstationCluster-7538"; + client.getWorkstationCluster(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listWorkstationClustersTest() throws Exception { + WorkstationCluster responsesElement = WorkstationCluster.newBuilder().build(); + ListWorkstationClustersResponse expectedResponse = + ListWorkstationClustersResponse.newBuilder() + .setNextPageToken("") + .addAllWorkstationClusters(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListWorkstationClustersPagedResponse pagedListResponse = client.listWorkstationClusters(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getWorkstationClustersList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listWorkstationClustersExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listWorkstationClusters(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listWorkstationClustersTest2() throws Exception { + WorkstationCluster responsesElement = WorkstationCluster.newBuilder().build(); + ListWorkstationClustersResponse expectedResponse = + ListWorkstationClustersResponse.newBuilder() + .setNextPageToken("") + .addAllWorkstationClusters(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListWorkstationClustersPagedResponse pagedListResponse = client.listWorkstationClusters(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getWorkstationClustersList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listWorkstationClustersExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listWorkstationClusters(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createWorkstationClusterTest() throws Exception { + WorkstationCluster expectedResponse = + WorkstationCluster.newBuilder() + .setName( + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setNetwork("network1843485230") + .setSubnetwork("subnetwork-1302785042") + .setPrivateClusterConfig(WorkstationCluster.PrivateClusterConfig.newBuilder().build()) + .setDegraded(true) + .addAllConditions(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createWorkstationClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + WorkstationCluster workstationCluster = WorkstationCluster.newBuilder().build(); + String workstationClusterId = "workstationClusterId351421170"; + + WorkstationCluster actualResponse = + client + .createWorkstationClusterAsync(parent, workstationCluster, workstationClusterId) + .get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createWorkstationClusterExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + WorkstationCluster workstationCluster = WorkstationCluster.newBuilder().build(); + String workstationClusterId = "workstationClusterId351421170"; + client.createWorkstationClusterAsync(parent, workstationCluster, workstationClusterId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createWorkstationClusterTest2() throws Exception { + WorkstationCluster expectedResponse = + WorkstationCluster.newBuilder() + .setName( + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setNetwork("network1843485230") + .setSubnetwork("subnetwork-1302785042") + .setPrivateClusterConfig(WorkstationCluster.PrivateClusterConfig.newBuilder().build()) + .setDegraded(true) + .addAllConditions(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createWorkstationClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-5833/locations/location-5833"; + WorkstationCluster workstationCluster = WorkstationCluster.newBuilder().build(); + String workstationClusterId = "workstationClusterId351421170"; + + WorkstationCluster actualResponse = + client + .createWorkstationClusterAsync(parent, workstationCluster, workstationClusterId) + .get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createWorkstationClusterExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + WorkstationCluster workstationCluster = WorkstationCluster.newBuilder().build(); + String workstationClusterId = "workstationClusterId351421170"; + client.createWorkstationClusterAsync(parent, workstationCluster, workstationClusterId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void updateWorkstationClusterTest() throws Exception { + WorkstationCluster expectedResponse = + WorkstationCluster.newBuilder() + .setName( + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setNetwork("network1843485230") + .setSubnetwork("subnetwork-1302785042") + .setPrivateClusterConfig(WorkstationCluster.PrivateClusterConfig.newBuilder().build()) + .setDegraded(true) + .addAllConditions(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateWorkstationClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + WorkstationCluster workstationCluster = + WorkstationCluster.newBuilder() + .setName( + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setNetwork("network1843485230") + .setSubnetwork("subnetwork-1302785042") + .setPrivateClusterConfig(WorkstationCluster.PrivateClusterConfig.newBuilder().build()) + .setDegraded(true) + .addAllConditions(new ArrayList()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + WorkstationCluster actualResponse = + client.updateWorkstationClusterAsync(workstationCluster, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateWorkstationClusterExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + WorkstationCluster workstationCluster = + WorkstationCluster.newBuilder() + .setName( + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setNetwork("network1843485230") + .setSubnetwork("subnetwork-1302785042") + .setPrivateClusterConfig(WorkstationCluster.PrivateClusterConfig.newBuilder().build()) + .setDegraded(true) + .addAllConditions(new ArrayList()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateWorkstationClusterAsync(workstationCluster, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteWorkstationClusterTest() throws Exception { + WorkstationCluster expectedResponse = + WorkstationCluster.newBuilder() + .setName( + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setNetwork("network1843485230") + .setSubnetwork("subnetwork-1302785042") + .setPrivateClusterConfig(WorkstationCluster.PrivateClusterConfig.newBuilder().build()) + .setDegraded(true) + .addAllConditions(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteWorkstationClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + WorkstationClusterName name = + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]"); + + WorkstationCluster actualResponse = client.deleteWorkstationClusterAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteWorkstationClusterExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + WorkstationClusterName name = + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]"); + client.deleteWorkstationClusterAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteWorkstationClusterTest2() throws Exception { + WorkstationCluster expectedResponse = + WorkstationCluster.newBuilder() + .setName( + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setNetwork("network1843485230") + .setSubnetwork("subnetwork-1302785042") + .setPrivateClusterConfig(WorkstationCluster.PrivateClusterConfig.newBuilder().build()) + .setDegraded(true) + .addAllConditions(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteWorkstationClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = + "projects/project-7538/locations/location-7538/workstationClusters/workstationCluster-7538"; + + WorkstationCluster actualResponse = client.deleteWorkstationClusterAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteWorkstationClusterExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-7538/locations/location-7538/workstationClusters/workstationCluster-7538"; + client.deleteWorkstationClusterAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void getWorkstationConfigTest() throws Exception { + WorkstationConfig expectedResponse = + WorkstationConfig.newBuilder() + .setName( + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setIdleTimeout(Duration.newBuilder().build()) + .setRunningTimeout(Duration.newBuilder().build()) + .setHost(WorkstationConfig.Host.newBuilder().build()) + .addAllPersistentDirectories(new ArrayList()) + .setContainer(WorkstationConfig.Container.newBuilder().build()) + .setEncryptionKey(WorkstationConfig.CustomerEncryptionKey.newBuilder().build()) + .setDegraded(true) + .addAllConditions(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + WorkstationConfigName name = + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]"); + + WorkstationConfig actualResponse = client.getWorkstationConfig(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getWorkstationConfigExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + WorkstationConfigName name = + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]"); + client.getWorkstationConfig(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getWorkstationConfigTest2() throws Exception { + WorkstationConfig expectedResponse = + WorkstationConfig.newBuilder() + .setName( + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setIdleTimeout(Duration.newBuilder().build()) + .setRunningTimeout(Duration.newBuilder().build()) + .setHost(WorkstationConfig.Host.newBuilder().build()) + .addAllPersistentDirectories(new ArrayList()) + .setContainer(WorkstationConfig.Container.newBuilder().build()) + .setEncryptionKey(WorkstationConfig.CustomerEncryptionKey.newBuilder().build()) + .setDegraded(true) + .addAllConditions(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-6150/locations/location-6150/workstationClusters/workstationCluster-6150/workstationConfigs/workstationConfig-6150"; + + WorkstationConfig actualResponse = client.getWorkstationConfig(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getWorkstationConfigExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-6150/locations/location-6150/workstationClusters/workstationCluster-6150/workstationConfigs/workstationConfig-6150"; + client.getWorkstationConfig(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listWorkstationConfigsTest() throws Exception { + WorkstationConfig responsesElement = WorkstationConfig.newBuilder().build(); + ListWorkstationConfigsResponse expectedResponse = + ListWorkstationConfigsResponse.newBuilder() + .setNextPageToken("") + .addAllWorkstationConfigs(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + WorkstationClusterName parent = + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]"); + + ListWorkstationConfigsPagedResponse pagedListResponse = client.listWorkstationConfigs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getWorkstationConfigsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listWorkstationConfigsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + WorkstationClusterName parent = + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]"); + client.listWorkstationConfigs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listWorkstationConfigsTest2() throws Exception { + WorkstationConfig responsesElement = WorkstationConfig.newBuilder().build(); + ListWorkstationConfigsResponse expectedResponse = + ListWorkstationConfigsResponse.newBuilder() + .setNextPageToken("") + .addAllWorkstationConfigs(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = + "projects/project-5665/locations/location-5665/workstationClusters/workstationCluster-5665"; + + ListWorkstationConfigsPagedResponse pagedListResponse = client.listWorkstationConfigs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getWorkstationConfigsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listWorkstationConfigsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = + "projects/project-5665/locations/location-5665/workstationClusters/workstationCluster-5665"; + client.listWorkstationConfigs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listUsableWorkstationConfigsTest() throws Exception { + WorkstationConfig responsesElement = WorkstationConfig.newBuilder().build(); + ListUsableWorkstationConfigsResponse expectedResponse = + ListUsableWorkstationConfigsResponse.newBuilder() + .setNextPageToken("") + .addAllWorkstationConfigs(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + WorkstationClusterName parent = + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]"); + + ListUsableWorkstationConfigsPagedResponse pagedListResponse = + client.listUsableWorkstationConfigs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getWorkstationConfigsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listUsableWorkstationConfigsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + WorkstationClusterName parent = + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]"); + client.listUsableWorkstationConfigs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listUsableWorkstationConfigsTest2() throws Exception { + WorkstationConfig responsesElement = WorkstationConfig.newBuilder().build(); + ListUsableWorkstationConfigsResponse expectedResponse = + ListUsableWorkstationConfigsResponse.newBuilder() + .setNextPageToken("") + .addAllWorkstationConfigs(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = + "projects/project-5665/locations/location-5665/workstationClusters/workstationCluster-5665"; + + ListUsableWorkstationConfigsPagedResponse pagedListResponse = + client.listUsableWorkstationConfigs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getWorkstationConfigsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listUsableWorkstationConfigsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = + "projects/project-5665/locations/location-5665/workstationClusters/workstationCluster-5665"; + client.listUsableWorkstationConfigs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createWorkstationConfigTest() throws Exception { + WorkstationConfig expectedResponse = + WorkstationConfig.newBuilder() + .setName( + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setIdleTimeout(Duration.newBuilder().build()) + .setRunningTimeout(Duration.newBuilder().build()) + .setHost(WorkstationConfig.Host.newBuilder().build()) + .addAllPersistentDirectories(new ArrayList()) + .setContainer(WorkstationConfig.Container.newBuilder().build()) + .setEncryptionKey(WorkstationConfig.CustomerEncryptionKey.newBuilder().build()) + .setDegraded(true) + .addAllConditions(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createWorkstationConfigTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + WorkstationClusterName parent = + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]"); + WorkstationConfig workstationConfig = WorkstationConfig.newBuilder().build(); + String workstationConfigId = "workstationConfigId798542368"; + + WorkstationConfig actualResponse = + client.createWorkstationConfigAsync(parent, workstationConfig, workstationConfigId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createWorkstationConfigExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + WorkstationClusterName parent = + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]"); + WorkstationConfig workstationConfig = WorkstationConfig.newBuilder().build(); + String workstationConfigId = "workstationConfigId798542368"; + client.createWorkstationConfigAsync(parent, workstationConfig, workstationConfigId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createWorkstationConfigTest2() throws Exception { + WorkstationConfig expectedResponse = + WorkstationConfig.newBuilder() + .setName( + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setIdleTimeout(Duration.newBuilder().build()) + .setRunningTimeout(Duration.newBuilder().build()) + .setHost(WorkstationConfig.Host.newBuilder().build()) + .addAllPersistentDirectories(new ArrayList()) + .setContainer(WorkstationConfig.Container.newBuilder().build()) + .setEncryptionKey(WorkstationConfig.CustomerEncryptionKey.newBuilder().build()) + .setDegraded(true) + .addAllConditions(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createWorkstationConfigTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = + "projects/project-5665/locations/location-5665/workstationClusters/workstationCluster-5665"; + WorkstationConfig workstationConfig = WorkstationConfig.newBuilder().build(); + String workstationConfigId = "workstationConfigId798542368"; + + WorkstationConfig actualResponse = + client.createWorkstationConfigAsync(parent, workstationConfig, workstationConfigId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createWorkstationConfigExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = + "projects/project-5665/locations/location-5665/workstationClusters/workstationCluster-5665"; + WorkstationConfig workstationConfig = WorkstationConfig.newBuilder().build(); + String workstationConfigId = "workstationConfigId798542368"; + client.createWorkstationConfigAsync(parent, workstationConfig, workstationConfigId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void updateWorkstationConfigTest() throws Exception { + WorkstationConfig expectedResponse = + WorkstationConfig.newBuilder() + .setName( + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setIdleTimeout(Duration.newBuilder().build()) + .setRunningTimeout(Duration.newBuilder().build()) + .setHost(WorkstationConfig.Host.newBuilder().build()) + .addAllPersistentDirectories(new ArrayList()) + .setContainer(WorkstationConfig.Container.newBuilder().build()) + .setEncryptionKey(WorkstationConfig.CustomerEncryptionKey.newBuilder().build()) + .setDegraded(true) + .addAllConditions(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateWorkstationConfigTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + WorkstationConfig workstationConfig = + WorkstationConfig.newBuilder() + .setName( + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setIdleTimeout(Duration.newBuilder().build()) + .setRunningTimeout(Duration.newBuilder().build()) + .setHost(WorkstationConfig.Host.newBuilder().build()) + .addAllPersistentDirectories(new ArrayList()) + .setContainer(WorkstationConfig.Container.newBuilder().build()) + .setEncryptionKey(WorkstationConfig.CustomerEncryptionKey.newBuilder().build()) + .setDegraded(true) + .addAllConditions(new ArrayList()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + WorkstationConfig actualResponse = + client.updateWorkstationConfigAsync(workstationConfig, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateWorkstationConfigExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + WorkstationConfig workstationConfig = + WorkstationConfig.newBuilder() + .setName( + WorkstationConfigName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setIdleTimeout(Duration.newBuilder().build()) + .setRunningTimeout(Duration.newBuilder().build()) + .setHost(WorkstationConfig.Host.newBuilder().build()) + .addAllPersistentDirectories(new ArrayList()) + .setContainer(WorkstationConfig.Container.newBuilder().build()) + .setEncryptionKey(WorkstationConfig.CustomerEncryptionKey.newBuilder().build()) + .setDegraded(true) + .addAllConditions(new ArrayList()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateWorkstationConfigAsync(workstationConfig, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteWorkstationConfigTest() throws Exception { + WorkstationConfig expectedResponse = + WorkstationConfig.newBuilder() + .setName( + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setIdleTimeout(Duration.newBuilder().build()) + .setRunningTimeout(Duration.newBuilder().build()) + .setHost(WorkstationConfig.Host.newBuilder().build()) + .addAllPersistentDirectories(new ArrayList()) + .setContainer(WorkstationConfig.Container.newBuilder().build()) + .setEncryptionKey(WorkstationConfig.CustomerEncryptionKey.newBuilder().build()) + .setDegraded(true) + .addAllConditions(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteWorkstationConfigTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + WorkstationConfigName name = + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]"); + + WorkstationConfig actualResponse = client.deleteWorkstationConfigAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteWorkstationConfigExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + WorkstationConfigName name = + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]"); + client.deleteWorkstationConfigAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteWorkstationConfigTest2() throws Exception { + WorkstationConfig expectedResponse = + WorkstationConfig.newBuilder() + .setName( + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setIdleTimeout(Duration.newBuilder().build()) + .setRunningTimeout(Duration.newBuilder().build()) + .setHost(WorkstationConfig.Host.newBuilder().build()) + .addAllPersistentDirectories(new ArrayList()) + .setContainer(WorkstationConfig.Container.newBuilder().build()) + .setEncryptionKey(WorkstationConfig.CustomerEncryptionKey.newBuilder().build()) + .setDegraded(true) + .addAllConditions(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteWorkstationConfigTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = + "projects/project-6150/locations/location-6150/workstationClusters/workstationCluster-6150/workstationConfigs/workstationConfig-6150"; + + WorkstationConfig actualResponse = client.deleteWorkstationConfigAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteWorkstationConfigExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-6150/locations/location-6150/workstationClusters/workstationCluster-6150/workstationConfigs/workstationConfig-6150"; + client.deleteWorkstationConfigAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void getWorkstationTest() throws Exception { + Workstation expectedResponse = + Workstation.newBuilder() + .setName( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setHost("host3208616") + .build(); + mockService.addResponse(expectedResponse); + + WorkstationName name = + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]"); + + Workstation actualResponse = client.getWorkstation(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getWorkstationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + WorkstationName name = + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]"); + client.getWorkstation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getWorkstationTest2() throws Exception { + Workstation expectedResponse = + Workstation.newBuilder() + .setName( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setHost("host3208616") + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-8004/locations/location-8004/workstationClusters/workstationCluster-8004/workstationConfigs/workstationConfig-8004/workstations/workstation-8004"; + + Workstation actualResponse = client.getWorkstation(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getWorkstationExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-8004/locations/location-8004/workstationClusters/workstationCluster-8004/workstationConfigs/workstationConfig-8004/workstations/workstation-8004"; + client.getWorkstation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listWorkstationsTest() throws Exception { + Workstation responsesElement = Workstation.newBuilder().build(); + ListWorkstationsResponse expectedResponse = + ListWorkstationsResponse.newBuilder() + .setNextPageToken("") + .addAllWorkstations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + WorkstationConfigName parent = + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]"); + + ListWorkstationsPagedResponse pagedListResponse = client.listWorkstations(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getWorkstationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listWorkstationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + WorkstationConfigName parent = + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]"); + client.listWorkstations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listWorkstationsTest2() throws Exception { + Workstation responsesElement = Workstation.newBuilder().build(); + ListWorkstationsResponse expectedResponse = + ListWorkstationsResponse.newBuilder() + .setNextPageToken("") + .addAllWorkstations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = + "projects/project-4265/locations/location-4265/workstationClusters/workstationCluster-4265/workstationConfigs/workstationConfig-4265"; + + ListWorkstationsPagedResponse pagedListResponse = client.listWorkstations(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getWorkstationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listWorkstationsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = + "projects/project-4265/locations/location-4265/workstationClusters/workstationCluster-4265/workstationConfigs/workstationConfig-4265"; + client.listWorkstations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listUsableWorkstationsTest() throws Exception { + Workstation responsesElement = Workstation.newBuilder().build(); + ListUsableWorkstationsResponse expectedResponse = + ListUsableWorkstationsResponse.newBuilder() + .setNextPageToken("") + .addAllWorkstations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + WorkstationConfigName parent = + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]"); + + ListUsableWorkstationsPagedResponse pagedListResponse = client.listUsableWorkstations(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getWorkstationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listUsableWorkstationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + WorkstationConfigName parent = + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]"); + client.listUsableWorkstations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listUsableWorkstationsTest2() throws Exception { + Workstation responsesElement = Workstation.newBuilder().build(); + ListUsableWorkstationsResponse expectedResponse = + ListUsableWorkstationsResponse.newBuilder() + .setNextPageToken("") + .addAllWorkstations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = + "projects/project-4265/locations/location-4265/workstationClusters/workstationCluster-4265/workstationConfigs/workstationConfig-4265"; + + ListUsableWorkstationsPagedResponse pagedListResponse = client.listUsableWorkstations(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getWorkstationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listUsableWorkstationsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = + "projects/project-4265/locations/location-4265/workstationClusters/workstationCluster-4265/workstationConfigs/workstationConfig-4265"; + client.listUsableWorkstations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createWorkstationTest() throws Exception { + Workstation expectedResponse = + Workstation.newBuilder() + .setName( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setHost("host3208616") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createWorkstationTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + WorkstationConfigName parent = + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]"); + Workstation workstation = Workstation.newBuilder().build(); + String workstationId = "workstationId560540030"; + + Workstation actualResponse = + client.createWorkstationAsync(parent, workstation, workstationId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createWorkstationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + WorkstationConfigName parent = + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]"); + Workstation workstation = Workstation.newBuilder().build(); + String workstationId = "workstationId560540030"; + client.createWorkstationAsync(parent, workstation, workstationId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createWorkstationTest2() throws Exception { + Workstation expectedResponse = + Workstation.newBuilder() + .setName( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setHost("host3208616") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createWorkstationTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = + "projects/project-4265/locations/location-4265/workstationClusters/workstationCluster-4265/workstationConfigs/workstationConfig-4265"; + Workstation workstation = Workstation.newBuilder().build(); + String workstationId = "workstationId560540030"; + + Workstation actualResponse = + client.createWorkstationAsync(parent, workstation, workstationId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createWorkstationExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = + "projects/project-4265/locations/location-4265/workstationClusters/workstationCluster-4265/workstationConfigs/workstationConfig-4265"; + Workstation workstation = Workstation.newBuilder().build(); + String workstationId = "workstationId560540030"; + client.createWorkstationAsync(parent, workstation, workstationId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void updateWorkstationTest() throws Exception { + Workstation expectedResponse = + Workstation.newBuilder() + .setName( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setHost("host3208616") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateWorkstationTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + Workstation workstation = + Workstation.newBuilder() + .setName( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setHost("host3208616") + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Workstation actualResponse = client.updateWorkstationAsync(workstation, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateWorkstationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Workstation workstation = + Workstation.newBuilder() + .setName( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setHost("host3208616") + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateWorkstationAsync(workstation, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteWorkstationTest() throws Exception { + Workstation expectedResponse = + Workstation.newBuilder() + .setName( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setHost("host3208616") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteWorkstationTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + WorkstationName name = + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]"); + + Workstation actualResponse = client.deleteWorkstationAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteWorkstationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + WorkstationName name = + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]"); + client.deleteWorkstationAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteWorkstationTest2() throws Exception { + Workstation expectedResponse = + Workstation.newBuilder() + .setName( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setHost("host3208616") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteWorkstationTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = + "projects/project-8004/locations/location-8004/workstationClusters/workstationCluster-8004/workstationConfigs/workstationConfig-8004/workstations/workstation-8004"; + + Workstation actualResponse = client.deleteWorkstationAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteWorkstationExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-8004/locations/location-8004/workstationClusters/workstationCluster-8004/workstationConfigs/workstationConfig-8004/workstations/workstation-8004"; + client.deleteWorkstationAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void startWorkstationTest() throws Exception { + Workstation expectedResponse = + Workstation.newBuilder() + .setName( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setHost("host3208616") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("startWorkstationTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + WorkstationName name = + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]"); + + Workstation actualResponse = client.startWorkstationAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void startWorkstationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + WorkstationName name = + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]"); + client.startWorkstationAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void startWorkstationTest2() throws Exception { + Workstation expectedResponse = + Workstation.newBuilder() + .setName( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setHost("host3208616") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("startWorkstationTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = + "projects/project-8004/locations/location-8004/workstationClusters/workstationCluster-8004/workstationConfigs/workstationConfig-8004/workstations/workstation-8004"; + + Workstation actualResponse = client.startWorkstationAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void startWorkstationExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-8004/locations/location-8004/workstationClusters/workstationCluster-8004/workstationConfigs/workstationConfig-8004/workstations/workstation-8004"; + client.startWorkstationAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void stopWorkstationTest() throws Exception { + Workstation expectedResponse = + Workstation.newBuilder() + .setName( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setHost("host3208616") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("stopWorkstationTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + WorkstationName name = + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]"); + + Workstation actualResponse = client.stopWorkstationAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void stopWorkstationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + WorkstationName name = + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]"); + client.stopWorkstationAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void stopWorkstationTest2() throws Exception { + Workstation expectedResponse = + Workstation.newBuilder() + .setName( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setHost("host3208616") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("stopWorkstationTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = + "projects/project-8004/locations/location-8004/workstationClusters/workstationCluster-8004/workstationConfigs/workstationConfig-8004/workstations/workstation-8004"; + + Workstation actualResponse = client.stopWorkstationAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void stopWorkstationExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-8004/locations/location-8004/workstationClusters/workstationCluster-8004/workstationConfigs/workstationConfig-8004/workstations/workstation-8004"; + client.stopWorkstationAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void generateAccessTokenTest() throws Exception { + GenerateAccessTokenResponse expectedResponse = + GenerateAccessTokenResponse.newBuilder() + .setAccessToken("accessToken-1042689291") + .setExpireTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + WorkstationName workstation = + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]"); + + GenerateAccessTokenResponse actualResponse = client.generateAccessToken(workstation); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void generateAccessTokenExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + WorkstationName workstation = + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]"); + client.generateAccessToken(workstation); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void generateAccessTokenTest2() throws Exception { + GenerateAccessTokenResponse expectedResponse = + GenerateAccessTokenResponse.newBuilder() + .setAccessToken("accessToken-1042689291") + .setExpireTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String workstation = + "projects/project-2916/locations/location-2916/workstationClusters/workstationCluster-2916/workstationConfigs/workstationConfig-2916/workstations/workstation-2916"; + + GenerateAccessTokenResponse actualResponse = client.generateAccessToken(workstation); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void generateAccessTokenExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String workstation = + "projects/project-2916/locations/location-2916/workstationClusters/workstationCluster-2916/workstationConfigs/workstationConfig-2916/workstations/workstation-2916"; + client.generateAccessToken(workstation); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-workstations/google-cloud-workstations/src/test/java/com/google/cloud/workstations/v1beta/WorkstationsClientTest.java b/java-workstations/google-cloud-workstations/src/test/java/com/google/cloud/workstations/v1beta/WorkstationsClientTest.java new file mode 100644 index 000000000000..15bfc78e4b88 --- /dev/null +++ b/java-workstations/google-cloud-workstations/src/test/java/com/google/cloud/workstations/v1beta/WorkstationsClientTest.java @@ -0,0 +1,2528 @@ +/* + * Copyright 2022 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.workstations.v1beta; + +import static com.google.cloud.workstations.v1beta.WorkstationsClient.ListUsableWorkstationConfigsPagedResponse; +import static com.google.cloud.workstations.v1beta.WorkstationsClient.ListUsableWorkstationsPagedResponse; +import static com.google.cloud.workstations.v1beta.WorkstationsClient.ListWorkstationClustersPagedResponse; +import static com.google.cloud.workstations.v1beta.WorkstationsClient.ListWorkstationConfigsPagedResponse; +import static com.google.cloud.workstations.v1beta.WorkstationsClient.ListWorkstationsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Duration; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import com.google.rpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class WorkstationsClientTest { + private static MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private static MockWorkstations mockWorkstations; + private LocalChannelProvider channelProvider; + private WorkstationsClient client; + + @BeforeClass + public static void startStaticServer() { + mockWorkstations = new MockWorkstations(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockWorkstations, mockLocations, mockIAMPolicy)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + WorkstationsSettings settings = + WorkstationsSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = WorkstationsClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void getWorkstationClusterTest() throws Exception { + WorkstationCluster expectedResponse = + WorkstationCluster.newBuilder() + .setName( + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setNetwork("network1843485230") + .setSubnetwork("subnetwork-1302785042") + .setPrivateClusterConfig(WorkstationCluster.PrivateClusterConfig.newBuilder().build()) + .setDegraded(true) + .addAllConditions(new ArrayList()) + .build(); + mockWorkstations.addResponse(expectedResponse); + + WorkstationClusterName name = + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]"); + + WorkstationCluster actualResponse = client.getWorkstationCluster(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWorkstations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetWorkstationClusterRequest actualRequest = + ((GetWorkstationClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getWorkstationClusterExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkstations.addException(exception); + + try { + WorkstationClusterName name = + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]"); + client.getWorkstationCluster(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getWorkstationClusterTest2() throws Exception { + WorkstationCluster expectedResponse = + WorkstationCluster.newBuilder() + .setName( + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setNetwork("network1843485230") + .setSubnetwork("subnetwork-1302785042") + .setPrivateClusterConfig(WorkstationCluster.PrivateClusterConfig.newBuilder().build()) + .setDegraded(true) + .addAllConditions(new ArrayList()) + .build(); + mockWorkstations.addResponse(expectedResponse); + + String name = "name3373707"; + + WorkstationCluster actualResponse = client.getWorkstationCluster(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWorkstations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetWorkstationClusterRequest actualRequest = + ((GetWorkstationClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getWorkstationClusterExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkstations.addException(exception); + + try { + String name = "name3373707"; + client.getWorkstationCluster(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listWorkstationClustersTest() throws Exception { + WorkstationCluster responsesElement = WorkstationCluster.newBuilder().build(); + ListWorkstationClustersResponse expectedResponse = + ListWorkstationClustersResponse.newBuilder() + .setNextPageToken("") + .addAllWorkstationClusters(Arrays.asList(responsesElement)) + .build(); + mockWorkstations.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListWorkstationClustersPagedResponse pagedListResponse = client.listWorkstationClusters(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getWorkstationClustersList().get(0), resources.get(0)); + + List actualRequests = mockWorkstations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListWorkstationClustersRequest actualRequest = + ((ListWorkstationClustersRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listWorkstationClustersExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkstations.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listWorkstationClusters(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listWorkstationClustersTest2() throws Exception { + WorkstationCluster responsesElement = WorkstationCluster.newBuilder().build(); + ListWorkstationClustersResponse expectedResponse = + ListWorkstationClustersResponse.newBuilder() + .setNextPageToken("") + .addAllWorkstationClusters(Arrays.asList(responsesElement)) + .build(); + mockWorkstations.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListWorkstationClustersPagedResponse pagedListResponse = client.listWorkstationClusters(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getWorkstationClustersList().get(0), resources.get(0)); + + List actualRequests = mockWorkstations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListWorkstationClustersRequest actualRequest = + ((ListWorkstationClustersRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listWorkstationClustersExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkstations.addException(exception); + + try { + String parent = "parent-995424086"; + client.listWorkstationClusters(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createWorkstationClusterTest() throws Exception { + WorkstationCluster expectedResponse = + WorkstationCluster.newBuilder() + .setName( + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setNetwork("network1843485230") + .setSubnetwork("subnetwork-1302785042") + .setPrivateClusterConfig(WorkstationCluster.PrivateClusterConfig.newBuilder().build()) + .setDegraded(true) + .addAllConditions(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createWorkstationClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockWorkstations.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + WorkstationCluster workstationCluster = WorkstationCluster.newBuilder().build(); + String workstationClusterId = "workstationClusterId351421170"; + + WorkstationCluster actualResponse = + client + .createWorkstationClusterAsync(parent, workstationCluster, workstationClusterId) + .get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWorkstations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateWorkstationClusterRequest actualRequest = + ((CreateWorkstationClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(workstationCluster, actualRequest.getWorkstationCluster()); + Assert.assertEquals(workstationClusterId, actualRequest.getWorkstationClusterId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createWorkstationClusterExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkstations.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + WorkstationCluster workstationCluster = WorkstationCluster.newBuilder().build(); + String workstationClusterId = "workstationClusterId351421170"; + client.createWorkstationClusterAsync(parent, workstationCluster, workstationClusterId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createWorkstationClusterTest2() throws Exception { + WorkstationCluster expectedResponse = + WorkstationCluster.newBuilder() + .setName( + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setNetwork("network1843485230") + .setSubnetwork("subnetwork-1302785042") + .setPrivateClusterConfig(WorkstationCluster.PrivateClusterConfig.newBuilder().build()) + .setDegraded(true) + .addAllConditions(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createWorkstationClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockWorkstations.addResponse(resultOperation); + + String parent = "parent-995424086"; + WorkstationCluster workstationCluster = WorkstationCluster.newBuilder().build(); + String workstationClusterId = "workstationClusterId351421170"; + + WorkstationCluster actualResponse = + client + .createWorkstationClusterAsync(parent, workstationCluster, workstationClusterId) + .get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWorkstations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateWorkstationClusterRequest actualRequest = + ((CreateWorkstationClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(workstationCluster, actualRequest.getWorkstationCluster()); + Assert.assertEquals(workstationClusterId, actualRequest.getWorkstationClusterId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createWorkstationClusterExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkstations.addException(exception); + + try { + String parent = "parent-995424086"; + WorkstationCluster workstationCluster = WorkstationCluster.newBuilder().build(); + String workstationClusterId = "workstationClusterId351421170"; + client.createWorkstationClusterAsync(parent, workstationCluster, workstationClusterId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void updateWorkstationClusterTest() throws Exception { + WorkstationCluster expectedResponse = + WorkstationCluster.newBuilder() + .setName( + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setNetwork("network1843485230") + .setSubnetwork("subnetwork-1302785042") + .setPrivateClusterConfig(WorkstationCluster.PrivateClusterConfig.newBuilder().build()) + .setDegraded(true) + .addAllConditions(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateWorkstationClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockWorkstations.addResponse(resultOperation); + + WorkstationCluster workstationCluster = WorkstationCluster.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + WorkstationCluster actualResponse = + client.updateWorkstationClusterAsync(workstationCluster, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWorkstations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateWorkstationClusterRequest actualRequest = + ((UpdateWorkstationClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(workstationCluster, actualRequest.getWorkstationCluster()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateWorkstationClusterExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkstations.addException(exception); + + try { + WorkstationCluster workstationCluster = WorkstationCluster.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateWorkstationClusterAsync(workstationCluster, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteWorkstationClusterTest() throws Exception { + WorkstationCluster expectedResponse = + WorkstationCluster.newBuilder() + .setName( + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setNetwork("network1843485230") + .setSubnetwork("subnetwork-1302785042") + .setPrivateClusterConfig(WorkstationCluster.PrivateClusterConfig.newBuilder().build()) + .setDegraded(true) + .addAllConditions(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteWorkstationClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockWorkstations.addResponse(resultOperation); + + WorkstationClusterName name = + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]"); + + WorkstationCluster actualResponse = client.deleteWorkstationClusterAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWorkstations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteWorkstationClusterRequest actualRequest = + ((DeleteWorkstationClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteWorkstationClusterExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkstations.addException(exception); + + try { + WorkstationClusterName name = + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]"); + client.deleteWorkstationClusterAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteWorkstationClusterTest2() throws Exception { + WorkstationCluster expectedResponse = + WorkstationCluster.newBuilder() + .setName( + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setNetwork("network1843485230") + .setSubnetwork("subnetwork-1302785042") + .setPrivateClusterConfig(WorkstationCluster.PrivateClusterConfig.newBuilder().build()) + .setDegraded(true) + .addAllConditions(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteWorkstationClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockWorkstations.addResponse(resultOperation); + + String name = "name3373707"; + + WorkstationCluster actualResponse = client.deleteWorkstationClusterAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWorkstations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteWorkstationClusterRequest actualRequest = + ((DeleteWorkstationClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteWorkstationClusterExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkstations.addException(exception); + + try { + String name = "name3373707"; + client.deleteWorkstationClusterAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void getWorkstationConfigTest() throws Exception { + WorkstationConfig expectedResponse = + WorkstationConfig.newBuilder() + .setName( + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setIdleTimeout(Duration.newBuilder().build()) + .setRunningTimeout(Duration.newBuilder().build()) + .setHost(WorkstationConfig.Host.newBuilder().build()) + .addAllPersistentDirectories(new ArrayList()) + .setContainer(WorkstationConfig.Container.newBuilder().build()) + .setEncryptionKey(WorkstationConfig.CustomerEncryptionKey.newBuilder().build()) + .setDegraded(true) + .addAllConditions(new ArrayList()) + .build(); + mockWorkstations.addResponse(expectedResponse); + + WorkstationConfigName name = + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]"); + + WorkstationConfig actualResponse = client.getWorkstationConfig(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWorkstations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetWorkstationConfigRequest actualRequest = + ((GetWorkstationConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getWorkstationConfigExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkstations.addException(exception); + + try { + WorkstationConfigName name = + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]"); + client.getWorkstationConfig(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getWorkstationConfigTest2() throws Exception { + WorkstationConfig expectedResponse = + WorkstationConfig.newBuilder() + .setName( + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setIdleTimeout(Duration.newBuilder().build()) + .setRunningTimeout(Duration.newBuilder().build()) + .setHost(WorkstationConfig.Host.newBuilder().build()) + .addAllPersistentDirectories(new ArrayList()) + .setContainer(WorkstationConfig.Container.newBuilder().build()) + .setEncryptionKey(WorkstationConfig.CustomerEncryptionKey.newBuilder().build()) + .setDegraded(true) + .addAllConditions(new ArrayList()) + .build(); + mockWorkstations.addResponse(expectedResponse); + + String name = "name3373707"; + + WorkstationConfig actualResponse = client.getWorkstationConfig(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWorkstations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetWorkstationConfigRequest actualRequest = + ((GetWorkstationConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getWorkstationConfigExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkstations.addException(exception); + + try { + String name = "name3373707"; + client.getWorkstationConfig(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listWorkstationConfigsTest() throws Exception { + WorkstationConfig responsesElement = WorkstationConfig.newBuilder().build(); + ListWorkstationConfigsResponse expectedResponse = + ListWorkstationConfigsResponse.newBuilder() + .setNextPageToken("") + .addAllWorkstationConfigs(Arrays.asList(responsesElement)) + .build(); + mockWorkstations.addResponse(expectedResponse); + + WorkstationClusterName parent = + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]"); + + ListWorkstationConfigsPagedResponse pagedListResponse = client.listWorkstationConfigs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getWorkstationConfigsList().get(0), resources.get(0)); + + List actualRequests = mockWorkstations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListWorkstationConfigsRequest actualRequest = + ((ListWorkstationConfigsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listWorkstationConfigsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkstations.addException(exception); + + try { + WorkstationClusterName parent = + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]"); + client.listWorkstationConfigs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listWorkstationConfigsTest2() throws Exception { + WorkstationConfig responsesElement = WorkstationConfig.newBuilder().build(); + ListWorkstationConfigsResponse expectedResponse = + ListWorkstationConfigsResponse.newBuilder() + .setNextPageToken("") + .addAllWorkstationConfigs(Arrays.asList(responsesElement)) + .build(); + mockWorkstations.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListWorkstationConfigsPagedResponse pagedListResponse = client.listWorkstationConfigs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getWorkstationConfigsList().get(0), resources.get(0)); + + List actualRequests = mockWorkstations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListWorkstationConfigsRequest actualRequest = + ((ListWorkstationConfigsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listWorkstationConfigsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkstations.addException(exception); + + try { + String parent = "parent-995424086"; + client.listWorkstationConfigs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listUsableWorkstationConfigsTest() throws Exception { + WorkstationConfig responsesElement = WorkstationConfig.newBuilder().build(); + ListUsableWorkstationConfigsResponse expectedResponse = + ListUsableWorkstationConfigsResponse.newBuilder() + .setNextPageToken("") + .addAllWorkstationConfigs(Arrays.asList(responsesElement)) + .build(); + mockWorkstations.addResponse(expectedResponse); + + WorkstationClusterName parent = + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]"); + + ListUsableWorkstationConfigsPagedResponse pagedListResponse = + client.listUsableWorkstationConfigs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getWorkstationConfigsList().get(0), resources.get(0)); + + List actualRequests = mockWorkstations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListUsableWorkstationConfigsRequest actualRequest = + ((ListUsableWorkstationConfigsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listUsableWorkstationConfigsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkstations.addException(exception); + + try { + WorkstationClusterName parent = + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]"); + client.listUsableWorkstationConfigs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listUsableWorkstationConfigsTest2() throws Exception { + WorkstationConfig responsesElement = WorkstationConfig.newBuilder().build(); + ListUsableWorkstationConfigsResponse expectedResponse = + ListUsableWorkstationConfigsResponse.newBuilder() + .setNextPageToken("") + .addAllWorkstationConfigs(Arrays.asList(responsesElement)) + .build(); + mockWorkstations.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListUsableWorkstationConfigsPagedResponse pagedListResponse = + client.listUsableWorkstationConfigs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getWorkstationConfigsList().get(0), resources.get(0)); + + List actualRequests = mockWorkstations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListUsableWorkstationConfigsRequest actualRequest = + ((ListUsableWorkstationConfigsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listUsableWorkstationConfigsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkstations.addException(exception); + + try { + String parent = "parent-995424086"; + client.listUsableWorkstationConfigs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createWorkstationConfigTest() throws Exception { + WorkstationConfig expectedResponse = + WorkstationConfig.newBuilder() + .setName( + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setIdleTimeout(Duration.newBuilder().build()) + .setRunningTimeout(Duration.newBuilder().build()) + .setHost(WorkstationConfig.Host.newBuilder().build()) + .addAllPersistentDirectories(new ArrayList()) + .setContainer(WorkstationConfig.Container.newBuilder().build()) + .setEncryptionKey(WorkstationConfig.CustomerEncryptionKey.newBuilder().build()) + .setDegraded(true) + .addAllConditions(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createWorkstationConfigTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockWorkstations.addResponse(resultOperation); + + WorkstationClusterName parent = + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]"); + WorkstationConfig workstationConfig = WorkstationConfig.newBuilder().build(); + String workstationConfigId = "workstationConfigId798542368"; + + WorkstationConfig actualResponse = + client.createWorkstationConfigAsync(parent, workstationConfig, workstationConfigId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWorkstations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateWorkstationConfigRequest actualRequest = + ((CreateWorkstationConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(workstationConfig, actualRequest.getWorkstationConfig()); + Assert.assertEquals(workstationConfigId, actualRequest.getWorkstationConfigId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createWorkstationConfigExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkstations.addException(exception); + + try { + WorkstationClusterName parent = + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]"); + WorkstationConfig workstationConfig = WorkstationConfig.newBuilder().build(); + String workstationConfigId = "workstationConfigId798542368"; + client.createWorkstationConfigAsync(parent, workstationConfig, workstationConfigId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createWorkstationConfigTest2() throws Exception { + WorkstationConfig expectedResponse = + WorkstationConfig.newBuilder() + .setName( + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setIdleTimeout(Duration.newBuilder().build()) + .setRunningTimeout(Duration.newBuilder().build()) + .setHost(WorkstationConfig.Host.newBuilder().build()) + .addAllPersistentDirectories(new ArrayList()) + .setContainer(WorkstationConfig.Container.newBuilder().build()) + .setEncryptionKey(WorkstationConfig.CustomerEncryptionKey.newBuilder().build()) + .setDegraded(true) + .addAllConditions(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createWorkstationConfigTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockWorkstations.addResponse(resultOperation); + + String parent = "parent-995424086"; + WorkstationConfig workstationConfig = WorkstationConfig.newBuilder().build(); + String workstationConfigId = "workstationConfigId798542368"; + + WorkstationConfig actualResponse = + client.createWorkstationConfigAsync(parent, workstationConfig, workstationConfigId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWorkstations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateWorkstationConfigRequest actualRequest = + ((CreateWorkstationConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(workstationConfig, actualRequest.getWorkstationConfig()); + Assert.assertEquals(workstationConfigId, actualRequest.getWorkstationConfigId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createWorkstationConfigExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkstations.addException(exception); + + try { + String parent = "parent-995424086"; + WorkstationConfig workstationConfig = WorkstationConfig.newBuilder().build(); + String workstationConfigId = "workstationConfigId798542368"; + client.createWorkstationConfigAsync(parent, workstationConfig, workstationConfigId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void updateWorkstationConfigTest() throws Exception { + WorkstationConfig expectedResponse = + WorkstationConfig.newBuilder() + .setName( + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setIdleTimeout(Duration.newBuilder().build()) + .setRunningTimeout(Duration.newBuilder().build()) + .setHost(WorkstationConfig.Host.newBuilder().build()) + .addAllPersistentDirectories(new ArrayList()) + .setContainer(WorkstationConfig.Container.newBuilder().build()) + .setEncryptionKey(WorkstationConfig.CustomerEncryptionKey.newBuilder().build()) + .setDegraded(true) + .addAllConditions(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateWorkstationConfigTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockWorkstations.addResponse(resultOperation); + + WorkstationConfig workstationConfig = WorkstationConfig.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + WorkstationConfig actualResponse = + client.updateWorkstationConfigAsync(workstationConfig, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWorkstations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateWorkstationConfigRequest actualRequest = + ((UpdateWorkstationConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(workstationConfig, actualRequest.getWorkstationConfig()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateWorkstationConfigExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkstations.addException(exception); + + try { + WorkstationConfig workstationConfig = WorkstationConfig.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateWorkstationConfigAsync(workstationConfig, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteWorkstationConfigTest() throws Exception { + WorkstationConfig expectedResponse = + WorkstationConfig.newBuilder() + .setName( + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setIdleTimeout(Duration.newBuilder().build()) + .setRunningTimeout(Duration.newBuilder().build()) + .setHost(WorkstationConfig.Host.newBuilder().build()) + .addAllPersistentDirectories(new ArrayList()) + .setContainer(WorkstationConfig.Container.newBuilder().build()) + .setEncryptionKey(WorkstationConfig.CustomerEncryptionKey.newBuilder().build()) + .setDegraded(true) + .addAllConditions(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteWorkstationConfigTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockWorkstations.addResponse(resultOperation); + + WorkstationConfigName name = + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]"); + + WorkstationConfig actualResponse = client.deleteWorkstationConfigAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWorkstations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteWorkstationConfigRequest actualRequest = + ((DeleteWorkstationConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteWorkstationConfigExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkstations.addException(exception); + + try { + WorkstationConfigName name = + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]"); + client.deleteWorkstationConfigAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteWorkstationConfigTest2() throws Exception { + WorkstationConfig expectedResponse = + WorkstationConfig.newBuilder() + .setName( + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setIdleTimeout(Duration.newBuilder().build()) + .setRunningTimeout(Duration.newBuilder().build()) + .setHost(WorkstationConfig.Host.newBuilder().build()) + .addAllPersistentDirectories(new ArrayList()) + .setContainer(WorkstationConfig.Container.newBuilder().build()) + .setEncryptionKey(WorkstationConfig.CustomerEncryptionKey.newBuilder().build()) + .setDegraded(true) + .addAllConditions(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteWorkstationConfigTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockWorkstations.addResponse(resultOperation); + + String name = "name3373707"; + + WorkstationConfig actualResponse = client.deleteWorkstationConfigAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWorkstations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteWorkstationConfigRequest actualRequest = + ((DeleteWorkstationConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteWorkstationConfigExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkstations.addException(exception); + + try { + String name = "name3373707"; + client.deleteWorkstationConfigAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void getWorkstationTest() throws Exception { + Workstation expectedResponse = + Workstation.newBuilder() + .setName( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setHost("host3208616") + .build(); + mockWorkstations.addResponse(expectedResponse); + + WorkstationName name = + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]"); + + Workstation actualResponse = client.getWorkstation(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWorkstations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetWorkstationRequest actualRequest = ((GetWorkstationRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getWorkstationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkstations.addException(exception); + + try { + WorkstationName name = + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]"); + client.getWorkstation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getWorkstationTest2() throws Exception { + Workstation expectedResponse = + Workstation.newBuilder() + .setName( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setHost("host3208616") + .build(); + mockWorkstations.addResponse(expectedResponse); + + String name = "name3373707"; + + Workstation actualResponse = client.getWorkstation(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWorkstations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetWorkstationRequest actualRequest = ((GetWorkstationRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getWorkstationExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkstations.addException(exception); + + try { + String name = "name3373707"; + client.getWorkstation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listWorkstationsTest() throws Exception { + Workstation responsesElement = Workstation.newBuilder().build(); + ListWorkstationsResponse expectedResponse = + ListWorkstationsResponse.newBuilder() + .setNextPageToken("") + .addAllWorkstations(Arrays.asList(responsesElement)) + .build(); + mockWorkstations.addResponse(expectedResponse); + + WorkstationConfigName parent = + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]"); + + ListWorkstationsPagedResponse pagedListResponse = client.listWorkstations(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getWorkstationsList().get(0), resources.get(0)); + + List actualRequests = mockWorkstations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListWorkstationsRequest actualRequest = ((ListWorkstationsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listWorkstationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkstations.addException(exception); + + try { + WorkstationConfigName parent = + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]"); + client.listWorkstations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listWorkstationsTest2() throws Exception { + Workstation responsesElement = Workstation.newBuilder().build(); + ListWorkstationsResponse expectedResponse = + ListWorkstationsResponse.newBuilder() + .setNextPageToken("") + .addAllWorkstations(Arrays.asList(responsesElement)) + .build(); + mockWorkstations.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListWorkstationsPagedResponse pagedListResponse = client.listWorkstations(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getWorkstationsList().get(0), resources.get(0)); + + List actualRequests = mockWorkstations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListWorkstationsRequest actualRequest = ((ListWorkstationsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listWorkstationsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkstations.addException(exception); + + try { + String parent = "parent-995424086"; + client.listWorkstations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listUsableWorkstationsTest() throws Exception { + Workstation responsesElement = Workstation.newBuilder().build(); + ListUsableWorkstationsResponse expectedResponse = + ListUsableWorkstationsResponse.newBuilder() + .setNextPageToken("") + .addAllWorkstations(Arrays.asList(responsesElement)) + .build(); + mockWorkstations.addResponse(expectedResponse); + + WorkstationConfigName parent = + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]"); + + ListUsableWorkstationsPagedResponse pagedListResponse = client.listUsableWorkstations(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getWorkstationsList().get(0), resources.get(0)); + + List actualRequests = mockWorkstations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListUsableWorkstationsRequest actualRequest = + ((ListUsableWorkstationsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listUsableWorkstationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkstations.addException(exception); + + try { + WorkstationConfigName parent = + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]"); + client.listUsableWorkstations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listUsableWorkstationsTest2() throws Exception { + Workstation responsesElement = Workstation.newBuilder().build(); + ListUsableWorkstationsResponse expectedResponse = + ListUsableWorkstationsResponse.newBuilder() + .setNextPageToken("") + .addAllWorkstations(Arrays.asList(responsesElement)) + .build(); + mockWorkstations.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListUsableWorkstationsPagedResponse pagedListResponse = client.listUsableWorkstations(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getWorkstationsList().get(0), resources.get(0)); + + List actualRequests = mockWorkstations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListUsableWorkstationsRequest actualRequest = + ((ListUsableWorkstationsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listUsableWorkstationsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkstations.addException(exception); + + try { + String parent = "parent-995424086"; + client.listUsableWorkstations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createWorkstationTest() throws Exception { + Workstation expectedResponse = + Workstation.newBuilder() + .setName( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setHost("host3208616") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createWorkstationTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockWorkstations.addResponse(resultOperation); + + WorkstationConfigName parent = + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]"); + Workstation workstation = Workstation.newBuilder().build(); + String workstationId = "workstationId560540030"; + + Workstation actualResponse = + client.createWorkstationAsync(parent, workstation, workstationId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWorkstations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateWorkstationRequest actualRequest = ((CreateWorkstationRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(workstation, actualRequest.getWorkstation()); + Assert.assertEquals(workstationId, actualRequest.getWorkstationId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createWorkstationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkstations.addException(exception); + + try { + WorkstationConfigName parent = + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]"); + Workstation workstation = Workstation.newBuilder().build(); + String workstationId = "workstationId560540030"; + client.createWorkstationAsync(parent, workstation, workstationId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createWorkstationTest2() throws Exception { + Workstation expectedResponse = + Workstation.newBuilder() + .setName( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setHost("host3208616") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createWorkstationTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockWorkstations.addResponse(resultOperation); + + String parent = "parent-995424086"; + Workstation workstation = Workstation.newBuilder().build(); + String workstationId = "workstationId560540030"; + + Workstation actualResponse = + client.createWorkstationAsync(parent, workstation, workstationId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWorkstations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateWorkstationRequest actualRequest = ((CreateWorkstationRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(workstation, actualRequest.getWorkstation()); + Assert.assertEquals(workstationId, actualRequest.getWorkstationId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createWorkstationExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkstations.addException(exception); + + try { + String parent = "parent-995424086"; + Workstation workstation = Workstation.newBuilder().build(); + String workstationId = "workstationId560540030"; + client.createWorkstationAsync(parent, workstation, workstationId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void updateWorkstationTest() throws Exception { + Workstation expectedResponse = + Workstation.newBuilder() + .setName( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setHost("host3208616") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateWorkstationTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockWorkstations.addResponse(resultOperation); + + Workstation workstation = Workstation.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Workstation actualResponse = client.updateWorkstationAsync(workstation, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWorkstations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateWorkstationRequest actualRequest = ((UpdateWorkstationRequest) actualRequests.get(0)); + + Assert.assertEquals(workstation, actualRequest.getWorkstation()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateWorkstationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkstations.addException(exception); + + try { + Workstation workstation = Workstation.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateWorkstationAsync(workstation, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteWorkstationTest() throws Exception { + Workstation expectedResponse = + Workstation.newBuilder() + .setName( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setHost("host3208616") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteWorkstationTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockWorkstations.addResponse(resultOperation); + + WorkstationName name = + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]"); + + Workstation actualResponse = client.deleteWorkstationAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWorkstations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteWorkstationRequest actualRequest = ((DeleteWorkstationRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteWorkstationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkstations.addException(exception); + + try { + WorkstationName name = + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]"); + client.deleteWorkstationAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteWorkstationTest2() throws Exception { + Workstation expectedResponse = + Workstation.newBuilder() + .setName( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setHost("host3208616") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteWorkstationTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockWorkstations.addResponse(resultOperation); + + String name = "name3373707"; + + Workstation actualResponse = client.deleteWorkstationAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWorkstations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteWorkstationRequest actualRequest = ((DeleteWorkstationRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteWorkstationExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkstations.addException(exception); + + try { + String name = "name3373707"; + client.deleteWorkstationAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void startWorkstationTest() throws Exception { + Workstation expectedResponse = + Workstation.newBuilder() + .setName( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setHost("host3208616") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("startWorkstationTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockWorkstations.addResponse(resultOperation); + + WorkstationName name = + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]"); + + Workstation actualResponse = client.startWorkstationAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWorkstations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + StartWorkstationRequest actualRequest = ((StartWorkstationRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void startWorkstationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkstations.addException(exception); + + try { + WorkstationName name = + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]"); + client.startWorkstationAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void startWorkstationTest2() throws Exception { + Workstation expectedResponse = + Workstation.newBuilder() + .setName( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setHost("host3208616") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("startWorkstationTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockWorkstations.addResponse(resultOperation); + + String name = "name3373707"; + + Workstation actualResponse = client.startWorkstationAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWorkstations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + StartWorkstationRequest actualRequest = ((StartWorkstationRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void startWorkstationExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkstations.addException(exception); + + try { + String name = "name3373707"; + client.startWorkstationAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void stopWorkstationTest() throws Exception { + Workstation expectedResponse = + Workstation.newBuilder() + .setName( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setHost("host3208616") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("stopWorkstationTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockWorkstations.addResponse(resultOperation); + + WorkstationName name = + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]"); + + Workstation actualResponse = client.stopWorkstationAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWorkstations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + StopWorkstationRequest actualRequest = ((StopWorkstationRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void stopWorkstationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkstations.addException(exception); + + try { + WorkstationName name = + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]"); + client.stopWorkstationAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void stopWorkstationTest2() throws Exception { + Workstation expectedResponse = + Workstation.newBuilder() + .setName( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .setHost("host3208616") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("stopWorkstationTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockWorkstations.addResponse(resultOperation); + + String name = "name3373707"; + + Workstation actualResponse = client.stopWorkstationAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWorkstations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + StopWorkstationRequest actualRequest = ((StopWorkstationRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void stopWorkstationExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkstations.addException(exception); + + try { + String name = "name3373707"; + client.stopWorkstationAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void generateAccessTokenTest() throws Exception { + GenerateAccessTokenResponse expectedResponse = + GenerateAccessTokenResponse.newBuilder() + .setAccessToken("accessToken-1042689291") + .setExpireTime(Timestamp.newBuilder().build()) + .build(); + mockWorkstations.addResponse(expectedResponse); + + WorkstationName workstation = + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]"); + + GenerateAccessTokenResponse actualResponse = client.generateAccessToken(workstation); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWorkstations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GenerateAccessTokenRequest actualRequest = ((GenerateAccessTokenRequest) actualRequests.get(0)); + + Assert.assertEquals(workstation.toString(), actualRequest.getWorkstation()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void generateAccessTokenExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkstations.addException(exception); + + try { + WorkstationName workstation = + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]"); + client.generateAccessToken(workstation); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void generateAccessTokenTest2() throws Exception { + GenerateAccessTokenResponse expectedResponse = + GenerateAccessTokenResponse.newBuilder() + .setAccessToken("accessToken-1042689291") + .setExpireTime(Timestamp.newBuilder().build()) + .build(); + mockWorkstations.addResponse(expectedResponse); + + String workstation = "workstation581588227"; + + GenerateAccessTokenResponse actualResponse = client.generateAccessToken(workstation); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWorkstations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GenerateAccessTokenRequest actualRequest = ((GenerateAccessTokenRequest) actualRequests.get(0)); + + Assert.assertEquals(workstation, actualRequest.getWorkstation()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void generateAccessTokenExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkstations.addException(exception); + + try { + String workstation = "workstation581588227"; + client.generateAccessToken(workstation); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockIAMPolicy.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-workstations/grpc-google-cloud-workstations-v1beta/pom.xml b/java-workstations/grpc-google-cloud-workstations-v1beta/pom.xml new file mode 100644 index 000000000000..ca29c1a30a60 --- /dev/null +++ b/java-workstations/grpc-google-cloud-workstations-v1beta/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-workstations-v1beta + 0.0.1-SNAPSHOT + grpc-google-cloud-workstations-v1beta + GRPC library for google-cloud-workstations + + com.google.cloud + google-cloud-workstations-parent + 0.0.1-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-cloud-workstations-v1beta + + + com.google.guava + guava + + + \ No newline at end of file diff --git a/java-workstations/grpc-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/WorkstationsGrpc.java b/java-workstations/grpc-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/WorkstationsGrpc.java new file mode 100644 index 000000000000..ee57f0d9be96 --- /dev/null +++ b/java-workstations/grpc-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/WorkstationsGrpc.java @@ -0,0 +1,2681 @@ +/* + * Copyright 2020 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.workstations.v1beta; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service for interacting with Cloud Workstations.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/workstations/v1beta/workstations.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class WorkstationsGrpc { + + private WorkstationsGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.workstations.v1beta.Workstations"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest, + com.google.cloud.workstations.v1beta.WorkstationCluster> + getGetWorkstationClusterMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetWorkstationCluster", + requestType = com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest.class, + responseType = com.google.cloud.workstations.v1beta.WorkstationCluster.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest, + com.google.cloud.workstations.v1beta.WorkstationCluster> + getGetWorkstationClusterMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest, + com.google.cloud.workstations.v1beta.WorkstationCluster> + getGetWorkstationClusterMethod; + if ((getGetWorkstationClusterMethod = WorkstationsGrpc.getGetWorkstationClusterMethod) + == null) { + synchronized (WorkstationsGrpc.class) { + if ((getGetWorkstationClusterMethod = WorkstationsGrpc.getGetWorkstationClusterMethod) + == null) { + WorkstationsGrpc.getGetWorkstationClusterMethod = + getGetWorkstationClusterMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetWorkstationCluster")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workstations.v1beta.WorkstationCluster + .getDefaultInstance())) + .setSchemaDescriptor( + new WorkstationsMethodDescriptorSupplier("GetWorkstationCluster")) + .build(); + } + } + } + return getGetWorkstationClusterMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest, + com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse> + getListWorkstationClustersMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListWorkstationClusters", + requestType = com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest.class, + responseType = com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest, + com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse> + getListWorkstationClustersMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest, + com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse> + getListWorkstationClustersMethod; + if ((getListWorkstationClustersMethod = WorkstationsGrpc.getListWorkstationClustersMethod) + == null) { + synchronized (WorkstationsGrpc.class) { + if ((getListWorkstationClustersMethod = WorkstationsGrpc.getListWorkstationClustersMethod) + == null) { + WorkstationsGrpc.getListWorkstationClustersMethod = + getListWorkstationClustersMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListWorkstationClusters")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new WorkstationsMethodDescriptorSupplier("ListWorkstationClusters")) + .build(); + } + } + } + return getListWorkstationClustersMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest, + com.google.longrunning.Operation> + getCreateWorkstationClusterMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateWorkstationCluster", + requestType = com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest, + com.google.longrunning.Operation> + getCreateWorkstationClusterMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest, + com.google.longrunning.Operation> + getCreateWorkstationClusterMethod; + if ((getCreateWorkstationClusterMethod = WorkstationsGrpc.getCreateWorkstationClusterMethod) + == null) { + synchronized (WorkstationsGrpc.class) { + if ((getCreateWorkstationClusterMethod = WorkstationsGrpc.getCreateWorkstationClusterMethod) + == null) { + WorkstationsGrpc.getCreateWorkstationClusterMethod = + getCreateWorkstationClusterMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "CreateWorkstationCluster")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new WorkstationsMethodDescriptorSupplier("CreateWorkstationCluster")) + .build(); + } + } + } + return getCreateWorkstationClusterMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest, + com.google.longrunning.Operation> + getUpdateWorkstationClusterMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateWorkstationCluster", + requestType = com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest, + com.google.longrunning.Operation> + getUpdateWorkstationClusterMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest, + com.google.longrunning.Operation> + getUpdateWorkstationClusterMethod; + if ((getUpdateWorkstationClusterMethod = WorkstationsGrpc.getUpdateWorkstationClusterMethod) + == null) { + synchronized (WorkstationsGrpc.class) { + if ((getUpdateWorkstationClusterMethod = WorkstationsGrpc.getUpdateWorkstationClusterMethod) + == null) { + WorkstationsGrpc.getUpdateWorkstationClusterMethod = + getUpdateWorkstationClusterMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "UpdateWorkstationCluster")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new WorkstationsMethodDescriptorSupplier("UpdateWorkstationCluster")) + .build(); + } + } + } + return getUpdateWorkstationClusterMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest, + com.google.longrunning.Operation> + getDeleteWorkstationClusterMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteWorkstationCluster", + requestType = com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest, + com.google.longrunning.Operation> + getDeleteWorkstationClusterMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest, + com.google.longrunning.Operation> + getDeleteWorkstationClusterMethod; + if ((getDeleteWorkstationClusterMethod = WorkstationsGrpc.getDeleteWorkstationClusterMethod) + == null) { + synchronized (WorkstationsGrpc.class) { + if ((getDeleteWorkstationClusterMethod = WorkstationsGrpc.getDeleteWorkstationClusterMethod) + == null) { + WorkstationsGrpc.getDeleteWorkstationClusterMethod = + getDeleteWorkstationClusterMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "DeleteWorkstationCluster")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new WorkstationsMethodDescriptorSupplier("DeleteWorkstationCluster")) + .build(); + } + } + } + return getDeleteWorkstationClusterMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest, + com.google.cloud.workstations.v1beta.WorkstationConfig> + getGetWorkstationConfigMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetWorkstationConfig", + requestType = com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest.class, + responseType = com.google.cloud.workstations.v1beta.WorkstationConfig.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest, + com.google.cloud.workstations.v1beta.WorkstationConfig> + getGetWorkstationConfigMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest, + com.google.cloud.workstations.v1beta.WorkstationConfig> + getGetWorkstationConfigMethod; + if ((getGetWorkstationConfigMethod = WorkstationsGrpc.getGetWorkstationConfigMethod) == null) { + synchronized (WorkstationsGrpc.class) { + if ((getGetWorkstationConfigMethod = WorkstationsGrpc.getGetWorkstationConfigMethod) + == null) { + WorkstationsGrpc.getGetWorkstationConfigMethod = + getGetWorkstationConfigMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetWorkstationConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workstations.v1beta.WorkstationConfig + .getDefaultInstance())) + .setSchemaDescriptor( + new WorkstationsMethodDescriptorSupplier("GetWorkstationConfig")) + .build(); + } + } + } + return getGetWorkstationConfigMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest, + com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse> + getListWorkstationConfigsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListWorkstationConfigs", + requestType = com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest.class, + responseType = com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest, + com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse> + getListWorkstationConfigsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest, + com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse> + getListWorkstationConfigsMethod; + if ((getListWorkstationConfigsMethod = WorkstationsGrpc.getListWorkstationConfigsMethod) + == null) { + synchronized (WorkstationsGrpc.class) { + if ((getListWorkstationConfigsMethod = WorkstationsGrpc.getListWorkstationConfigsMethod) + == null) { + WorkstationsGrpc.getListWorkstationConfigsMethod = + getListWorkstationConfigsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListWorkstationConfigs")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new WorkstationsMethodDescriptorSupplier("ListWorkstationConfigs")) + .build(); + } + } + } + return getListWorkstationConfigsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest, + com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse> + getListUsableWorkstationConfigsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListUsableWorkstationConfigs", + requestType = com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest.class, + responseType = + com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest, + com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse> + getListUsableWorkstationConfigsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest, + com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse> + getListUsableWorkstationConfigsMethod; + if ((getListUsableWorkstationConfigsMethod = + WorkstationsGrpc.getListUsableWorkstationConfigsMethod) + == null) { + synchronized (WorkstationsGrpc.class) { + if ((getListUsableWorkstationConfigsMethod = + WorkstationsGrpc.getListUsableWorkstationConfigsMethod) + == null) { + WorkstationsGrpc.getListUsableWorkstationConfigsMethod = + getListUsableWorkstationConfigsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListUsableWorkstationConfigs")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workstations.v1beta + .ListUsableWorkstationConfigsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workstations.v1beta + .ListUsableWorkstationConfigsResponse.getDefaultInstance())) + .setSchemaDescriptor( + new WorkstationsMethodDescriptorSupplier("ListUsableWorkstationConfigs")) + .build(); + } + } + } + return getListUsableWorkstationConfigsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest, + com.google.longrunning.Operation> + getCreateWorkstationConfigMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateWorkstationConfig", + requestType = com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest, + com.google.longrunning.Operation> + getCreateWorkstationConfigMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest, + com.google.longrunning.Operation> + getCreateWorkstationConfigMethod; + if ((getCreateWorkstationConfigMethod = WorkstationsGrpc.getCreateWorkstationConfigMethod) + == null) { + synchronized (WorkstationsGrpc.class) { + if ((getCreateWorkstationConfigMethod = WorkstationsGrpc.getCreateWorkstationConfigMethod) + == null) { + WorkstationsGrpc.getCreateWorkstationConfigMethod = + getCreateWorkstationConfigMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "CreateWorkstationConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new WorkstationsMethodDescriptorSupplier("CreateWorkstationConfig")) + .build(); + } + } + } + return getCreateWorkstationConfigMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest, + com.google.longrunning.Operation> + getUpdateWorkstationConfigMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateWorkstationConfig", + requestType = com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest, + com.google.longrunning.Operation> + getUpdateWorkstationConfigMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest, + com.google.longrunning.Operation> + getUpdateWorkstationConfigMethod; + if ((getUpdateWorkstationConfigMethod = WorkstationsGrpc.getUpdateWorkstationConfigMethod) + == null) { + synchronized (WorkstationsGrpc.class) { + if ((getUpdateWorkstationConfigMethod = WorkstationsGrpc.getUpdateWorkstationConfigMethod) + == null) { + WorkstationsGrpc.getUpdateWorkstationConfigMethod = + getUpdateWorkstationConfigMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "UpdateWorkstationConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new WorkstationsMethodDescriptorSupplier("UpdateWorkstationConfig")) + .build(); + } + } + } + return getUpdateWorkstationConfigMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest, + com.google.longrunning.Operation> + getDeleteWorkstationConfigMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteWorkstationConfig", + requestType = com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest, + com.google.longrunning.Operation> + getDeleteWorkstationConfigMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest, + com.google.longrunning.Operation> + getDeleteWorkstationConfigMethod; + if ((getDeleteWorkstationConfigMethod = WorkstationsGrpc.getDeleteWorkstationConfigMethod) + == null) { + synchronized (WorkstationsGrpc.class) { + if ((getDeleteWorkstationConfigMethod = WorkstationsGrpc.getDeleteWorkstationConfigMethod) + == null) { + WorkstationsGrpc.getDeleteWorkstationConfigMethod = + getDeleteWorkstationConfigMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "DeleteWorkstationConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new WorkstationsMethodDescriptorSupplier("DeleteWorkstationConfig")) + .build(); + } + } + } + return getDeleteWorkstationConfigMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.GetWorkstationRequest, + com.google.cloud.workstations.v1beta.Workstation> + getGetWorkstationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetWorkstation", + requestType = com.google.cloud.workstations.v1beta.GetWorkstationRequest.class, + responseType = com.google.cloud.workstations.v1beta.Workstation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.GetWorkstationRequest, + com.google.cloud.workstations.v1beta.Workstation> + getGetWorkstationMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.GetWorkstationRequest, + com.google.cloud.workstations.v1beta.Workstation> + getGetWorkstationMethod; + if ((getGetWorkstationMethod = WorkstationsGrpc.getGetWorkstationMethod) == null) { + synchronized (WorkstationsGrpc.class) { + if ((getGetWorkstationMethod = WorkstationsGrpc.getGetWorkstationMethod) == null) { + WorkstationsGrpc.getGetWorkstationMethod = + getGetWorkstationMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetWorkstation")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workstations.v1beta.GetWorkstationRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workstations.v1beta.Workstation + .getDefaultInstance())) + .setSchemaDescriptor( + new WorkstationsMethodDescriptorSupplier("GetWorkstation")) + .build(); + } + } + } + return getGetWorkstationMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.ListWorkstationsRequest, + com.google.cloud.workstations.v1beta.ListWorkstationsResponse> + getListWorkstationsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListWorkstations", + requestType = com.google.cloud.workstations.v1beta.ListWorkstationsRequest.class, + responseType = com.google.cloud.workstations.v1beta.ListWorkstationsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.ListWorkstationsRequest, + com.google.cloud.workstations.v1beta.ListWorkstationsResponse> + getListWorkstationsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.ListWorkstationsRequest, + com.google.cloud.workstations.v1beta.ListWorkstationsResponse> + getListWorkstationsMethod; + if ((getListWorkstationsMethod = WorkstationsGrpc.getListWorkstationsMethod) == null) { + synchronized (WorkstationsGrpc.class) { + if ((getListWorkstationsMethod = WorkstationsGrpc.getListWorkstationsMethod) == null) { + WorkstationsGrpc.getListWorkstationsMethod = + getListWorkstationsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListWorkstations")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workstations.v1beta.ListWorkstationsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workstations.v1beta.ListWorkstationsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new WorkstationsMethodDescriptorSupplier("ListWorkstations")) + .build(); + } + } + } + return getListWorkstationsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest, + com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse> + getListUsableWorkstationsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListUsableWorkstations", + requestType = com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest.class, + responseType = com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest, + com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse> + getListUsableWorkstationsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest, + com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse> + getListUsableWorkstationsMethod; + if ((getListUsableWorkstationsMethod = WorkstationsGrpc.getListUsableWorkstationsMethod) + == null) { + synchronized (WorkstationsGrpc.class) { + if ((getListUsableWorkstationsMethod = WorkstationsGrpc.getListUsableWorkstationsMethod) + == null) { + WorkstationsGrpc.getListUsableWorkstationsMethod = + getListUsableWorkstationsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListUsableWorkstations")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new WorkstationsMethodDescriptorSupplier("ListUsableWorkstations")) + .build(); + } + } + } + return getListUsableWorkstationsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.CreateWorkstationRequest, + com.google.longrunning.Operation> + getCreateWorkstationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateWorkstation", + requestType = com.google.cloud.workstations.v1beta.CreateWorkstationRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.CreateWorkstationRequest, + com.google.longrunning.Operation> + getCreateWorkstationMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.CreateWorkstationRequest, + com.google.longrunning.Operation> + getCreateWorkstationMethod; + if ((getCreateWorkstationMethod = WorkstationsGrpc.getCreateWorkstationMethod) == null) { + synchronized (WorkstationsGrpc.class) { + if ((getCreateWorkstationMethod = WorkstationsGrpc.getCreateWorkstationMethod) == null) { + WorkstationsGrpc.getCreateWorkstationMethod = + getCreateWorkstationMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateWorkstation")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workstations.v1beta.CreateWorkstationRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new WorkstationsMethodDescriptorSupplier("CreateWorkstation")) + .build(); + } + } + } + return getCreateWorkstationMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.UpdateWorkstationRequest, + com.google.longrunning.Operation> + getUpdateWorkstationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateWorkstation", + requestType = com.google.cloud.workstations.v1beta.UpdateWorkstationRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.UpdateWorkstationRequest, + com.google.longrunning.Operation> + getUpdateWorkstationMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.UpdateWorkstationRequest, + com.google.longrunning.Operation> + getUpdateWorkstationMethod; + if ((getUpdateWorkstationMethod = WorkstationsGrpc.getUpdateWorkstationMethod) == null) { + synchronized (WorkstationsGrpc.class) { + if ((getUpdateWorkstationMethod = WorkstationsGrpc.getUpdateWorkstationMethod) == null) { + WorkstationsGrpc.getUpdateWorkstationMethod = + getUpdateWorkstationMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateWorkstation")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workstations.v1beta.UpdateWorkstationRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new WorkstationsMethodDescriptorSupplier("UpdateWorkstation")) + .build(); + } + } + } + return getUpdateWorkstationMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.DeleteWorkstationRequest, + com.google.longrunning.Operation> + getDeleteWorkstationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteWorkstation", + requestType = com.google.cloud.workstations.v1beta.DeleteWorkstationRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.DeleteWorkstationRequest, + com.google.longrunning.Operation> + getDeleteWorkstationMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.DeleteWorkstationRequest, + com.google.longrunning.Operation> + getDeleteWorkstationMethod; + if ((getDeleteWorkstationMethod = WorkstationsGrpc.getDeleteWorkstationMethod) == null) { + synchronized (WorkstationsGrpc.class) { + if ((getDeleteWorkstationMethod = WorkstationsGrpc.getDeleteWorkstationMethod) == null) { + WorkstationsGrpc.getDeleteWorkstationMethod = + getDeleteWorkstationMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteWorkstation")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workstations.v1beta.DeleteWorkstationRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new WorkstationsMethodDescriptorSupplier("DeleteWorkstation")) + .build(); + } + } + } + return getDeleteWorkstationMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.StartWorkstationRequest, + com.google.longrunning.Operation> + getStartWorkstationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "StartWorkstation", + requestType = com.google.cloud.workstations.v1beta.StartWorkstationRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.StartWorkstationRequest, + com.google.longrunning.Operation> + getStartWorkstationMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.StartWorkstationRequest, + com.google.longrunning.Operation> + getStartWorkstationMethod; + if ((getStartWorkstationMethod = WorkstationsGrpc.getStartWorkstationMethod) == null) { + synchronized (WorkstationsGrpc.class) { + if ((getStartWorkstationMethod = WorkstationsGrpc.getStartWorkstationMethod) == null) { + WorkstationsGrpc.getStartWorkstationMethod = + getStartWorkstationMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StartWorkstation")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workstations.v1beta.StartWorkstationRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new WorkstationsMethodDescriptorSupplier("StartWorkstation")) + .build(); + } + } + } + return getStartWorkstationMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.StopWorkstationRequest, + com.google.longrunning.Operation> + getStopWorkstationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "StopWorkstation", + requestType = com.google.cloud.workstations.v1beta.StopWorkstationRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.StopWorkstationRequest, + com.google.longrunning.Operation> + getStopWorkstationMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.StopWorkstationRequest, + com.google.longrunning.Operation> + getStopWorkstationMethod; + if ((getStopWorkstationMethod = WorkstationsGrpc.getStopWorkstationMethod) == null) { + synchronized (WorkstationsGrpc.class) { + if ((getStopWorkstationMethod = WorkstationsGrpc.getStopWorkstationMethod) == null) { + WorkstationsGrpc.getStopWorkstationMethod = + getStopWorkstationMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StopWorkstation")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workstations.v1beta.StopWorkstationRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new WorkstationsMethodDescriptorSupplier("StopWorkstation")) + .build(); + } + } + } + return getStopWorkstationMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest, + com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse> + getGenerateAccessTokenMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GenerateAccessToken", + requestType = com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest.class, + responseType = com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest, + com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse> + getGenerateAccessTokenMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest, + com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse> + getGenerateAccessTokenMethod; + if ((getGenerateAccessTokenMethod = WorkstationsGrpc.getGenerateAccessTokenMethod) == null) { + synchronized (WorkstationsGrpc.class) { + if ((getGenerateAccessTokenMethod = WorkstationsGrpc.getGenerateAccessTokenMethod) + == null) { + WorkstationsGrpc.getGenerateAccessTokenMethod = + getGenerateAccessTokenMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GenerateAccessToken")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new WorkstationsMethodDescriptorSupplier("GenerateAccessToken")) + .build(); + } + } + } + return getGenerateAccessTokenMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static WorkstationsStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public WorkstationsStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new WorkstationsStub(channel, callOptions); + } + }; + return WorkstationsStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static WorkstationsBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public WorkstationsBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new WorkstationsBlockingStub(channel, callOptions); + } + }; + return WorkstationsBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static WorkstationsFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public WorkstationsFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new WorkstationsFutureStub(channel, callOptions); + } + }; + return WorkstationsFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for interacting with Cloud Workstations.
+   * 
+ */ + public abstract static class WorkstationsImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Returns the requested workstation cluster.
+     * 
+ */ + public void getWorkstationCluster( + com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetWorkstationClusterMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns all workstation clusters in the specified location.
+     * 
+ */ + public void listWorkstationClusters( + com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListWorkstationClustersMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new workstation cluster.
+     * 
+ */ + public void createWorkstationCluster( + com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateWorkstationClusterMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates an existing workstation cluster.
+     * 
+ */ + public void updateWorkstationCluster( + com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateWorkstationClusterMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes the specified workstation cluster.
+     * 
+ */ + public void deleteWorkstationCluster( + com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteWorkstationClusterMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns the requested workstation configuration.
+     * 
+ */ + public void getWorkstationConfig( + com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetWorkstationConfigMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns all workstation configurations in the specified cluster.
+     * 
+ */ + public void listWorkstationConfigs( + com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListWorkstationConfigsMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns all workstation configurations in the specified cluster on which
+     * the caller has the "workstations.workstation.create" permission.
+     * 
+ */ + public void listUsableWorkstationConfigs( + com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListUsableWorkstationConfigsMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new workstation configuration.
+     * 
+ */ + public void createWorkstationConfig( + com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateWorkstationConfigMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates an existing workstation configuration.
+     * 
+ */ + public void updateWorkstationConfig( + com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateWorkstationConfigMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes the specified workstation configuration.
+     * 
+ */ + public void deleteWorkstationConfig( + com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteWorkstationConfigMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns the requested workstation.
+     * 
+ */ + public void getWorkstation( + com.google.cloud.workstations.v1beta.GetWorkstationRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetWorkstationMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns all Workstations using the specified config.
+     * 
+ */ + public void listWorkstations( + com.google.cloud.workstations.v1beta.ListWorkstationsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListWorkstationsMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns all Workstations using the specified config on which the caller has
+     * the "workstations.workstations.use" permission.
+     * 
+ */ + public void listUsableWorkstations( + com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListUsableWorkstationsMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new workstation.
+     * 
+ */ + public void createWorkstation( + com.google.cloud.workstations.v1beta.CreateWorkstationRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateWorkstationMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates an existing workstation.
+     * 
+ */ + public void updateWorkstation( + com.google.cloud.workstations.v1beta.UpdateWorkstationRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateWorkstationMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes the specified workstation.
+     * 
+ */ + public void deleteWorkstation( + com.google.cloud.workstations.v1beta.DeleteWorkstationRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteWorkstationMethod(), responseObserver); + } + + /** + * + * + *
+     * Starts running a workstation so that users can connect to it.
+     * 
+ */ + public void startWorkstation( + com.google.cloud.workstations.v1beta.StartWorkstationRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getStartWorkstationMethod(), responseObserver); + } + + /** + * + * + *
+     * Stops running a workstation, reducing costs.
+     * 
+ */ + public void stopWorkstation( + com.google.cloud.workstations.v1beta.StopWorkstationRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getStopWorkstationMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns a short-lived credential that can be used to send authenticated and
+     * authorized traffic to a workstation.
+     * 
+ */ + public void generateAccessToken( + com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGenerateAccessTokenMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getGetWorkstationClusterMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest, + com.google.cloud.workstations.v1beta.WorkstationCluster>( + this, METHODID_GET_WORKSTATION_CLUSTER))) + .addMethod( + getListWorkstationClustersMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest, + com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse>( + this, METHODID_LIST_WORKSTATION_CLUSTERS))) + .addMethod( + getCreateWorkstationClusterMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_WORKSTATION_CLUSTER))) + .addMethod( + getUpdateWorkstationClusterMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_WORKSTATION_CLUSTER))) + .addMethod( + getDeleteWorkstationClusterMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_WORKSTATION_CLUSTER))) + .addMethod( + getGetWorkstationConfigMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest, + com.google.cloud.workstations.v1beta.WorkstationConfig>( + this, METHODID_GET_WORKSTATION_CONFIG))) + .addMethod( + getListWorkstationConfigsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest, + com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse>( + this, METHODID_LIST_WORKSTATION_CONFIGS))) + .addMethod( + getListUsableWorkstationConfigsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest, + com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse>( + this, METHODID_LIST_USABLE_WORKSTATION_CONFIGS))) + .addMethod( + getCreateWorkstationConfigMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_WORKSTATION_CONFIG))) + .addMethod( + getUpdateWorkstationConfigMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_WORKSTATION_CONFIG))) + .addMethod( + getDeleteWorkstationConfigMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_WORKSTATION_CONFIG))) + .addMethod( + getGetWorkstationMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.workstations.v1beta.GetWorkstationRequest, + com.google.cloud.workstations.v1beta.Workstation>( + this, METHODID_GET_WORKSTATION))) + .addMethod( + getListWorkstationsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.workstations.v1beta.ListWorkstationsRequest, + com.google.cloud.workstations.v1beta.ListWorkstationsResponse>( + this, METHODID_LIST_WORKSTATIONS))) + .addMethod( + getListUsableWorkstationsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest, + com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse>( + this, METHODID_LIST_USABLE_WORKSTATIONS))) + .addMethod( + getCreateWorkstationMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.workstations.v1beta.CreateWorkstationRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_WORKSTATION))) + .addMethod( + getUpdateWorkstationMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.workstations.v1beta.UpdateWorkstationRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_WORKSTATION))) + .addMethod( + getDeleteWorkstationMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.workstations.v1beta.DeleteWorkstationRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_WORKSTATION))) + .addMethod( + getStartWorkstationMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.workstations.v1beta.StartWorkstationRequest, + com.google.longrunning.Operation>(this, METHODID_START_WORKSTATION))) + .addMethod( + getStopWorkstationMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.workstations.v1beta.StopWorkstationRequest, + com.google.longrunning.Operation>(this, METHODID_STOP_WORKSTATION))) + .addMethod( + getGenerateAccessTokenMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest, + com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse>( + this, METHODID_GENERATE_ACCESS_TOKEN))) + .build(); + } + } + + /** + * + * + *
+   * Service for interacting with Cloud Workstations.
+   * 
+ */ + public static final class WorkstationsStub + extends io.grpc.stub.AbstractAsyncStub { + private WorkstationsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected WorkstationsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new WorkstationsStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns the requested workstation cluster.
+     * 
+ */ + public void getWorkstationCluster( + com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetWorkstationClusterMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns all workstation clusters in the specified location.
+     * 
+ */ + public void listWorkstationClusters( + com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListWorkstationClustersMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a new workstation cluster.
+     * 
+ */ + public void createWorkstationCluster( + com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateWorkstationClusterMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates an existing workstation cluster.
+     * 
+ */ + public void updateWorkstationCluster( + com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateWorkstationClusterMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes the specified workstation cluster.
+     * 
+ */ + public void deleteWorkstationCluster( + com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteWorkstationClusterMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns the requested workstation configuration.
+     * 
+ */ + public void getWorkstationConfig( + com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetWorkstationConfigMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns all workstation configurations in the specified cluster.
+     * 
+ */ + public void listWorkstationConfigs( + com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListWorkstationConfigsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns all workstation configurations in the specified cluster on which
+     * the caller has the "workstations.workstation.create" permission.
+     * 
+ */ + public void listUsableWorkstationConfigs( + com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListUsableWorkstationConfigsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a new workstation configuration.
+     * 
+ */ + public void createWorkstationConfig( + com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateWorkstationConfigMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates an existing workstation configuration.
+     * 
+ */ + public void updateWorkstationConfig( + com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateWorkstationConfigMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes the specified workstation configuration.
+     * 
+ */ + public void deleteWorkstationConfig( + com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteWorkstationConfigMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns the requested workstation.
+     * 
+ */ + public void getWorkstation( + com.google.cloud.workstations.v1beta.GetWorkstationRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetWorkstationMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns all Workstations using the specified config.
+     * 
+ */ + public void listWorkstations( + com.google.cloud.workstations.v1beta.ListWorkstationsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListWorkstationsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns all Workstations using the specified config on which the caller has
+     * the "workstations.workstations.use" permission.
+     * 
+ */ + public void listUsableWorkstations( + com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListUsableWorkstationsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a new workstation.
+     * 
+ */ + public void createWorkstation( + com.google.cloud.workstations.v1beta.CreateWorkstationRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateWorkstationMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates an existing workstation.
+     * 
+ */ + public void updateWorkstation( + com.google.cloud.workstations.v1beta.UpdateWorkstationRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateWorkstationMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes the specified workstation.
+     * 
+ */ + public void deleteWorkstation( + com.google.cloud.workstations.v1beta.DeleteWorkstationRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteWorkstationMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Starts running a workstation so that users can connect to it.
+     * 
+ */ + public void startWorkstation( + com.google.cloud.workstations.v1beta.StartWorkstationRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getStartWorkstationMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Stops running a workstation, reducing costs.
+     * 
+ */ + public void stopWorkstation( + com.google.cloud.workstations.v1beta.StopWorkstationRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getStopWorkstationMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns a short-lived credential that can be used to send authenticated and
+     * authorized traffic to a workstation.
+     * 
+ */ + public void generateAccessToken( + com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGenerateAccessTokenMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Service for interacting with Cloud Workstations.
+   * 
+ */ + public static final class WorkstationsBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private WorkstationsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected WorkstationsBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new WorkstationsBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns the requested workstation cluster.
+     * 
+ */ + public com.google.cloud.workstations.v1beta.WorkstationCluster getWorkstationCluster( + com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetWorkstationClusterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns all workstation clusters in the specified location.
+     * 
+ */ + public com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse + listWorkstationClusters( + com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListWorkstationClustersMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new workstation cluster.
+     * 
+ */ + public com.google.longrunning.Operation createWorkstationCluster( + com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateWorkstationClusterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates an existing workstation cluster.
+     * 
+ */ + public com.google.longrunning.Operation updateWorkstationCluster( + com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateWorkstationClusterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes the specified workstation cluster.
+     * 
+ */ + public com.google.longrunning.Operation deleteWorkstationCluster( + com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteWorkstationClusterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns the requested workstation configuration.
+     * 
+ */ + public com.google.cloud.workstations.v1beta.WorkstationConfig getWorkstationConfig( + com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetWorkstationConfigMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns all workstation configurations in the specified cluster.
+     * 
+ */ + public com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse + listWorkstationConfigs( + com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListWorkstationConfigsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns all workstation configurations in the specified cluster on which
+     * the caller has the "workstations.workstation.create" permission.
+     * 
+ */ + public com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse + listUsableWorkstationConfigs( + com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListUsableWorkstationConfigsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new workstation configuration.
+     * 
+ */ + public com.google.longrunning.Operation createWorkstationConfig( + com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateWorkstationConfigMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates an existing workstation configuration.
+     * 
+ */ + public com.google.longrunning.Operation updateWorkstationConfig( + com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateWorkstationConfigMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes the specified workstation configuration.
+     * 
+ */ + public com.google.longrunning.Operation deleteWorkstationConfig( + com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteWorkstationConfigMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns the requested workstation.
+     * 
+ */ + public com.google.cloud.workstations.v1beta.Workstation getWorkstation( + com.google.cloud.workstations.v1beta.GetWorkstationRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetWorkstationMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns all Workstations using the specified config.
+     * 
+ */ + public com.google.cloud.workstations.v1beta.ListWorkstationsResponse listWorkstations( + com.google.cloud.workstations.v1beta.ListWorkstationsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListWorkstationsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns all Workstations using the specified config on which the caller has
+     * the "workstations.workstations.use" permission.
+     * 
+ */ + public com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse + listUsableWorkstations( + com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListUsableWorkstationsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new workstation.
+     * 
+ */ + public com.google.longrunning.Operation createWorkstation( + com.google.cloud.workstations.v1beta.CreateWorkstationRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateWorkstationMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates an existing workstation.
+     * 
+ */ + public com.google.longrunning.Operation updateWorkstation( + com.google.cloud.workstations.v1beta.UpdateWorkstationRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateWorkstationMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes the specified workstation.
+     * 
+ */ + public com.google.longrunning.Operation deleteWorkstation( + com.google.cloud.workstations.v1beta.DeleteWorkstationRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteWorkstationMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Starts running a workstation so that users can connect to it.
+     * 
+ */ + public com.google.longrunning.Operation startWorkstation( + com.google.cloud.workstations.v1beta.StartWorkstationRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getStartWorkstationMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Stops running a workstation, reducing costs.
+     * 
+ */ + public com.google.longrunning.Operation stopWorkstation( + com.google.cloud.workstations.v1beta.StopWorkstationRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getStopWorkstationMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns a short-lived credential that can be used to send authenticated and
+     * authorized traffic to a workstation.
+     * 
+ */ + public com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse generateAccessToken( + com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGenerateAccessTokenMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Service for interacting with Cloud Workstations.
+   * 
+ */ + public static final class WorkstationsFutureStub + extends io.grpc.stub.AbstractFutureStub { + private WorkstationsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected WorkstationsFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new WorkstationsFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns the requested workstation cluster.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.workstations.v1beta.WorkstationCluster> + getWorkstationCluster( + com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetWorkstationClusterMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns all workstation clusters in the specified location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse> + listWorkstationClusters( + com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListWorkstationClustersMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new workstation cluster.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createWorkstationCluster( + com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateWorkstationClusterMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates an existing workstation cluster.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateWorkstationCluster( + com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateWorkstationClusterMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes the specified workstation cluster.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteWorkstationCluster( + com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteWorkstationClusterMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns the requested workstation configuration.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.workstations.v1beta.WorkstationConfig> + getWorkstationConfig( + com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetWorkstationConfigMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns all workstation configurations in the specified cluster.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse> + listWorkstationConfigs( + com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListWorkstationConfigsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns all workstation configurations in the specified cluster on which
+     * the caller has the "workstations.workstation.create" permission.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse> + listUsableWorkstationConfigs( + com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListUsableWorkstationConfigsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new workstation configuration.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createWorkstationConfig( + com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateWorkstationConfigMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates an existing workstation configuration.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateWorkstationConfig( + com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateWorkstationConfigMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes the specified workstation configuration.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteWorkstationConfig( + com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteWorkstationConfigMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns the requested workstation.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.workstations.v1beta.Workstation> + getWorkstation(com.google.cloud.workstations.v1beta.GetWorkstationRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetWorkstationMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns all Workstations using the specified config.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.workstations.v1beta.ListWorkstationsResponse> + listWorkstations(com.google.cloud.workstations.v1beta.ListWorkstationsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListWorkstationsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns all Workstations using the specified config on which the caller has
+     * the "workstations.workstations.use" permission.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse> + listUsableWorkstations( + com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListUsableWorkstationsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new workstation.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createWorkstation(com.google.cloud.workstations.v1beta.CreateWorkstationRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateWorkstationMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates an existing workstation.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateWorkstation(com.google.cloud.workstations.v1beta.UpdateWorkstationRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateWorkstationMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes the specified workstation.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteWorkstation(com.google.cloud.workstations.v1beta.DeleteWorkstationRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteWorkstationMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Starts running a workstation so that users can connect to it.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + startWorkstation(com.google.cloud.workstations.v1beta.StartWorkstationRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getStartWorkstationMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Stops running a workstation, reducing costs.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + stopWorkstation(com.google.cloud.workstations.v1beta.StopWorkstationRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getStopWorkstationMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns a short-lived credential that can be used to send authenticated and
+     * authorized traffic to a workstation.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse> + generateAccessToken( + com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGenerateAccessTokenMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_GET_WORKSTATION_CLUSTER = 0; + private static final int METHODID_LIST_WORKSTATION_CLUSTERS = 1; + private static final int METHODID_CREATE_WORKSTATION_CLUSTER = 2; + private static final int METHODID_UPDATE_WORKSTATION_CLUSTER = 3; + private static final int METHODID_DELETE_WORKSTATION_CLUSTER = 4; + private static final int METHODID_GET_WORKSTATION_CONFIG = 5; + private static final int METHODID_LIST_WORKSTATION_CONFIGS = 6; + private static final int METHODID_LIST_USABLE_WORKSTATION_CONFIGS = 7; + private static final int METHODID_CREATE_WORKSTATION_CONFIG = 8; + private static final int METHODID_UPDATE_WORKSTATION_CONFIG = 9; + private static final int METHODID_DELETE_WORKSTATION_CONFIG = 10; + private static final int METHODID_GET_WORKSTATION = 11; + private static final int METHODID_LIST_WORKSTATIONS = 12; + private static final int METHODID_LIST_USABLE_WORKSTATIONS = 13; + private static final int METHODID_CREATE_WORKSTATION = 14; + private static final int METHODID_UPDATE_WORKSTATION = 15; + private static final int METHODID_DELETE_WORKSTATION = 16; + private static final int METHODID_START_WORKSTATION = 17; + private static final int METHODID_STOP_WORKSTATION = 18; + private static final int METHODID_GENERATE_ACCESS_TOKEN = 19; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final WorkstationsImplBase serviceImpl; + private final int methodId; + + MethodHandlers(WorkstationsImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_GET_WORKSTATION_CLUSTER: + serviceImpl.getWorkstationCluster( + (com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_WORKSTATION_CLUSTERS: + serviceImpl.listWorkstationClusters( + (com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse>) + responseObserver); + break; + case METHODID_CREATE_WORKSTATION_CLUSTER: + serviceImpl.createWorkstationCluster( + (com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_WORKSTATION_CLUSTER: + serviceImpl.updateWorkstationCluster( + (com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_WORKSTATION_CLUSTER: + serviceImpl.deleteWorkstationCluster( + (com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_WORKSTATION_CONFIG: + serviceImpl.getWorkstationConfig( + (com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_WORKSTATION_CONFIGS: + serviceImpl.listWorkstationConfigs( + (com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse>) + responseObserver); + break; + case METHODID_LIST_USABLE_WORKSTATION_CONFIGS: + serviceImpl.listUsableWorkstationConfigs( + (com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse>) + responseObserver); + break; + case METHODID_CREATE_WORKSTATION_CONFIG: + serviceImpl.createWorkstationConfig( + (com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_WORKSTATION_CONFIG: + serviceImpl.updateWorkstationConfig( + (com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_WORKSTATION_CONFIG: + serviceImpl.deleteWorkstationConfig( + (com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_WORKSTATION: + serviceImpl.getWorkstation( + (com.google.cloud.workstations.v1beta.GetWorkstationRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_WORKSTATIONS: + serviceImpl.listWorkstations( + (com.google.cloud.workstations.v1beta.ListWorkstationsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.workstations.v1beta.ListWorkstationsResponse>) + responseObserver); + break; + case METHODID_LIST_USABLE_WORKSTATIONS: + serviceImpl.listUsableWorkstations( + (com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse>) + responseObserver); + break; + case METHODID_CREATE_WORKSTATION: + serviceImpl.createWorkstation( + (com.google.cloud.workstations.v1beta.CreateWorkstationRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_WORKSTATION: + serviceImpl.updateWorkstation( + (com.google.cloud.workstations.v1beta.UpdateWorkstationRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_WORKSTATION: + serviceImpl.deleteWorkstation( + (com.google.cloud.workstations.v1beta.DeleteWorkstationRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_START_WORKSTATION: + serviceImpl.startWorkstation( + (com.google.cloud.workstations.v1beta.StartWorkstationRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_STOP_WORKSTATION: + serviceImpl.stopWorkstation( + (com.google.cloud.workstations.v1beta.StopWorkstationRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GENERATE_ACCESS_TOKEN: + serviceImpl.generateAccessToken( + (com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse>) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class WorkstationsBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + WorkstationsBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Workstations"); + } + } + + private static final class WorkstationsFileDescriptorSupplier + extends WorkstationsBaseDescriptorSupplier { + WorkstationsFileDescriptorSupplier() {} + } + + private static final class WorkstationsMethodDescriptorSupplier + extends WorkstationsBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + WorkstationsMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (WorkstationsGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new WorkstationsFileDescriptorSupplier()) + .addMethod(getGetWorkstationClusterMethod()) + .addMethod(getListWorkstationClustersMethod()) + .addMethod(getCreateWorkstationClusterMethod()) + .addMethod(getUpdateWorkstationClusterMethod()) + .addMethod(getDeleteWorkstationClusterMethod()) + .addMethod(getGetWorkstationConfigMethod()) + .addMethod(getListWorkstationConfigsMethod()) + .addMethod(getListUsableWorkstationConfigsMethod()) + .addMethod(getCreateWorkstationConfigMethod()) + .addMethod(getUpdateWorkstationConfigMethod()) + .addMethod(getDeleteWorkstationConfigMethod()) + .addMethod(getGetWorkstationMethod()) + .addMethod(getListWorkstationsMethod()) + .addMethod(getListUsableWorkstationsMethod()) + .addMethod(getCreateWorkstationMethod()) + .addMethod(getUpdateWorkstationMethod()) + .addMethod(getDeleteWorkstationMethod()) + .addMethod(getStartWorkstationMethod()) + .addMethod(getStopWorkstationMethod()) + .addMethod(getGenerateAccessTokenMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-workstations/owlbot.py b/java-workstations/owlbot.py new file mode 100644 index 000000000000..03c0f6686d3f --- /dev/null +++ b/java-workstations/owlbot.py @@ -0,0 +1,36 @@ +# Copyright 2021 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. + +import synthtool as s +from synthtool.languages import java + + +for library in s.get_staging_dirs(): + # put any special-case replacements here + s.move(library) + +s.remove_staging_dirs() +java.common_templates(monorepo=True, excludes=[ + ".github/*", + ".kokoro/*", + "samples/*", + "CODE_OF_CONDUCT.md", + "CONTRIBUTING.md", + "LICENSE", + "SECURITY.md", + "java.header", + "license-checks.xml", + "renovate.json", + ".gitignore" +]) \ No newline at end of file diff --git a/java-workstations/pom.xml b/java-workstations/pom.xml new file mode 100644 index 000000000000..6e5b59bc2e47 --- /dev/null +++ b/java-workstations/pom.xml @@ -0,0 +1,54 @@ + + + 4.0.0 + com.google.cloud + google-cloud-workstations-parent + pom + 0.0.1-SNAPSHOT + Google Cloud Workstations Parent + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-jar-parent + 1.7.0-SNAPSHOT + ../google-cloud-jar-parent/pom.xml + + + + UTF-8 + UTF-8 + github + google-cloud-workstations-parent + + + + + + com.google.cloud + google-cloud-workstations + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-workstations-v1beta + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-workstations-v1beta + 0.0.1-SNAPSHOT + + + + + + google-cloud-workstations + grpc-google-cloud-workstations-v1beta + proto-google-cloud-workstations-v1beta + google-cloud-workstations-bom + + + diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/clirr-ignored-differences.xml b/java-workstations/proto-google-cloud-workstations-v1beta/clirr-ignored-differences.xml new file mode 100644 index 000000000000..789c600af009 --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/workstations/v1beta/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/workstations/v1beta/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/workstations/v1beta/*OrBuilder + boolean has*(*) + + diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/pom.xml b/java-workstations/proto-google-cloud-workstations-v1beta/pom.xml new file mode 100644 index 000000000000..fd243c47e7fe --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-workstations-v1beta + 0.0.1-SNAPSHOT + proto-google-cloud-workstations-v1beta + Proto library for google-cloud-workstations + + com.google.cloud + google-cloud-workstations-parent + 0.0.1-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api + api-common + + + com.google.guava + guava + + + diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/CreateWorkstationClusterRequest.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/CreateWorkstationClusterRequest.java new file mode 100644 index 000000000000..ebdec9786a4c --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/CreateWorkstationClusterRequest.java @@ -0,0 +1,1234 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +/** + * + * + *
+ * Message for creating a CreateWorkstationCluster.
+ * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.CreateWorkstationClusterRequest} + */ +public final class CreateWorkstationClusterRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workstations.v1beta.CreateWorkstationClusterRequest) + CreateWorkstationClusterRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateWorkstationClusterRequest.newBuilder() to construct. + private CreateWorkstationClusterRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateWorkstationClusterRequest() { + parent_ = ""; + workstationClusterId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateWorkstationClusterRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_CreateWorkstationClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_CreateWorkstationClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest.class, + com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int WORKSTATION_CLUSTER_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object workstationClusterId_ = ""; + /** + * + * + *
+   * Required. ID to use for the workstation cluster.
+   * 
+ * + * string workstation_cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The workstationClusterId. + */ + @java.lang.Override + public java.lang.String getWorkstationClusterId() { + java.lang.Object ref = workstationClusterId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + workstationClusterId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. ID to use for the workstation cluster.
+   * 
+ * + * string workstation_cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for workstationClusterId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getWorkstationClusterIdBytes() { + java.lang.Object ref = workstationClusterId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + workstationClusterId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int WORKSTATION_CLUSTER_FIELD_NUMBER = 3; + private com.google.cloud.workstations.v1beta.WorkstationCluster workstationCluster_; + /** + * + * + *
+   * Required. Workstation cluster to create.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster workstation_cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the workstationCluster field is set. + */ + @java.lang.Override + public boolean hasWorkstationCluster() { + return workstationCluster_ != null; + } + /** + * + * + *
+   * Required. Workstation cluster to create.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster workstation_cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The workstationCluster. + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationCluster getWorkstationCluster() { + return workstationCluster_ == null + ? com.google.cloud.workstations.v1beta.WorkstationCluster.getDefaultInstance() + : workstationCluster_; + } + /** + * + * + *
+   * Required. Workstation cluster to create.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster workstation_cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationClusterOrBuilder + getWorkstationClusterOrBuilder() { + return workstationCluster_ == null + ? com.google.cloud.workstations.v1beta.WorkstationCluster.getDefaultInstance() + : workstationCluster_; + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 4; + private boolean validateOnly_ = false; + /** + * + * + *
+   * If set, validate the request and preview the review, but do not actually
+   * apply it.
+   * 
+ * + * bool validate_only = 4; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(workstationClusterId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, workstationClusterId_); + } + if (workstationCluster_ != null) { + output.writeMessage(3, getWorkstationCluster()); + } + if (validateOnly_ != false) { + output.writeBool(4, validateOnly_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(workstationClusterId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, workstationClusterId_); + } + if (workstationCluster_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getWorkstationCluster()); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, validateOnly_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest)) { + return super.equals(obj); + } + com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest other = + (com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getWorkstationClusterId().equals(other.getWorkstationClusterId())) return false; + if (hasWorkstationCluster() != other.hasWorkstationCluster()) return false; + if (hasWorkstationCluster()) { + if (!getWorkstationCluster().equals(other.getWorkstationCluster())) return false; + } + if (getValidateOnly() != other.getValidateOnly()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + WORKSTATION_CLUSTER_ID_FIELD_NUMBER; + hash = (53 * hash) + getWorkstationClusterId().hashCode(); + if (hasWorkstationCluster()) { + hash = (37 * hash) + WORKSTATION_CLUSTER_FIELD_NUMBER; + hash = (53 * hash) + getWorkstationCluster().hashCode(); + } + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for creating a CreateWorkstationCluster.
+   * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.CreateWorkstationClusterRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workstations.v1beta.CreateWorkstationClusterRequest) + com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_CreateWorkstationClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_CreateWorkstationClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest.class, + com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest.Builder.class); + } + + // Construct using + // com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + workstationClusterId_ = ""; + workstationCluster_ = null; + if (workstationClusterBuilder_ != null) { + workstationClusterBuilder_.dispose(); + workstationClusterBuilder_ = null; + } + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_CreateWorkstationClusterRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest + getDefaultInstanceForType() { + return com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest build() { + com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest buildPartial() { + com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest result = + new com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.workstationClusterId_ = workstationClusterId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.workstationCluster_ = + workstationClusterBuilder_ == null + ? workstationCluster_ + : workstationClusterBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest) { + return mergeFrom( + (com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest other) { + if (other + == com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getWorkstationClusterId().isEmpty()) { + workstationClusterId_ = other.workstationClusterId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasWorkstationCluster()) { + mergeWorkstationCluster(other.getWorkstationCluster()); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + workstationClusterId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + getWorkstationClusterFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object workstationClusterId_ = ""; + /** + * + * + *
+     * Required. ID to use for the workstation cluster.
+     * 
+ * + * string workstation_cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The workstationClusterId. + */ + public java.lang.String getWorkstationClusterId() { + java.lang.Object ref = workstationClusterId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + workstationClusterId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. ID to use for the workstation cluster.
+     * 
+ * + * string workstation_cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for workstationClusterId. + */ + public com.google.protobuf.ByteString getWorkstationClusterIdBytes() { + java.lang.Object ref = workstationClusterId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + workstationClusterId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. ID to use for the workstation cluster.
+     * 
+ * + * string workstation_cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The workstationClusterId to set. + * @return This builder for chaining. + */ + public Builder setWorkstationClusterId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + workstationClusterId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID to use for the workstation cluster.
+     * 
+ * + * string workstation_cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearWorkstationClusterId() { + workstationClusterId_ = getDefaultInstance().getWorkstationClusterId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID to use for the workstation cluster.
+     * 
+ * + * string workstation_cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for workstationClusterId to set. + * @return This builder for chaining. + */ + public Builder setWorkstationClusterIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + workstationClusterId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.workstations.v1beta.WorkstationCluster workstationCluster_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationCluster, + com.google.cloud.workstations.v1beta.WorkstationCluster.Builder, + com.google.cloud.workstations.v1beta.WorkstationClusterOrBuilder> + workstationClusterBuilder_; + /** + * + * + *
+     * Required. Workstation cluster to create.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster workstation_cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the workstationCluster field is set. + */ + public boolean hasWorkstationCluster() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. Workstation cluster to create.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster workstation_cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The workstationCluster. + */ + public com.google.cloud.workstations.v1beta.WorkstationCluster getWorkstationCluster() { + if (workstationClusterBuilder_ == null) { + return workstationCluster_ == null + ? com.google.cloud.workstations.v1beta.WorkstationCluster.getDefaultInstance() + : workstationCluster_; + } else { + return workstationClusterBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Workstation cluster to create.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster workstation_cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setWorkstationCluster( + com.google.cloud.workstations.v1beta.WorkstationCluster value) { + if (workstationClusterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + workstationCluster_ = value; + } else { + workstationClusterBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Workstation cluster to create.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster workstation_cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setWorkstationCluster( + com.google.cloud.workstations.v1beta.WorkstationCluster.Builder builderForValue) { + if (workstationClusterBuilder_ == null) { + workstationCluster_ = builderForValue.build(); + } else { + workstationClusterBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Workstation cluster to create.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster workstation_cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeWorkstationCluster( + com.google.cloud.workstations.v1beta.WorkstationCluster value) { + if (workstationClusterBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && workstationCluster_ != null + && workstationCluster_ + != com.google.cloud.workstations.v1beta.WorkstationCluster.getDefaultInstance()) { + getWorkstationClusterBuilder().mergeFrom(value); + } else { + workstationCluster_ = value; + } + } else { + workstationClusterBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Workstation cluster to create.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster workstation_cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearWorkstationCluster() { + bitField0_ = (bitField0_ & ~0x00000004); + workstationCluster_ = null; + if (workstationClusterBuilder_ != null) { + workstationClusterBuilder_.dispose(); + workstationClusterBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Workstation cluster to create.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster workstation_cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.workstations.v1beta.WorkstationCluster.Builder + getWorkstationClusterBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getWorkstationClusterFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Workstation cluster to create.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster workstation_cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.workstations.v1beta.WorkstationClusterOrBuilder + getWorkstationClusterOrBuilder() { + if (workstationClusterBuilder_ != null) { + return workstationClusterBuilder_.getMessageOrBuilder(); + } else { + return workstationCluster_ == null + ? com.google.cloud.workstations.v1beta.WorkstationCluster.getDefaultInstance() + : workstationCluster_; + } + } + /** + * + * + *
+     * Required. Workstation cluster to create.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster workstation_cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationCluster, + com.google.cloud.workstations.v1beta.WorkstationCluster.Builder, + com.google.cloud.workstations.v1beta.WorkstationClusterOrBuilder> + getWorkstationClusterFieldBuilder() { + if (workstationClusterBuilder_ == null) { + workstationClusterBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationCluster, + com.google.cloud.workstations.v1beta.WorkstationCluster.Builder, + com.google.cloud.workstations.v1beta.WorkstationClusterOrBuilder>( + getWorkstationCluster(), getParentForChildren(), isClean()); + workstationCluster_ = null; + } + return workstationClusterBuilder_; + } + + private boolean validateOnly_; + /** + * + * + *
+     * If set, validate the request and preview the review, but do not actually
+     * apply it.
+     * 
+ * + * bool validate_only = 4; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * If set, validate the request and preview the review, but do not actually
+     * apply it.
+     * 
+ * + * bool validate_only = 4; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * If set, validate the request and preview the review, but do not actually
+     * apply it.
+     * 
+ * + * bool validate_only = 4; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000008); + validateOnly_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workstations.v1beta.CreateWorkstationClusterRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workstations.v1beta.CreateWorkstationClusterRequest) + private static final com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest(); + } + + public static com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateWorkstationClusterRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/CreateWorkstationClusterRequestOrBuilder.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/CreateWorkstationClusterRequestOrBuilder.java new file mode 100644 index 000000000000..d51142cf084c --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/CreateWorkstationClusterRequestOrBuilder.java @@ -0,0 +1,134 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +public interface CreateWorkstationClusterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workstations.v1beta.CreateWorkstationClusterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. ID to use for the workstation cluster.
+   * 
+ * + * string workstation_cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The workstationClusterId. + */ + java.lang.String getWorkstationClusterId(); + /** + * + * + *
+   * Required. ID to use for the workstation cluster.
+   * 
+ * + * string workstation_cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for workstationClusterId. + */ + com.google.protobuf.ByteString getWorkstationClusterIdBytes(); + + /** + * + * + *
+   * Required. Workstation cluster to create.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster workstation_cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the workstationCluster field is set. + */ + boolean hasWorkstationCluster(); + /** + * + * + *
+   * Required. Workstation cluster to create.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster workstation_cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The workstationCluster. + */ + com.google.cloud.workstations.v1beta.WorkstationCluster getWorkstationCluster(); + /** + * + * + *
+   * Required. Workstation cluster to create.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster workstation_cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.workstations.v1beta.WorkstationClusterOrBuilder getWorkstationClusterOrBuilder(); + + /** + * + * + *
+   * If set, validate the request and preview the review, but do not actually
+   * apply it.
+   * 
+ * + * bool validate_only = 4; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/CreateWorkstationConfigRequest.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/CreateWorkstationConfigRequest.java new file mode 100644 index 000000000000..ad81aa983574 --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/CreateWorkstationConfigRequest.java @@ -0,0 +1,1234 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +/** + * + * + *
+ * Message for creating a CreateWorkstationConfig.
+ * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.CreateWorkstationConfigRequest} + */ +public final class CreateWorkstationConfigRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workstations.v1beta.CreateWorkstationConfigRequest) + CreateWorkstationConfigRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateWorkstationConfigRequest.newBuilder() to construct. + private CreateWorkstationConfigRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateWorkstationConfigRequest() { + parent_ = ""; + workstationConfigId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateWorkstationConfigRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_CreateWorkstationConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_CreateWorkstationConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest.class, + com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int WORKSTATION_CONFIG_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object workstationConfigId_ = ""; + /** + * + * + *
+   * Required. ID to use for the config.
+   * 
+ * + * string workstation_config_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The workstationConfigId. + */ + @java.lang.Override + public java.lang.String getWorkstationConfigId() { + java.lang.Object ref = workstationConfigId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + workstationConfigId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. ID to use for the config.
+   * 
+ * + * string workstation_config_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for workstationConfigId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getWorkstationConfigIdBytes() { + java.lang.Object ref = workstationConfigId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + workstationConfigId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int WORKSTATION_CONFIG_FIELD_NUMBER = 3; + private com.google.cloud.workstations.v1beta.WorkstationConfig workstationConfig_; + /** + * + * + *
+   * Required. Config to create.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig workstation_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the workstationConfig field is set. + */ + @java.lang.Override + public boolean hasWorkstationConfig() { + return workstationConfig_ != null; + } + /** + * + * + *
+   * Required. Config to create.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig workstation_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The workstationConfig. + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig getWorkstationConfig() { + return workstationConfig_ == null + ? com.google.cloud.workstations.v1beta.WorkstationConfig.getDefaultInstance() + : workstationConfig_; + } + /** + * + * + *
+   * Required. Config to create.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig workstation_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfigOrBuilder + getWorkstationConfigOrBuilder() { + return workstationConfig_ == null + ? com.google.cloud.workstations.v1beta.WorkstationConfig.getDefaultInstance() + : workstationConfig_; + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 4; + private boolean validateOnly_ = false; + /** + * + * + *
+   * If set, validate the request and preview the review, but do not actually
+   * apply it.
+   * 
+ * + * bool validate_only = 4; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(workstationConfigId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, workstationConfigId_); + } + if (workstationConfig_ != null) { + output.writeMessage(3, getWorkstationConfig()); + } + if (validateOnly_ != false) { + output.writeBool(4, validateOnly_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(workstationConfigId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, workstationConfigId_); + } + if (workstationConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getWorkstationConfig()); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, validateOnly_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest)) { + return super.equals(obj); + } + com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest other = + (com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getWorkstationConfigId().equals(other.getWorkstationConfigId())) return false; + if (hasWorkstationConfig() != other.hasWorkstationConfig()) return false; + if (hasWorkstationConfig()) { + if (!getWorkstationConfig().equals(other.getWorkstationConfig())) return false; + } + if (getValidateOnly() != other.getValidateOnly()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + WORKSTATION_CONFIG_ID_FIELD_NUMBER; + hash = (53 * hash) + getWorkstationConfigId().hashCode(); + if (hasWorkstationConfig()) { + hash = (37 * hash) + WORKSTATION_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getWorkstationConfig().hashCode(); + } + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for creating a CreateWorkstationConfig.
+   * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.CreateWorkstationConfigRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workstations.v1beta.CreateWorkstationConfigRequest) + com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_CreateWorkstationConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_CreateWorkstationConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest.class, + com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest.Builder.class); + } + + // Construct using + // com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + workstationConfigId_ = ""; + workstationConfig_ = null; + if (workstationConfigBuilder_ != null) { + workstationConfigBuilder_.dispose(); + workstationConfigBuilder_ = null; + } + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_CreateWorkstationConfigRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest + getDefaultInstanceForType() { + return com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest build() { + com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest buildPartial() { + com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest result = + new com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.workstationConfigId_ = workstationConfigId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.workstationConfig_ = + workstationConfigBuilder_ == null + ? workstationConfig_ + : workstationConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest) { + return mergeFrom( + (com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest other) { + if (other + == com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getWorkstationConfigId().isEmpty()) { + workstationConfigId_ = other.workstationConfigId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasWorkstationConfig()) { + mergeWorkstationConfig(other.getWorkstationConfig()); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + workstationConfigId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + getWorkstationConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object workstationConfigId_ = ""; + /** + * + * + *
+     * Required. ID to use for the config.
+     * 
+ * + * string workstation_config_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The workstationConfigId. + */ + public java.lang.String getWorkstationConfigId() { + java.lang.Object ref = workstationConfigId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + workstationConfigId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. ID to use for the config.
+     * 
+ * + * string workstation_config_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for workstationConfigId. + */ + public com.google.protobuf.ByteString getWorkstationConfigIdBytes() { + java.lang.Object ref = workstationConfigId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + workstationConfigId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. ID to use for the config.
+     * 
+ * + * string workstation_config_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The workstationConfigId to set. + * @return This builder for chaining. + */ + public Builder setWorkstationConfigId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + workstationConfigId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID to use for the config.
+     * 
+ * + * string workstation_config_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearWorkstationConfigId() { + workstationConfigId_ = getDefaultInstance().getWorkstationConfigId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID to use for the config.
+     * 
+ * + * string workstation_config_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for workstationConfigId to set. + * @return This builder for chaining. + */ + public Builder setWorkstationConfigIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + workstationConfigId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.workstations.v1beta.WorkstationConfig workstationConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationConfig, + com.google.cloud.workstations.v1beta.WorkstationConfig.Builder, + com.google.cloud.workstations.v1beta.WorkstationConfigOrBuilder> + workstationConfigBuilder_; + /** + * + * + *
+     * Required. Config to create.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig workstation_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the workstationConfig field is set. + */ + public boolean hasWorkstationConfig() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. Config to create.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig workstation_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The workstationConfig. + */ + public com.google.cloud.workstations.v1beta.WorkstationConfig getWorkstationConfig() { + if (workstationConfigBuilder_ == null) { + return workstationConfig_ == null + ? com.google.cloud.workstations.v1beta.WorkstationConfig.getDefaultInstance() + : workstationConfig_; + } else { + return workstationConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Config to create.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig workstation_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setWorkstationConfig( + com.google.cloud.workstations.v1beta.WorkstationConfig value) { + if (workstationConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + workstationConfig_ = value; + } else { + workstationConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Config to create.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig workstation_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setWorkstationConfig( + com.google.cloud.workstations.v1beta.WorkstationConfig.Builder builderForValue) { + if (workstationConfigBuilder_ == null) { + workstationConfig_ = builderForValue.build(); + } else { + workstationConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Config to create.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig workstation_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeWorkstationConfig( + com.google.cloud.workstations.v1beta.WorkstationConfig value) { + if (workstationConfigBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && workstationConfig_ != null + && workstationConfig_ + != com.google.cloud.workstations.v1beta.WorkstationConfig.getDefaultInstance()) { + getWorkstationConfigBuilder().mergeFrom(value); + } else { + workstationConfig_ = value; + } + } else { + workstationConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Config to create.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig workstation_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearWorkstationConfig() { + bitField0_ = (bitField0_ & ~0x00000004); + workstationConfig_ = null; + if (workstationConfigBuilder_ != null) { + workstationConfigBuilder_.dispose(); + workstationConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Config to create.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig workstation_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.workstations.v1beta.WorkstationConfig.Builder + getWorkstationConfigBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getWorkstationConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Config to create.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig workstation_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.workstations.v1beta.WorkstationConfigOrBuilder + getWorkstationConfigOrBuilder() { + if (workstationConfigBuilder_ != null) { + return workstationConfigBuilder_.getMessageOrBuilder(); + } else { + return workstationConfig_ == null + ? com.google.cloud.workstations.v1beta.WorkstationConfig.getDefaultInstance() + : workstationConfig_; + } + } + /** + * + * + *
+     * Required. Config to create.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig workstation_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationConfig, + com.google.cloud.workstations.v1beta.WorkstationConfig.Builder, + com.google.cloud.workstations.v1beta.WorkstationConfigOrBuilder> + getWorkstationConfigFieldBuilder() { + if (workstationConfigBuilder_ == null) { + workstationConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationConfig, + com.google.cloud.workstations.v1beta.WorkstationConfig.Builder, + com.google.cloud.workstations.v1beta.WorkstationConfigOrBuilder>( + getWorkstationConfig(), getParentForChildren(), isClean()); + workstationConfig_ = null; + } + return workstationConfigBuilder_; + } + + private boolean validateOnly_; + /** + * + * + *
+     * If set, validate the request and preview the review, but do not actually
+     * apply it.
+     * 
+ * + * bool validate_only = 4; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * If set, validate the request and preview the review, but do not actually
+     * apply it.
+     * 
+ * + * bool validate_only = 4; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * If set, validate the request and preview the review, but do not actually
+     * apply it.
+     * 
+ * + * bool validate_only = 4; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000008); + validateOnly_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workstations.v1beta.CreateWorkstationConfigRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workstations.v1beta.CreateWorkstationConfigRequest) + private static final com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest(); + } + + public static com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateWorkstationConfigRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/CreateWorkstationConfigRequestOrBuilder.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/CreateWorkstationConfigRequestOrBuilder.java new file mode 100644 index 000000000000..5a0a2f79f046 --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/CreateWorkstationConfigRequestOrBuilder.java @@ -0,0 +1,134 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +public interface CreateWorkstationConfigRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workstations.v1beta.CreateWorkstationConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. ID to use for the config.
+   * 
+ * + * string workstation_config_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The workstationConfigId. + */ + java.lang.String getWorkstationConfigId(); + /** + * + * + *
+   * Required. ID to use for the config.
+   * 
+ * + * string workstation_config_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for workstationConfigId. + */ + com.google.protobuf.ByteString getWorkstationConfigIdBytes(); + + /** + * + * + *
+   * Required. Config to create.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig workstation_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the workstationConfig field is set. + */ + boolean hasWorkstationConfig(); + /** + * + * + *
+   * Required. Config to create.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig workstation_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The workstationConfig. + */ + com.google.cloud.workstations.v1beta.WorkstationConfig getWorkstationConfig(); + /** + * + * + *
+   * Required. Config to create.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig workstation_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.workstations.v1beta.WorkstationConfigOrBuilder getWorkstationConfigOrBuilder(); + + /** + * + * + *
+   * If set, validate the request and preview the review, but do not actually
+   * apply it.
+   * 
+ * + * bool validate_only = 4; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/CreateWorkstationRequest.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/CreateWorkstationRequest.java new file mode 100644 index 000000000000..d99d750626ac --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/CreateWorkstationRequest.java @@ -0,0 +1,1218 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +/** + * + * + *
+ * Message for creating a CreateWorkstation.
+ * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.CreateWorkstationRequest} + */ +public final class CreateWorkstationRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workstations.v1beta.CreateWorkstationRequest) + CreateWorkstationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateWorkstationRequest.newBuilder() to construct. + private CreateWorkstationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateWorkstationRequest() { + parent_ = ""; + workstationId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateWorkstationRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_CreateWorkstationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_CreateWorkstationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.CreateWorkstationRequest.class, + com.google.cloud.workstations.v1beta.CreateWorkstationRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int WORKSTATION_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object workstationId_ = ""; + /** + * + * + *
+   * Required. ID to use for the workstation.
+   * 
+ * + * string workstation_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The workstationId. + */ + @java.lang.Override + public java.lang.String getWorkstationId() { + java.lang.Object ref = workstationId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + workstationId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. ID to use for the workstation.
+   * 
+ * + * string workstation_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for workstationId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getWorkstationIdBytes() { + java.lang.Object ref = workstationId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + workstationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int WORKSTATION_FIELD_NUMBER = 3; + private com.google.cloud.workstations.v1beta.Workstation workstation_; + /** + * + * + *
+   * Required. Workstation to create.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.Workstation workstation = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the workstation field is set. + */ + @java.lang.Override + public boolean hasWorkstation() { + return workstation_ != null; + } + /** + * + * + *
+   * Required. Workstation to create.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.Workstation workstation = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The workstation. + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.Workstation getWorkstation() { + return workstation_ == null + ? com.google.cloud.workstations.v1beta.Workstation.getDefaultInstance() + : workstation_; + } + /** + * + * + *
+   * Required. Workstation to create.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.Workstation workstation = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationOrBuilder getWorkstationOrBuilder() { + return workstation_ == null + ? com.google.cloud.workstations.v1beta.Workstation.getDefaultInstance() + : workstation_; + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 4; + private boolean validateOnly_ = false; + /** + * + * + *
+   * If set, validate the request and preview the review, but do not actually
+   * apply it.
+   * 
+ * + * bool validate_only = 4; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(workstationId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, workstationId_); + } + if (workstation_ != null) { + output.writeMessage(3, getWorkstation()); + } + if (validateOnly_ != false) { + output.writeBool(4, validateOnly_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(workstationId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, workstationId_); + } + if (workstation_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getWorkstation()); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, validateOnly_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workstations.v1beta.CreateWorkstationRequest)) { + return super.equals(obj); + } + com.google.cloud.workstations.v1beta.CreateWorkstationRequest other = + (com.google.cloud.workstations.v1beta.CreateWorkstationRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getWorkstationId().equals(other.getWorkstationId())) return false; + if (hasWorkstation() != other.hasWorkstation()) return false; + if (hasWorkstation()) { + if (!getWorkstation().equals(other.getWorkstation())) return false; + } + if (getValidateOnly() != other.getValidateOnly()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + WORKSTATION_ID_FIELD_NUMBER; + hash = (53 * hash) + getWorkstationId().hashCode(); + if (hasWorkstation()) { + hash = (37 * hash) + WORKSTATION_FIELD_NUMBER; + hash = (53 * hash) + getWorkstation().hashCode(); + } + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workstations.v1beta.CreateWorkstationRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.CreateWorkstationRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.CreateWorkstationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.CreateWorkstationRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.CreateWorkstationRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.CreateWorkstationRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.CreateWorkstationRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.CreateWorkstationRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.CreateWorkstationRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.CreateWorkstationRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.CreateWorkstationRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.CreateWorkstationRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workstations.v1beta.CreateWorkstationRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for creating a CreateWorkstation.
+   * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.CreateWorkstationRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workstations.v1beta.CreateWorkstationRequest) + com.google.cloud.workstations.v1beta.CreateWorkstationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_CreateWorkstationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_CreateWorkstationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.CreateWorkstationRequest.class, + com.google.cloud.workstations.v1beta.CreateWorkstationRequest.Builder.class); + } + + // Construct using com.google.cloud.workstations.v1beta.CreateWorkstationRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + workstationId_ = ""; + workstation_ = null; + if (workstationBuilder_ != null) { + workstationBuilder_.dispose(); + workstationBuilder_ = null; + } + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_CreateWorkstationRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.CreateWorkstationRequest + getDefaultInstanceForType() { + return com.google.cloud.workstations.v1beta.CreateWorkstationRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.CreateWorkstationRequest build() { + com.google.cloud.workstations.v1beta.CreateWorkstationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.CreateWorkstationRequest buildPartial() { + com.google.cloud.workstations.v1beta.CreateWorkstationRequest result = + new com.google.cloud.workstations.v1beta.CreateWorkstationRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.workstations.v1beta.CreateWorkstationRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.workstationId_ = workstationId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.workstation_ = + workstationBuilder_ == null ? workstation_ : workstationBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workstations.v1beta.CreateWorkstationRequest) { + return mergeFrom((com.google.cloud.workstations.v1beta.CreateWorkstationRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.workstations.v1beta.CreateWorkstationRequest other) { + if (other + == com.google.cloud.workstations.v1beta.CreateWorkstationRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getWorkstationId().isEmpty()) { + workstationId_ = other.workstationId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasWorkstation()) { + mergeWorkstation(other.getWorkstation()); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + workstationId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getWorkstationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object workstationId_ = ""; + /** + * + * + *
+     * Required. ID to use for the workstation.
+     * 
+ * + * string workstation_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The workstationId. + */ + public java.lang.String getWorkstationId() { + java.lang.Object ref = workstationId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + workstationId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. ID to use for the workstation.
+     * 
+ * + * string workstation_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for workstationId. + */ + public com.google.protobuf.ByteString getWorkstationIdBytes() { + java.lang.Object ref = workstationId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + workstationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. ID to use for the workstation.
+     * 
+ * + * string workstation_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The workstationId to set. + * @return This builder for chaining. + */ + public Builder setWorkstationId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + workstationId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID to use for the workstation.
+     * 
+ * + * string workstation_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearWorkstationId() { + workstationId_ = getDefaultInstance().getWorkstationId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID to use for the workstation.
+     * 
+ * + * string workstation_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for workstationId to set. + * @return This builder for chaining. + */ + public Builder setWorkstationIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + workstationId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.workstations.v1beta.Workstation workstation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workstations.v1beta.Workstation, + com.google.cloud.workstations.v1beta.Workstation.Builder, + com.google.cloud.workstations.v1beta.WorkstationOrBuilder> + workstationBuilder_; + /** + * + * + *
+     * Required. Workstation to create.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.Workstation workstation = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the workstation field is set. + */ + public boolean hasWorkstation() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. Workstation to create.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.Workstation workstation = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The workstation. + */ + public com.google.cloud.workstations.v1beta.Workstation getWorkstation() { + if (workstationBuilder_ == null) { + return workstation_ == null + ? com.google.cloud.workstations.v1beta.Workstation.getDefaultInstance() + : workstation_; + } else { + return workstationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Workstation to create.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.Workstation workstation = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setWorkstation(com.google.cloud.workstations.v1beta.Workstation value) { + if (workstationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + workstation_ = value; + } else { + workstationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Workstation to create.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.Workstation workstation = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setWorkstation( + com.google.cloud.workstations.v1beta.Workstation.Builder builderForValue) { + if (workstationBuilder_ == null) { + workstation_ = builderForValue.build(); + } else { + workstationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Workstation to create.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.Workstation workstation = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeWorkstation(com.google.cloud.workstations.v1beta.Workstation value) { + if (workstationBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && workstation_ != null + && workstation_ + != com.google.cloud.workstations.v1beta.Workstation.getDefaultInstance()) { + getWorkstationBuilder().mergeFrom(value); + } else { + workstation_ = value; + } + } else { + workstationBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Workstation to create.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.Workstation workstation = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearWorkstation() { + bitField0_ = (bitField0_ & ~0x00000004); + workstation_ = null; + if (workstationBuilder_ != null) { + workstationBuilder_.dispose(); + workstationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Workstation to create.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.Workstation workstation = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.workstations.v1beta.Workstation.Builder getWorkstationBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getWorkstationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Workstation to create.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.Workstation workstation = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.workstations.v1beta.WorkstationOrBuilder getWorkstationOrBuilder() { + if (workstationBuilder_ != null) { + return workstationBuilder_.getMessageOrBuilder(); + } else { + return workstation_ == null + ? com.google.cloud.workstations.v1beta.Workstation.getDefaultInstance() + : workstation_; + } + } + /** + * + * + *
+     * Required. Workstation to create.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.Workstation workstation = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workstations.v1beta.Workstation, + com.google.cloud.workstations.v1beta.Workstation.Builder, + com.google.cloud.workstations.v1beta.WorkstationOrBuilder> + getWorkstationFieldBuilder() { + if (workstationBuilder_ == null) { + workstationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workstations.v1beta.Workstation, + com.google.cloud.workstations.v1beta.Workstation.Builder, + com.google.cloud.workstations.v1beta.WorkstationOrBuilder>( + getWorkstation(), getParentForChildren(), isClean()); + workstation_ = null; + } + return workstationBuilder_; + } + + private boolean validateOnly_; + /** + * + * + *
+     * If set, validate the request and preview the review, but do not actually
+     * apply it.
+     * 
+ * + * bool validate_only = 4; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * If set, validate the request and preview the review, but do not actually
+     * apply it.
+     * 
+ * + * bool validate_only = 4; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * If set, validate the request and preview the review, but do not actually
+     * apply it.
+     * 
+ * + * bool validate_only = 4; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000008); + validateOnly_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workstations.v1beta.CreateWorkstationRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workstations.v1beta.CreateWorkstationRequest) + private static final com.google.cloud.workstations.v1beta.CreateWorkstationRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workstations.v1beta.CreateWorkstationRequest(); + } + + public static com.google.cloud.workstations.v1beta.CreateWorkstationRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateWorkstationRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.CreateWorkstationRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/CreateWorkstationRequestOrBuilder.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/CreateWorkstationRequestOrBuilder.java new file mode 100644 index 000000000000..533557c89d4c --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/CreateWorkstationRequestOrBuilder.java @@ -0,0 +1,134 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +public interface CreateWorkstationRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workstations.v1beta.CreateWorkstationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. ID to use for the workstation.
+   * 
+ * + * string workstation_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The workstationId. + */ + java.lang.String getWorkstationId(); + /** + * + * + *
+   * Required. ID to use for the workstation.
+   * 
+ * + * string workstation_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for workstationId. + */ + com.google.protobuf.ByteString getWorkstationIdBytes(); + + /** + * + * + *
+   * Required. Workstation to create.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.Workstation workstation = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the workstation field is set. + */ + boolean hasWorkstation(); + /** + * + * + *
+   * Required. Workstation to create.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.Workstation workstation = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The workstation. + */ + com.google.cloud.workstations.v1beta.Workstation getWorkstation(); + /** + * + * + *
+   * Required. Workstation to create.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.Workstation workstation = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.workstations.v1beta.WorkstationOrBuilder getWorkstationOrBuilder(); + + /** + * + * + *
+   * If set, validate the request and preview the review, but do not actually
+   * apply it.
+   * 
+ * + * bool validate_only = 4; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/DeleteWorkstationClusterRequest.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/DeleteWorkstationClusterRequest.java new file mode 100644 index 000000000000..25a419b17ace --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/DeleteWorkstationClusterRequest.java @@ -0,0 +1,1039 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +/** + * + * + *
+ * Message for deleting a workstation cluster.
+ * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest} + */ +public final class DeleteWorkstationClusterRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest) + DeleteWorkstationClusterRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteWorkstationClusterRequest.newBuilder() to construct. + private DeleteWorkstationClusterRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteWorkstationClusterRequest() { + name_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteWorkstationClusterRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_DeleteWorkstationClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_DeleteWorkstationClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest.class, + com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Name of the workstation cluster to delete.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the workstation cluster to delete.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 2; + private boolean validateOnly_ = false; + /** + * + * + *
+   * If set, validate the request and preview the review, but do not apply it.
+   * 
+ * + * bool validate_only = 2; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + public static final int ETAG_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * If set, the request will be rejected if the latest version of the
+   * workstation cluster on the server does not have this etag.
+   * 
+ * + * string etag = 3; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * If set, the request will be rejected if the latest version of the
+   * workstation cluster on the server does not have this etag.
+   * 
+ * + * string etag = 3; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FORCE_FIELD_NUMBER = 4; + private boolean force_ = false; + /** + * + * + *
+   * If set, any workstation configurations and workstations in the
+   * workstation cluster are also deleted. Otherwise, the request only
+   * works if the workstation cluster has no configurations or workstations.
+   * 
+ * + * bool force = 4; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (validateOnly_ != false) { + output.writeBool(2, validateOnly_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, etag_); + } + if (force_ != false) { + output.writeBool(4, force_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, validateOnly_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, etag_); + } + if (force_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, force_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest)) { + return super.equals(obj); + } + com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest other = + (com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (getForce() != other.getForce()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (37 * hash) + FORCE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getForce()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for deleting a workstation cluster.
+   * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest) + com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_DeleteWorkstationClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_DeleteWorkstationClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest.class, + com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest.Builder.class); + } + + // Construct using + // com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + validateOnly_ = false; + etag_ = ""; + force_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_DeleteWorkstationClusterRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest + getDefaultInstanceForType() { + return com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest build() { + com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest buildPartial() { + com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest result = + new com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.validateOnly_ = validateOnly_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.force_ = force_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest) { + return mergeFrom( + (com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest other) { + if (other + == com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getForce() != false) { + setForce(other.getForce()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + force_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the workstation cluster to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the workstation cluster to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the workstation cluster to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the workstation cluster to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the workstation cluster to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * If set, validate the request and preview the review, but do not apply it.
+     * 
+ * + * bool validate_only = 2; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * If set, validate the request and preview the review, but do not apply it.
+     * 
+ * + * bool validate_only = 2; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * If set, validate the request and preview the review, but do not apply it.
+     * 
+ * + * bool validate_only = 2; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000002); + validateOnly_ = false; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * If set, the request will be rejected if the latest version of the
+     * workstation cluster on the server does not have this etag.
+     * 
+ * + * string etag = 3; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * If set, the request will be rejected if the latest version of the
+     * workstation cluster on the server does not have this etag.
+     * 
+ * + * string etag = 3; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * If set, the request will be rejected if the latest version of the
+     * workstation cluster on the server does not have this etag.
+     * 
+ * + * string etag = 3; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * If set, the request will be rejected if the latest version of the
+     * workstation cluster on the server does not have this etag.
+     * 
+ * + * string etag = 3; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * If set, the request will be rejected if the latest version of the
+     * workstation cluster on the server does not have this etag.
+     * 
+ * + * string etag = 3; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean force_; + /** + * + * + *
+     * If set, any workstation configurations and workstations in the
+     * workstation cluster are also deleted. Otherwise, the request only
+     * works if the workstation cluster has no configurations or workstations.
+     * 
+ * + * bool force = 4; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + /** + * + * + *
+     * If set, any workstation configurations and workstations in the
+     * workstation cluster are also deleted. Otherwise, the request only
+     * works if the workstation cluster has no configurations or workstations.
+     * 
+ * + * bool force = 4; + * + * @param value The force to set. + * @return This builder for chaining. + */ + public Builder setForce(boolean value) { + + force_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * If set, any workstation configurations and workstations in the
+     * workstation cluster are also deleted. Otherwise, the request only
+     * works if the workstation cluster has no configurations or workstations.
+     * 
+ * + * bool force = 4; + * + * @return This builder for chaining. + */ + public Builder clearForce() { + bitField0_ = (bitField0_ & ~0x00000008); + force_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest) + private static final com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest(); + } + + public static com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteWorkstationClusterRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/DeleteWorkstationClusterRequestOrBuilder.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/DeleteWorkstationClusterRequestOrBuilder.java new file mode 100644 index 000000000000..41d2bcf52e1b --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/DeleteWorkstationClusterRequestOrBuilder.java @@ -0,0 +1,109 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +public interface DeleteWorkstationClusterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the workstation cluster to delete.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the workstation cluster to delete.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * If set, validate the request and preview the review, but do not apply it.
+   * 
+ * + * bool validate_only = 2; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + /** + * + * + *
+   * If set, the request will be rejected if the latest version of the
+   * workstation cluster on the server does not have this etag.
+   * 
+ * + * string etag = 3; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * If set, the request will be rejected if the latest version of the
+   * workstation cluster on the server does not have this etag.
+   * 
+ * + * string etag = 3; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * If set, any workstation configurations and workstations in the
+   * workstation cluster are also deleted. Otherwise, the request only
+   * works if the workstation cluster has no configurations or workstations.
+   * 
+ * + * bool force = 4; + * + * @return The force. + */ + boolean getForce(); +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/DeleteWorkstationConfigRequest.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/DeleteWorkstationConfigRequest.java new file mode 100644 index 000000000000..b1b7c188c03a --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/DeleteWorkstationConfigRequest.java @@ -0,0 +1,1039 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +/** + * + * + *
+ * Message for deleting a workstation configuration.
+ * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest} + */ +public final class DeleteWorkstationConfigRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest) + DeleteWorkstationConfigRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteWorkstationConfigRequest.newBuilder() to construct. + private DeleteWorkstationConfigRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteWorkstationConfigRequest() { + name_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteWorkstationConfigRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_DeleteWorkstationConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_DeleteWorkstationConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest.class, + com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Name of the config to delete.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the config to delete.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 2; + private boolean validateOnly_ = false; + /** + * + * + *
+   * If set, validate the request and preview the review, but do not actually
+   * apply it.
+   * 
+ * + * bool validate_only = 2; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + public static final int ETAG_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * If set, the request will be rejected if the latest version of the config on
+   * the server does not have this etag.
+   * 
+ * + * string etag = 3; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * If set, the request will be rejected if the latest version of the config on
+   * the server does not have this etag.
+   * 
+ * + * string etag = 3; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FORCE_FIELD_NUMBER = 4; + private boolean force_ = false; + /** + * + * + *
+   * If set, any Workstations in the config will also be deleted. Otherwise,
+   * the request will work only if the config has no workstations.
+   * 
+ * + * bool force = 4; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (validateOnly_ != false) { + output.writeBool(2, validateOnly_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, etag_); + } + if (force_ != false) { + output.writeBool(4, force_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, validateOnly_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, etag_); + } + if (force_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, force_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest)) { + return super.equals(obj); + } + com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest other = + (com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (getForce() != other.getForce()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (37 * hash) + FORCE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getForce()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for deleting a workstation configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest) + com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_DeleteWorkstationConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_DeleteWorkstationConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest.class, + com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest.Builder.class); + } + + // Construct using + // com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + validateOnly_ = false; + etag_ = ""; + force_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_DeleteWorkstationConfigRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest + getDefaultInstanceForType() { + return com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest build() { + com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest buildPartial() { + com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest result = + new com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.validateOnly_ = validateOnly_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.force_ = force_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest) { + return mergeFrom( + (com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest other) { + if (other + == com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getForce() != false) { + setForce(other.getForce()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + force_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the config to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the config to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the config to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the config to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the config to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * If set, validate the request and preview the review, but do not actually
+     * apply it.
+     * 
+ * + * bool validate_only = 2; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * If set, validate the request and preview the review, but do not actually
+     * apply it.
+     * 
+ * + * bool validate_only = 2; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * If set, validate the request and preview the review, but do not actually
+     * apply it.
+     * 
+ * + * bool validate_only = 2; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000002); + validateOnly_ = false; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * If set, the request will be rejected if the latest version of the config on
+     * the server does not have this etag.
+     * 
+ * + * string etag = 3; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * If set, the request will be rejected if the latest version of the config on
+     * the server does not have this etag.
+     * 
+ * + * string etag = 3; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * If set, the request will be rejected if the latest version of the config on
+     * the server does not have this etag.
+     * 
+ * + * string etag = 3; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * If set, the request will be rejected if the latest version of the config on
+     * the server does not have this etag.
+     * 
+ * + * string etag = 3; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * If set, the request will be rejected if the latest version of the config on
+     * the server does not have this etag.
+     * 
+ * + * string etag = 3; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean force_; + /** + * + * + *
+     * If set, any Workstations in the config will also be deleted. Otherwise,
+     * the request will work only if the config has no workstations.
+     * 
+ * + * bool force = 4; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + /** + * + * + *
+     * If set, any Workstations in the config will also be deleted. Otherwise,
+     * the request will work only if the config has no workstations.
+     * 
+ * + * bool force = 4; + * + * @param value The force to set. + * @return This builder for chaining. + */ + public Builder setForce(boolean value) { + + force_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * If set, any Workstations in the config will also be deleted. Otherwise,
+     * the request will work only if the config has no workstations.
+     * 
+ * + * bool force = 4; + * + * @return This builder for chaining. + */ + public Builder clearForce() { + bitField0_ = (bitField0_ & ~0x00000008); + force_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest) + private static final com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest(); + } + + public static com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteWorkstationConfigRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/DeleteWorkstationConfigRequestOrBuilder.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/DeleteWorkstationConfigRequestOrBuilder.java new file mode 100644 index 000000000000..fb167b7595bb --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/DeleteWorkstationConfigRequestOrBuilder.java @@ -0,0 +1,109 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +public interface DeleteWorkstationConfigRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the config to delete.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the config to delete.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * If set, validate the request and preview the review, but do not actually
+   * apply it.
+   * 
+ * + * bool validate_only = 2; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + /** + * + * + *
+   * If set, the request will be rejected if the latest version of the config on
+   * the server does not have this etag.
+   * 
+ * + * string etag = 3; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * If set, the request will be rejected if the latest version of the config on
+   * the server does not have this etag.
+   * 
+ * + * string etag = 3; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * If set, any Workstations in the config will also be deleted. Otherwise,
+   * the request will work only if the config has no workstations.
+   * 
+ * + * bool force = 4; + * + * @return The force. + */ + boolean getForce(); +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/DeleteWorkstationRequest.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/DeleteWorkstationRequest.java new file mode 100644 index 000000000000..04334e636837 --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/DeleteWorkstationRequest.java @@ -0,0 +1,934 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +/** + * + * + *
+ * Request message for DeleteWorkstation.
+ * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.DeleteWorkstationRequest} + */ +public final class DeleteWorkstationRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workstations.v1beta.DeleteWorkstationRequest) + DeleteWorkstationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteWorkstationRequest.newBuilder() to construct. + private DeleteWorkstationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteWorkstationRequest() { + name_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteWorkstationRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_DeleteWorkstationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_DeleteWorkstationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.DeleteWorkstationRequest.class, + com.google.cloud.workstations.v1beta.DeleteWorkstationRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Name of the workstation to delete.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the workstation to delete.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 2; + private boolean validateOnly_ = false; + /** + * + * + *
+   * If set, validate the request and preview the review, but do not actually
+   * apply it.
+   * 
+ * + * bool validate_only = 2; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + public static final int ETAG_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * If set, the request will be rejected if the latest version of the
+   * workstation on the server does not have this etag.
+   * 
+ * + * string etag = 3; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * If set, the request will be rejected if the latest version of the
+   * workstation on the server does not have this etag.
+   * 
+ * + * string etag = 3; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (validateOnly_ != false) { + output.writeBool(2, validateOnly_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, etag_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, validateOnly_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, etag_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workstations.v1beta.DeleteWorkstationRequest)) { + return super.equals(obj); + } + com.google.cloud.workstations.v1beta.DeleteWorkstationRequest other = + (com.google.cloud.workstations.v1beta.DeleteWorkstationRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workstations.v1beta.DeleteWorkstationRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.DeleteWorkstationRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.DeleteWorkstationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.DeleteWorkstationRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.DeleteWorkstationRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.DeleteWorkstationRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.DeleteWorkstationRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.DeleteWorkstationRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.DeleteWorkstationRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.DeleteWorkstationRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.DeleteWorkstationRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.DeleteWorkstationRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workstations.v1beta.DeleteWorkstationRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for DeleteWorkstation.
+   * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.DeleteWorkstationRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workstations.v1beta.DeleteWorkstationRequest) + com.google.cloud.workstations.v1beta.DeleteWorkstationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_DeleteWorkstationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_DeleteWorkstationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.DeleteWorkstationRequest.class, + com.google.cloud.workstations.v1beta.DeleteWorkstationRequest.Builder.class); + } + + // Construct using com.google.cloud.workstations.v1beta.DeleteWorkstationRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + validateOnly_ = false; + etag_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_DeleteWorkstationRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.DeleteWorkstationRequest + getDefaultInstanceForType() { + return com.google.cloud.workstations.v1beta.DeleteWorkstationRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.DeleteWorkstationRequest build() { + com.google.cloud.workstations.v1beta.DeleteWorkstationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.DeleteWorkstationRequest buildPartial() { + com.google.cloud.workstations.v1beta.DeleteWorkstationRequest result = + new com.google.cloud.workstations.v1beta.DeleteWorkstationRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.workstations.v1beta.DeleteWorkstationRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.validateOnly_ = validateOnly_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.etag_ = etag_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workstations.v1beta.DeleteWorkstationRequest) { + return mergeFrom((com.google.cloud.workstations.v1beta.DeleteWorkstationRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.workstations.v1beta.DeleteWorkstationRequest other) { + if (other + == com.google.cloud.workstations.v1beta.DeleteWorkstationRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the workstation to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the workstation to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the workstation to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the workstation to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the workstation to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * If set, validate the request and preview the review, but do not actually
+     * apply it.
+     * 
+ * + * bool validate_only = 2; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * If set, validate the request and preview the review, but do not actually
+     * apply it.
+     * 
+ * + * bool validate_only = 2; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * If set, validate the request and preview the review, but do not actually
+     * apply it.
+     * 
+ * + * bool validate_only = 2; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000002); + validateOnly_ = false; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * If set, the request will be rejected if the latest version of the
+     * workstation on the server does not have this etag.
+     * 
+ * + * string etag = 3; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * If set, the request will be rejected if the latest version of the
+     * workstation on the server does not have this etag.
+     * 
+ * + * string etag = 3; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * If set, the request will be rejected if the latest version of the
+     * workstation on the server does not have this etag.
+     * 
+ * + * string etag = 3; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * If set, the request will be rejected if the latest version of the
+     * workstation on the server does not have this etag.
+     * 
+ * + * string etag = 3; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * If set, the request will be rejected if the latest version of the
+     * workstation on the server does not have this etag.
+     * 
+ * + * string etag = 3; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workstations.v1beta.DeleteWorkstationRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workstations.v1beta.DeleteWorkstationRequest) + private static final com.google.cloud.workstations.v1beta.DeleteWorkstationRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workstations.v1beta.DeleteWorkstationRequest(); + } + + public static com.google.cloud.workstations.v1beta.DeleteWorkstationRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteWorkstationRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.DeleteWorkstationRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/DeleteWorkstationRequestOrBuilder.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/DeleteWorkstationRequestOrBuilder.java new file mode 100644 index 000000000000..7f39eea8b194 --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/DeleteWorkstationRequestOrBuilder.java @@ -0,0 +1,95 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +public interface DeleteWorkstationRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workstations.v1beta.DeleteWorkstationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the workstation to delete.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the workstation to delete.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * If set, validate the request and preview the review, but do not actually
+   * apply it.
+   * 
+ * + * bool validate_only = 2; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + /** + * + * + *
+   * If set, the request will be rejected if the latest version of the
+   * workstation on the server does not have this etag.
+   * 
+ * + * string etag = 3; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * If set, the request will be rejected if the latest version of the
+   * workstation on the server does not have this etag.
+   * 
+ * + * string etag = 3; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/GenerateAccessTokenRequest.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/GenerateAccessTokenRequest.java new file mode 100644 index 000000000000..93d127abc9ff --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/GenerateAccessTokenRequest.java @@ -0,0 +1,1379 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +/** + * + * + *
+ * Request message for GenerateAccessToken.
+ * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.GenerateAccessTokenRequest} + */ +public final class GenerateAccessTokenRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workstations.v1beta.GenerateAccessTokenRequest) + GenerateAccessTokenRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GenerateAccessTokenRequest.newBuilder() to construct. + private GenerateAccessTokenRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GenerateAccessTokenRequest() { + workstation_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GenerateAccessTokenRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_GenerateAccessTokenRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_GenerateAccessTokenRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest.class, + com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest.Builder.class); + } + + private int expirationCase_ = 0; + private java.lang.Object expiration_; + + public enum ExpirationCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + EXPIRE_TIME(2), + TTL(3), + EXPIRATION_NOT_SET(0); + private final int value; + + private ExpirationCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ExpirationCase valueOf(int value) { + return forNumber(value); + } + + public static ExpirationCase forNumber(int value) { + switch (value) { + case 2: + return EXPIRE_TIME; + case 3: + return TTL; + case 0: + return EXPIRATION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ExpirationCase getExpirationCase() { + return ExpirationCase.forNumber(expirationCase_); + } + + public static final int WORKSTATION_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object workstation_ = ""; + /** + * + * + *
+   * Required. Name of the workstation for which the access token should be
+   * generated.
+   * 
+ * + * + * string workstation = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The workstation. + */ + @java.lang.Override + public java.lang.String getWorkstation() { + java.lang.Object ref = workstation_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + workstation_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the workstation for which the access token should be
+   * generated.
+   * 
+ * + * + * string workstation = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for workstation. + */ + @java.lang.Override + public com.google.protobuf.ByteString getWorkstationBytes() { + java.lang.Object ref = workstation_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + workstation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXPIRE_TIME_FIELD_NUMBER = 2; + /** + * + * + *
+   * Desired expiration time of the access token. This value must
+   * be at most 24 hours in the future. If a value is not specified, the
+   * token's expiration time will be set to a default value of 1 hour in the
+   * future.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + * + * @return Whether the expireTime field is set. + */ + @java.lang.Override + public boolean hasExpireTime() { + return expirationCase_ == 2; + } + /** + * + * + *
+   * Desired expiration time of the access token. This value must
+   * be at most 24 hours in the future. If a value is not specified, the
+   * token's expiration time will be set to a default value of 1 hour in the
+   * future.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + * + * @return The expireTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExpireTime() { + if (expirationCase_ == 2) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + /** + * + * + *
+   * Desired expiration time of the access token. This value must
+   * be at most 24 hours in the future. If a value is not specified, the
+   * token's expiration time will be set to a default value of 1 hour in the
+   * future.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + if (expirationCase_ == 2) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + + public static final int TTL_FIELD_NUMBER = 3; + /** + * + * + *
+   * Desired lifetime duration of the access token. This value must
+   * be at most 24 hours. If a value is not specified, the token's lifetime
+   * will be set to a default value of 1 hour.
+   * 
+ * + * .google.protobuf.Duration ttl = 3; + * + * @return Whether the ttl field is set. + */ + @java.lang.Override + public boolean hasTtl() { + return expirationCase_ == 3; + } + /** + * + * + *
+   * Desired lifetime duration of the access token. This value must
+   * be at most 24 hours. If a value is not specified, the token's lifetime
+   * will be set to a default value of 1 hour.
+   * 
+ * + * .google.protobuf.Duration ttl = 3; + * + * @return The ttl. + */ + @java.lang.Override + public com.google.protobuf.Duration getTtl() { + if (expirationCase_ == 3) { + return (com.google.protobuf.Duration) expiration_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + /** + * + * + *
+   * Desired lifetime duration of the access token. This value must
+   * be at most 24 hours. If a value is not specified, the token's lifetime
+   * will be set to a default value of 1 hour.
+   * 
+ * + * .google.protobuf.Duration ttl = 3; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getTtlOrBuilder() { + if (expirationCase_ == 3) { + return (com.google.protobuf.Duration) expiration_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(workstation_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, workstation_); + } + if (expirationCase_ == 2) { + output.writeMessage(2, (com.google.protobuf.Timestamp) expiration_); + } + if (expirationCase_ == 3) { + output.writeMessage(3, (com.google.protobuf.Duration) expiration_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(workstation_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, workstation_); + } + if (expirationCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.protobuf.Timestamp) expiration_); + } + if (expirationCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.protobuf.Duration) expiration_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest)) { + return super.equals(obj); + } + com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest other = + (com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest) obj; + + if (!getWorkstation().equals(other.getWorkstation())) return false; + if (!getExpirationCase().equals(other.getExpirationCase())) return false; + switch (expirationCase_) { + case 2: + if (!getExpireTime().equals(other.getExpireTime())) return false; + break; + case 3: + if (!getTtl().equals(other.getTtl())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + WORKSTATION_FIELD_NUMBER; + hash = (53 * hash) + getWorkstation().hashCode(); + switch (expirationCase_) { + case 2: + hash = (37 * hash) + EXPIRE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getExpireTime().hashCode(); + break; + case 3: + hash = (37 * hash) + TTL_FIELD_NUMBER; + hash = (53 * hash) + getTtl().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for GenerateAccessToken.
+   * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.GenerateAccessTokenRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workstations.v1beta.GenerateAccessTokenRequest) + com.google.cloud.workstations.v1beta.GenerateAccessTokenRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_GenerateAccessTokenRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_GenerateAccessTokenRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest.class, + com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest.Builder.class); + } + + // Construct using com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + workstation_ = ""; + if (expireTimeBuilder_ != null) { + expireTimeBuilder_.clear(); + } + if (ttlBuilder_ != null) { + ttlBuilder_.clear(); + } + expirationCase_ = 0; + expiration_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_GenerateAccessTokenRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest + getDefaultInstanceForType() { + return com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest build() { + com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest buildPartial() { + com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest result = + new com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.workstation_ = workstation_; + } + } + + private void buildPartialOneofs( + com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest result) { + result.expirationCase_ = expirationCase_; + result.expiration_ = this.expiration_; + if (expirationCase_ == 2 && expireTimeBuilder_ != null) { + result.expiration_ = expireTimeBuilder_.build(); + } + if (expirationCase_ == 3 && ttlBuilder_ != null) { + result.expiration_ = ttlBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest) { + return mergeFrom((com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest other) { + if (other + == com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest.getDefaultInstance()) + return this; + if (!other.getWorkstation().isEmpty()) { + workstation_ = other.workstation_; + bitField0_ |= 0x00000001; + onChanged(); + } + switch (other.getExpirationCase()) { + case EXPIRE_TIME: + { + mergeExpireTime(other.getExpireTime()); + break; + } + case TTL: + { + mergeTtl(other.getTtl()); + break; + } + case EXPIRATION_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + workstation_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getExpireTimeFieldBuilder().getBuilder(), extensionRegistry); + expirationCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage(getTtlFieldBuilder().getBuilder(), extensionRegistry); + expirationCase_ = 3; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int expirationCase_ = 0; + private java.lang.Object expiration_; + + public ExpirationCase getExpirationCase() { + return ExpirationCase.forNumber(expirationCase_); + } + + public Builder clearExpiration() { + expirationCase_ = 0; + expiration_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object workstation_ = ""; + /** + * + * + *
+     * Required. Name of the workstation for which the access token should be
+     * generated.
+     * 
+ * + * + * string workstation = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The workstation. + */ + public java.lang.String getWorkstation() { + java.lang.Object ref = workstation_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + workstation_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the workstation for which the access token should be
+     * generated.
+     * 
+ * + * + * string workstation = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for workstation. + */ + public com.google.protobuf.ByteString getWorkstationBytes() { + java.lang.Object ref = workstation_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + workstation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the workstation for which the access token should be
+     * generated.
+     * 
+ * + * + * string workstation = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The workstation to set. + * @return This builder for chaining. + */ + public Builder setWorkstation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + workstation_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the workstation for which the access token should be
+     * generated.
+     * 
+ * + * + * string workstation = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearWorkstation() { + workstation_ = getDefaultInstance().getWorkstation(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the workstation for which the access token should be
+     * generated.
+     * 
+ * + * + * string workstation = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for workstation to set. + * @return This builder for chaining. + */ + public Builder setWorkstationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + workstation_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + expireTimeBuilder_; + /** + * + * + *
+     * Desired expiration time of the access token. This value must
+     * be at most 24 hours in the future. If a value is not specified, the
+     * token's expiration time will be set to a default value of 1 hour in the
+     * future.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + * + * @return Whether the expireTime field is set. + */ + @java.lang.Override + public boolean hasExpireTime() { + return expirationCase_ == 2; + } + /** + * + * + *
+     * Desired expiration time of the access token. This value must
+     * be at most 24 hours in the future. If a value is not specified, the
+     * token's expiration time will be set to a default value of 1 hour in the
+     * future.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + * + * @return The expireTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExpireTime() { + if (expireTimeBuilder_ == null) { + if (expirationCase_ == 2) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } else { + if (expirationCase_ == 2) { + return expireTimeBuilder_.getMessage(); + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + /** + * + * + *
+     * Desired expiration time of the access token. This value must
+     * be at most 24 hours in the future. If a value is not specified, the
+     * token's expiration time will be set to a default value of 1 hour in the
+     * future.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + public Builder setExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expiration_ = value; + onChanged(); + } else { + expireTimeBuilder_.setMessage(value); + } + expirationCase_ = 2; + return this; + } + /** + * + * + *
+     * Desired expiration time of the access token. This value must
+     * be at most 24 hours in the future. If a value is not specified, the
+     * token's expiration time will be set to a default value of 1 hour in the
+     * future.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + public Builder setExpireTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (expireTimeBuilder_ == null) { + expiration_ = builderForValue.build(); + onChanged(); + } else { + expireTimeBuilder_.setMessage(builderForValue.build()); + } + expirationCase_ = 2; + return this; + } + /** + * + * + *
+     * Desired expiration time of the access token. This value must
+     * be at most 24 hours in the future. If a value is not specified, the
+     * token's expiration time will be set to a default value of 1 hour in the
+     * future.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + public Builder mergeExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (expirationCase_ == 2 + && expiration_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + expiration_ = + com.google.protobuf.Timestamp.newBuilder((com.google.protobuf.Timestamp) expiration_) + .mergeFrom(value) + .buildPartial(); + } else { + expiration_ = value; + } + onChanged(); + } else { + if (expirationCase_ == 2) { + expireTimeBuilder_.mergeFrom(value); + } else { + expireTimeBuilder_.setMessage(value); + } + } + expirationCase_ = 2; + return this; + } + /** + * + * + *
+     * Desired expiration time of the access token. This value must
+     * be at most 24 hours in the future. If a value is not specified, the
+     * token's expiration time will be set to a default value of 1 hour in the
+     * future.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + public Builder clearExpireTime() { + if (expireTimeBuilder_ == null) { + if (expirationCase_ == 2) { + expirationCase_ = 0; + expiration_ = null; + onChanged(); + } + } else { + if (expirationCase_ == 2) { + expirationCase_ = 0; + expiration_ = null; + } + expireTimeBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Desired expiration time of the access token. This value must
+     * be at most 24 hours in the future. If a value is not specified, the
+     * token's expiration time will be set to a default value of 1 hour in the
+     * future.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getExpireTimeBuilder() { + return getExpireTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Desired expiration time of the access token. This value must
+     * be at most 24 hours in the future. If a value is not specified, the
+     * token's expiration time will be set to a default value of 1 hour in the
+     * future.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + if ((expirationCase_ == 2) && (expireTimeBuilder_ != null)) { + return expireTimeBuilder_.getMessageOrBuilder(); + } else { + if (expirationCase_ == 2) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + /** + * + * + *
+     * Desired expiration time of the access token. This value must
+     * be at most 24 hours in the future. If a value is not specified, the
+     * token's expiration time will be set to a default value of 1 hour in the
+     * future.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getExpireTimeFieldBuilder() { + if (expireTimeBuilder_ == null) { + if (!(expirationCase_ == 2)) { + expiration_ = com.google.protobuf.Timestamp.getDefaultInstance(); + } + expireTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + (com.google.protobuf.Timestamp) expiration_, getParentForChildren(), isClean()); + expiration_ = null; + } + expirationCase_ = 2; + onChanged(); + return expireTimeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + ttlBuilder_; + /** + * + * + *
+     * Desired lifetime duration of the access token. This value must
+     * be at most 24 hours. If a value is not specified, the token's lifetime
+     * will be set to a default value of 1 hour.
+     * 
+ * + * .google.protobuf.Duration ttl = 3; + * + * @return Whether the ttl field is set. + */ + @java.lang.Override + public boolean hasTtl() { + return expirationCase_ == 3; + } + /** + * + * + *
+     * Desired lifetime duration of the access token. This value must
+     * be at most 24 hours. If a value is not specified, the token's lifetime
+     * will be set to a default value of 1 hour.
+     * 
+ * + * .google.protobuf.Duration ttl = 3; + * + * @return The ttl. + */ + @java.lang.Override + public com.google.protobuf.Duration getTtl() { + if (ttlBuilder_ == null) { + if (expirationCase_ == 3) { + return (com.google.protobuf.Duration) expiration_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } else { + if (expirationCase_ == 3) { + return ttlBuilder_.getMessage(); + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + } + /** + * + * + *
+     * Desired lifetime duration of the access token. This value must
+     * be at most 24 hours. If a value is not specified, the token's lifetime
+     * will be set to a default value of 1 hour.
+     * 
+ * + * .google.protobuf.Duration ttl = 3; + */ + public Builder setTtl(com.google.protobuf.Duration value) { + if (ttlBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expiration_ = value; + onChanged(); + } else { + ttlBuilder_.setMessage(value); + } + expirationCase_ = 3; + return this; + } + /** + * + * + *
+     * Desired lifetime duration of the access token. This value must
+     * be at most 24 hours. If a value is not specified, the token's lifetime
+     * will be set to a default value of 1 hour.
+     * 
+ * + * .google.protobuf.Duration ttl = 3; + */ + public Builder setTtl(com.google.protobuf.Duration.Builder builderForValue) { + if (ttlBuilder_ == null) { + expiration_ = builderForValue.build(); + onChanged(); + } else { + ttlBuilder_.setMessage(builderForValue.build()); + } + expirationCase_ = 3; + return this; + } + /** + * + * + *
+     * Desired lifetime duration of the access token. This value must
+     * be at most 24 hours. If a value is not specified, the token's lifetime
+     * will be set to a default value of 1 hour.
+     * 
+ * + * .google.protobuf.Duration ttl = 3; + */ + public Builder mergeTtl(com.google.protobuf.Duration value) { + if (ttlBuilder_ == null) { + if (expirationCase_ == 3 + && expiration_ != com.google.protobuf.Duration.getDefaultInstance()) { + expiration_ = + com.google.protobuf.Duration.newBuilder((com.google.protobuf.Duration) expiration_) + .mergeFrom(value) + .buildPartial(); + } else { + expiration_ = value; + } + onChanged(); + } else { + if (expirationCase_ == 3) { + ttlBuilder_.mergeFrom(value); + } else { + ttlBuilder_.setMessage(value); + } + } + expirationCase_ = 3; + return this; + } + /** + * + * + *
+     * Desired lifetime duration of the access token. This value must
+     * be at most 24 hours. If a value is not specified, the token's lifetime
+     * will be set to a default value of 1 hour.
+     * 
+ * + * .google.protobuf.Duration ttl = 3; + */ + public Builder clearTtl() { + if (ttlBuilder_ == null) { + if (expirationCase_ == 3) { + expirationCase_ = 0; + expiration_ = null; + onChanged(); + } + } else { + if (expirationCase_ == 3) { + expirationCase_ = 0; + expiration_ = null; + } + ttlBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Desired lifetime duration of the access token. This value must
+     * be at most 24 hours. If a value is not specified, the token's lifetime
+     * will be set to a default value of 1 hour.
+     * 
+ * + * .google.protobuf.Duration ttl = 3; + */ + public com.google.protobuf.Duration.Builder getTtlBuilder() { + return getTtlFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Desired lifetime duration of the access token. This value must
+     * be at most 24 hours. If a value is not specified, the token's lifetime
+     * will be set to a default value of 1 hour.
+     * 
+ * + * .google.protobuf.Duration ttl = 3; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getTtlOrBuilder() { + if ((expirationCase_ == 3) && (ttlBuilder_ != null)) { + return ttlBuilder_.getMessageOrBuilder(); + } else { + if (expirationCase_ == 3) { + return (com.google.protobuf.Duration) expiration_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + } + /** + * + * + *
+     * Desired lifetime duration of the access token. This value must
+     * be at most 24 hours. If a value is not specified, the token's lifetime
+     * will be set to a default value of 1 hour.
+     * 
+ * + * .google.protobuf.Duration ttl = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getTtlFieldBuilder() { + if (ttlBuilder_ == null) { + if (!(expirationCase_ == 3)) { + expiration_ = com.google.protobuf.Duration.getDefaultInstance(); + } + ttlBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + (com.google.protobuf.Duration) expiration_, getParentForChildren(), isClean()); + expiration_ = null; + } + expirationCase_ = 3; + onChanged(); + return ttlBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workstations.v1beta.GenerateAccessTokenRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workstations.v1beta.GenerateAccessTokenRequest) + private static final com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest(); + } + + public static com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GenerateAccessTokenRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/GenerateAccessTokenRequestOrBuilder.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/GenerateAccessTokenRequestOrBuilder.java new file mode 100644 index 000000000000..36fee83bf830 --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/GenerateAccessTokenRequestOrBuilder.java @@ -0,0 +1,144 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +public interface GenerateAccessTokenRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workstations.v1beta.GenerateAccessTokenRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the workstation for which the access token should be
+   * generated.
+   * 
+ * + * + * string workstation = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The workstation. + */ + java.lang.String getWorkstation(); + /** + * + * + *
+   * Required. Name of the workstation for which the access token should be
+   * generated.
+   * 
+ * + * + * string workstation = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for workstation. + */ + com.google.protobuf.ByteString getWorkstationBytes(); + + /** + * + * + *
+   * Desired expiration time of the access token. This value must
+   * be at most 24 hours in the future. If a value is not specified, the
+   * token's expiration time will be set to a default value of 1 hour in the
+   * future.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + * + * @return Whether the expireTime field is set. + */ + boolean hasExpireTime(); + /** + * + * + *
+   * Desired expiration time of the access token. This value must
+   * be at most 24 hours in the future. If a value is not specified, the
+   * token's expiration time will be set to a default value of 1 hour in the
+   * future.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + * + * @return The expireTime. + */ + com.google.protobuf.Timestamp getExpireTime(); + /** + * + * + *
+   * Desired expiration time of the access token. This value must
+   * be at most 24 hours in the future. If a value is not specified, the
+   * token's expiration time will be set to a default value of 1 hour in the
+   * future.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder(); + + /** + * + * + *
+   * Desired lifetime duration of the access token. This value must
+   * be at most 24 hours. If a value is not specified, the token's lifetime
+   * will be set to a default value of 1 hour.
+   * 
+ * + * .google.protobuf.Duration ttl = 3; + * + * @return Whether the ttl field is set. + */ + boolean hasTtl(); + /** + * + * + *
+   * Desired lifetime duration of the access token. This value must
+   * be at most 24 hours. If a value is not specified, the token's lifetime
+   * will be set to a default value of 1 hour.
+   * 
+ * + * .google.protobuf.Duration ttl = 3; + * + * @return The ttl. + */ + com.google.protobuf.Duration getTtl(); + /** + * + * + *
+   * Desired lifetime duration of the access token. This value must
+   * be at most 24 hours. If a value is not specified, the token's lifetime
+   * will be set to a default value of 1 hour.
+   * 
+ * + * .google.protobuf.Duration ttl = 3; + */ + com.google.protobuf.DurationOrBuilder getTtlOrBuilder(); + + public com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest.ExpirationCase + getExpirationCase(); +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/GenerateAccessTokenResponse.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/GenerateAccessTokenResponse.java new file mode 100644 index 000000000000..fe285b0f20e6 --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/GenerateAccessTokenResponse.java @@ -0,0 +1,918 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +/** + * + * + *
+ * Response message for GenerateAccessToken.
+ * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.GenerateAccessTokenResponse} + */ +public final class GenerateAccessTokenResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workstations.v1beta.GenerateAccessTokenResponse) + GenerateAccessTokenResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use GenerateAccessTokenResponse.newBuilder() to construct. + private GenerateAccessTokenResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GenerateAccessTokenResponse() { + accessToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GenerateAccessTokenResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_GenerateAccessTokenResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_GenerateAccessTokenResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse.class, + com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse.Builder.class); + } + + public static final int ACCESS_TOKEN_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object accessToken_ = ""; + /** + * + * + *
+   * The generated bearer access token. To use this token, include it in an
+   * Authorization header of an HTTP request sent to the associated
+   * workstation's hostname, for example, `Authorization: Bearer
+   * <access_token>`.
+   * 
+ * + * string access_token = 1; + * + * @return The accessToken. + */ + @java.lang.Override + public java.lang.String getAccessToken() { + java.lang.Object ref = accessToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + accessToken_ = s; + return s; + } + } + /** + * + * + *
+   * The generated bearer access token. To use this token, include it in an
+   * Authorization header of an HTTP request sent to the associated
+   * workstation's hostname, for example, `Authorization: Bearer
+   * <access_token>`.
+   * 
+ * + * string access_token = 1; + * + * @return The bytes for accessToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAccessTokenBytes() { + java.lang.Object ref = accessToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + accessToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXPIRE_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp expireTime_; + /** + * + * + *
+   * Time at which the generated token will expire.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + * + * @return Whether the expireTime field is set. + */ + @java.lang.Override + public boolean hasExpireTime() { + return expireTime_ != null; + } + /** + * + * + *
+   * Time at which the generated token will expire.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + * + * @return The expireTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExpireTime() { + return expireTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expireTime_; + } + /** + * + * + *
+   * Time at which the generated token will expire.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + return expireTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expireTime_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(accessToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, accessToken_); + } + if (expireTime_ != null) { + output.writeMessage(2, getExpireTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(accessToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, accessToken_); + } + if (expireTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getExpireTime()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse)) { + return super.equals(obj); + } + com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse other = + (com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse) obj; + + if (!getAccessToken().equals(other.getAccessToken())) return false; + if (hasExpireTime() != other.hasExpireTime()) return false; + if (hasExpireTime()) { + if (!getExpireTime().equals(other.getExpireTime())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ACCESS_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getAccessToken().hashCode(); + if (hasExpireTime()) { + hash = (37 * hash) + EXPIRE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getExpireTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for GenerateAccessToken.
+   * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.GenerateAccessTokenResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workstations.v1beta.GenerateAccessTokenResponse) + com.google.cloud.workstations.v1beta.GenerateAccessTokenResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_GenerateAccessTokenResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_GenerateAccessTokenResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse.class, + com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse.Builder.class); + } + + // Construct using com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + accessToken_ = ""; + expireTime_ = null; + if (expireTimeBuilder_ != null) { + expireTimeBuilder_.dispose(); + expireTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_GenerateAccessTokenResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse + getDefaultInstanceForType() { + return com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse build() { + com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse buildPartial() { + com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse result = + new com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.accessToken_ = accessToken_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.expireTime_ = expireTimeBuilder_ == null ? expireTime_ : expireTimeBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse) { + return mergeFrom((com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse other) { + if (other + == com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse.getDefaultInstance()) + return this; + if (!other.getAccessToken().isEmpty()) { + accessToken_ = other.accessToken_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasExpireTime()) { + mergeExpireTime(other.getExpireTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + accessToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getExpireTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object accessToken_ = ""; + /** + * + * + *
+     * The generated bearer access token. To use this token, include it in an
+     * Authorization header of an HTTP request sent to the associated
+     * workstation's hostname, for example, `Authorization: Bearer
+     * <access_token>`.
+     * 
+ * + * string access_token = 1; + * + * @return The accessToken. + */ + public java.lang.String getAccessToken() { + java.lang.Object ref = accessToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + accessToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The generated bearer access token. To use this token, include it in an
+     * Authorization header of an HTTP request sent to the associated
+     * workstation's hostname, for example, `Authorization: Bearer
+     * <access_token>`.
+     * 
+ * + * string access_token = 1; + * + * @return The bytes for accessToken. + */ + public com.google.protobuf.ByteString getAccessTokenBytes() { + java.lang.Object ref = accessToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + accessToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The generated bearer access token. To use this token, include it in an
+     * Authorization header of an HTTP request sent to the associated
+     * workstation's hostname, for example, `Authorization: Bearer
+     * <access_token>`.
+     * 
+ * + * string access_token = 1; + * + * @param value The accessToken to set. + * @return This builder for chaining. + */ + public Builder setAccessToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + accessToken_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The generated bearer access token. To use this token, include it in an
+     * Authorization header of an HTTP request sent to the associated
+     * workstation's hostname, for example, `Authorization: Bearer
+     * <access_token>`.
+     * 
+ * + * string access_token = 1; + * + * @return This builder for chaining. + */ + public Builder clearAccessToken() { + accessToken_ = getDefaultInstance().getAccessToken(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The generated bearer access token. To use this token, include it in an
+     * Authorization header of an HTTP request sent to the associated
+     * workstation's hostname, for example, `Authorization: Bearer
+     * <access_token>`.
+     * 
+ * + * string access_token = 1; + * + * @param value The bytes for accessToken to set. + * @return This builder for chaining. + */ + public Builder setAccessTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + accessToken_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp expireTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + expireTimeBuilder_; + /** + * + * + *
+     * Time at which the generated token will expire.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + * + * @return Whether the expireTime field is set. + */ + public boolean hasExpireTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Time at which the generated token will expire.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + * + * @return The expireTime. + */ + public com.google.protobuf.Timestamp getExpireTime() { + if (expireTimeBuilder_ == null) { + return expireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expireTime_; + } else { + return expireTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Time at which the generated token will expire.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + public Builder setExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expireTime_ = value; + } else { + expireTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Time at which the generated token will expire.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + public Builder setExpireTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (expireTimeBuilder_ == null) { + expireTime_ = builderForValue.build(); + } else { + expireTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Time at which the generated token will expire.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + public Builder mergeExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && expireTime_ != null + && expireTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getExpireTimeBuilder().mergeFrom(value); + } else { + expireTime_ = value; + } + } else { + expireTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Time at which the generated token will expire.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + public Builder clearExpireTime() { + bitField0_ = (bitField0_ & ~0x00000002); + expireTime_ = null; + if (expireTimeBuilder_ != null) { + expireTimeBuilder_.dispose(); + expireTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Time at which the generated token will expire.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getExpireTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getExpireTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Time at which the generated token will expire.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + if (expireTimeBuilder_ != null) { + return expireTimeBuilder_.getMessageOrBuilder(); + } else { + return expireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expireTime_; + } + } + /** + * + * + *
+     * Time at which the generated token will expire.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getExpireTimeFieldBuilder() { + if (expireTimeBuilder_ == null) { + expireTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getExpireTime(), getParentForChildren(), isClean()); + expireTime_ = null; + } + return expireTimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workstations.v1beta.GenerateAccessTokenResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workstations.v1beta.GenerateAccessTokenResponse) + private static final com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse(); + } + + public static com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GenerateAccessTokenResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/GenerateAccessTokenResponseOrBuilder.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/GenerateAccessTokenResponseOrBuilder.java new file mode 100644 index 000000000000..e241a80c9b6b --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/GenerateAccessTokenResponseOrBuilder.java @@ -0,0 +1,91 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +public interface GenerateAccessTokenResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workstations.v1beta.GenerateAccessTokenResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The generated bearer access token. To use this token, include it in an
+   * Authorization header of an HTTP request sent to the associated
+   * workstation's hostname, for example, `Authorization: Bearer
+   * <access_token>`.
+   * 
+ * + * string access_token = 1; + * + * @return The accessToken. + */ + java.lang.String getAccessToken(); + /** + * + * + *
+   * The generated bearer access token. To use this token, include it in an
+   * Authorization header of an HTTP request sent to the associated
+   * workstation's hostname, for example, `Authorization: Bearer
+   * <access_token>`.
+   * 
+ * + * string access_token = 1; + * + * @return The bytes for accessToken. + */ + com.google.protobuf.ByteString getAccessTokenBytes(); + + /** + * + * + *
+   * Time at which the generated token will expire.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + * + * @return Whether the expireTime field is set. + */ + boolean hasExpireTime(); + /** + * + * + *
+   * Time at which the generated token will expire.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + * + * @return The expireTime. + */ + com.google.protobuf.Timestamp getExpireTime(); + /** + * + * + *
+   * Time at which the generated token will expire.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder(); +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/GetWorkstationClusterRequest.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/GetWorkstationClusterRequest.java new file mode 100644 index 000000000000..28d7b0098f38 --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/GetWorkstationClusterRequest.java @@ -0,0 +1,653 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +/** + * + * + *
+ * Request message for GetWorkstationCluster.
+ * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.GetWorkstationClusterRequest} + */ +public final class GetWorkstationClusterRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workstations.v1beta.GetWorkstationClusterRequest) + GetWorkstationClusterRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetWorkstationClusterRequest.newBuilder() to construct. + private GetWorkstationClusterRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetWorkstationClusterRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetWorkstationClusterRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_GetWorkstationClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_GetWorkstationClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest.class, + com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Name of the requested resource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the requested resource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest)) { + return super.equals(obj); + } + com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest other = + (com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for GetWorkstationCluster.
+   * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.GetWorkstationClusterRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workstations.v1beta.GetWorkstationClusterRequest) + com.google.cloud.workstations.v1beta.GetWorkstationClusterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_GetWorkstationClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_GetWorkstationClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest.class, + com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest.Builder.class); + } + + // Construct using + // com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_GetWorkstationClusterRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest + getDefaultInstanceForType() { + return com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest build() { + com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest buildPartial() { + com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest result = + new com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest) { + return mergeFrom((com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest other) { + if (other + == com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the requested resource.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the requested resource.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the requested resource.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the requested resource.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the requested resource.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workstations.v1beta.GetWorkstationClusterRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workstations.v1beta.GetWorkstationClusterRequest) + private static final com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest(); + } + + public static com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetWorkstationClusterRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/GetWorkstationClusterRequestOrBuilder.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/GetWorkstationClusterRequestOrBuilder.java new file mode 100644 index 000000000000..383af720206e --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/GetWorkstationClusterRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +public interface GetWorkstationClusterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workstations.v1beta.GetWorkstationClusterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the requested resource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the requested resource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/GetWorkstationConfigRequest.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/GetWorkstationConfigRequest.java new file mode 100644 index 000000000000..1133f4c5f4a9 --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/GetWorkstationConfigRequest.java @@ -0,0 +1,651 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +/** + * + * + *
+ * Request message for GetWorkstationConfig.
+ * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.GetWorkstationConfigRequest} + */ +public final class GetWorkstationConfigRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workstations.v1beta.GetWorkstationConfigRequest) + GetWorkstationConfigRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetWorkstationConfigRequest.newBuilder() to construct. + private GetWorkstationConfigRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetWorkstationConfigRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetWorkstationConfigRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_GetWorkstationConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_GetWorkstationConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest.class, + com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Name of the requested resource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the requested resource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest)) { + return super.equals(obj); + } + com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest other = + (com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for GetWorkstationConfig.
+   * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.GetWorkstationConfigRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workstations.v1beta.GetWorkstationConfigRequest) + com.google.cloud.workstations.v1beta.GetWorkstationConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_GetWorkstationConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_GetWorkstationConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest.class, + com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest.Builder.class); + } + + // Construct using com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_GetWorkstationConfigRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest + getDefaultInstanceForType() { + return com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest build() { + com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest buildPartial() { + com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest result = + new com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest) { + return mergeFrom((com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest other) { + if (other + == com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the requested resource.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the requested resource.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the requested resource.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the requested resource.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the requested resource.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workstations.v1beta.GetWorkstationConfigRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workstations.v1beta.GetWorkstationConfigRequest) + private static final com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest(); + } + + public static com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetWorkstationConfigRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/GetWorkstationConfigRequestOrBuilder.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/GetWorkstationConfigRequestOrBuilder.java new file mode 100644 index 000000000000..ef6852654ac7 --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/GetWorkstationConfigRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +public interface GetWorkstationConfigRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workstations.v1beta.GetWorkstationConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the requested resource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the requested resource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/GetWorkstationRequest.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/GetWorkstationRequest.java new file mode 100644 index 000000000000..6f3c5068b0ec --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/GetWorkstationRequest.java @@ -0,0 +1,644 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +/** + * + * + *
+ * Request message for GetWorkstation.
+ * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.GetWorkstationRequest} + */ +public final class GetWorkstationRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workstations.v1beta.GetWorkstationRequest) + GetWorkstationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetWorkstationRequest.newBuilder() to construct. + private GetWorkstationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetWorkstationRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetWorkstationRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_GetWorkstationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_GetWorkstationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.GetWorkstationRequest.class, + com.google.cloud.workstations.v1beta.GetWorkstationRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Name of the requested resource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the requested resource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workstations.v1beta.GetWorkstationRequest)) { + return super.equals(obj); + } + com.google.cloud.workstations.v1beta.GetWorkstationRequest other = + (com.google.cloud.workstations.v1beta.GetWorkstationRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workstations.v1beta.GetWorkstationRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.GetWorkstationRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.GetWorkstationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.GetWorkstationRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.GetWorkstationRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.GetWorkstationRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.GetWorkstationRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.GetWorkstationRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.GetWorkstationRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.GetWorkstationRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.GetWorkstationRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.GetWorkstationRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workstations.v1beta.GetWorkstationRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for GetWorkstation.
+   * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.GetWorkstationRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workstations.v1beta.GetWorkstationRequest) + com.google.cloud.workstations.v1beta.GetWorkstationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_GetWorkstationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_GetWorkstationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.GetWorkstationRequest.class, + com.google.cloud.workstations.v1beta.GetWorkstationRequest.Builder.class); + } + + // Construct using com.google.cloud.workstations.v1beta.GetWorkstationRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_GetWorkstationRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.GetWorkstationRequest getDefaultInstanceForType() { + return com.google.cloud.workstations.v1beta.GetWorkstationRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.GetWorkstationRequest build() { + com.google.cloud.workstations.v1beta.GetWorkstationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.GetWorkstationRequest buildPartial() { + com.google.cloud.workstations.v1beta.GetWorkstationRequest result = + new com.google.cloud.workstations.v1beta.GetWorkstationRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.workstations.v1beta.GetWorkstationRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workstations.v1beta.GetWorkstationRequest) { + return mergeFrom((com.google.cloud.workstations.v1beta.GetWorkstationRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.workstations.v1beta.GetWorkstationRequest other) { + if (other == com.google.cloud.workstations.v1beta.GetWorkstationRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the requested resource.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the requested resource.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the requested resource.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the requested resource.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the requested resource.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workstations.v1beta.GetWorkstationRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workstations.v1beta.GetWorkstationRequest) + private static final com.google.cloud.workstations.v1beta.GetWorkstationRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workstations.v1beta.GetWorkstationRequest(); + } + + public static com.google.cloud.workstations.v1beta.GetWorkstationRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetWorkstationRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.GetWorkstationRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/GetWorkstationRequestOrBuilder.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/GetWorkstationRequestOrBuilder.java new file mode 100644 index 000000000000..937af8ffac9f --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/GetWorkstationRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +public interface GetWorkstationRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workstations.v1beta.GetWorkstationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the requested resource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the requested resource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListUsableWorkstationConfigsRequest.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListUsableWorkstationConfigsRequest.java new file mode 100644 index 000000000000..496ae38db857 --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListUsableWorkstationConfigsRequest.java @@ -0,0 +1,937 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +/** + * + * + *
+ * Request message for ListUsableWorkstationConfigs.
+ * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest} + */ +public final class ListUsableWorkstationConfigsRequest + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest) + ListUsableWorkstationConfigsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListUsableWorkstationConfigsRequest.newBuilder() to construct. + private ListUsableWorkstationConfigsRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListUsableWorkstationConfigsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListUsableWorkstationConfigsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListUsableWorkstationConfigsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListUsableWorkstationConfigsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest.class, + com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + /** + * + * + *
+   * Maximum number of items to return.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest)) { + return super.equals(obj); + } + com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest other = + (com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for ListUsableWorkstationConfigs.
+   * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest) + com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListUsableWorkstationConfigsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListUsableWorkstationConfigsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest.class, + com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest.Builder + .class); + } + + // Construct using + // com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListUsableWorkstationConfigsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest + getDefaultInstanceForType() { + return com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest build() { + com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest buildPartial() { + com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest result = + new com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest) { + return mergeFrom( + (com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest other) { + if (other + == com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest) + private static final com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest(); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListUsableWorkstationConfigsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListUsableWorkstationConfigsRequestOrBuilder.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListUsableWorkstationConfigsRequestOrBuilder.java new file mode 100644 index 000000000000..eadae7cec1b2 --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListUsableWorkstationConfigsRequestOrBuilder.java @@ -0,0 +1,92 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +public interface ListUsableWorkstationConfigsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Maximum number of items to return.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListUsableWorkstationConfigsResponse.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListUsableWorkstationConfigsResponse.java new file mode 100644 index 000000000000..c8100e800e43 --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListUsableWorkstationConfigsResponse.java @@ -0,0 +1,1466 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +/** + * + * + *
+ * Response message for ListUsableWorkstationConfigs.
+ * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse} + */ +public final class ListUsableWorkstationConfigsResponse + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse) + ListUsableWorkstationConfigsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListUsableWorkstationConfigsResponse.newBuilder() to construct. + private ListUsableWorkstationConfigsResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListUsableWorkstationConfigsResponse() { + workstationConfigs_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListUsableWorkstationConfigsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListUsableWorkstationConfigsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListUsableWorkstationConfigsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse.class, + com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse.Builder + .class); + } + + public static final int WORKSTATION_CONFIGS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List + workstationConfigs_; + /** + * + * + *
+   * The requested configs.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + @java.lang.Override + public java.util.List + getWorkstationConfigsList() { + return workstationConfigs_; + } + /** + * + * + *
+   * The requested configs.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + @java.lang.Override + public java.util.List + getWorkstationConfigsOrBuilderList() { + return workstationConfigs_; + } + /** + * + * + *
+   * The requested configs.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + @java.lang.Override + public int getWorkstationConfigsCount() { + return workstationConfigs_.size(); + } + /** + * + * + *
+   * The requested configs.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig getWorkstationConfigs(int index) { + return workstationConfigs_.get(index); + } + /** + * + * + *
+   * The requested configs.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfigOrBuilder + getWorkstationConfigsOrBuilder(int index) { + return workstationConfigs_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UNREACHABLE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringList unreachable_; + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < workstationConfigs_.size(); i++) { + output.writeMessage(1, workstationConfigs_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < workstationConfigs_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, workstationConfigs_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse)) { + return super.equals(obj); + } + com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse other = + (com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse) obj; + + if (!getWorkstationConfigsList().equals(other.getWorkstationConfigsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getWorkstationConfigsCount() > 0) { + hash = (37 * hash) + WORKSTATION_CONFIGS_FIELD_NUMBER; + hash = (53 * hash) + getWorkstationConfigsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for ListUsableWorkstationConfigs.
+   * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse) + com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListUsableWorkstationConfigsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListUsableWorkstationConfigsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse.class, + com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse.Builder + .class); + } + + // Construct using + // com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (workstationConfigsBuilder_ == null) { + workstationConfigs_ = java.util.Collections.emptyList(); + } else { + workstationConfigs_ = null; + workstationConfigsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListUsableWorkstationConfigsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse + getDefaultInstanceForType() { + return com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse build() { + com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse + buildPartial() { + com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse result = + new com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse result) { + if (workstationConfigsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + workstationConfigs_ = java.util.Collections.unmodifiableList(workstationConfigs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.workstationConfigs_ = workstationConfigs_; + } else { + result.workstationConfigs_ = workstationConfigsBuilder_.build(); + } + if (((bitField0_ & 0x00000004) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.unreachable_ = unreachable_; + } + + private void buildPartial0( + com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse) { + return mergeFrom( + (com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse other) { + if (other + == com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse + .getDefaultInstance()) return this; + if (workstationConfigsBuilder_ == null) { + if (!other.workstationConfigs_.isEmpty()) { + if (workstationConfigs_.isEmpty()) { + workstationConfigs_ = other.workstationConfigs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureWorkstationConfigsIsMutable(); + workstationConfigs_.addAll(other.workstationConfigs_); + } + onChanged(); + } + } else { + if (!other.workstationConfigs_.isEmpty()) { + if (workstationConfigsBuilder_.isEmpty()) { + workstationConfigsBuilder_.dispose(); + workstationConfigsBuilder_ = null; + workstationConfigs_ = other.workstationConfigs_; + bitField0_ = (bitField0_ & ~0x00000001); + workstationConfigsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getWorkstationConfigsFieldBuilder() + : null; + } else { + workstationConfigsBuilder_.addAllMessages(other.workstationConfigs_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.workstations.v1beta.WorkstationConfig m = + input.readMessage( + com.google.cloud.workstations.v1beta.WorkstationConfig.parser(), + extensionRegistry); + if (workstationConfigsBuilder_ == null) { + ensureWorkstationConfigsIsMutable(); + workstationConfigs_.add(m); + } else { + workstationConfigsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUnreachableIsMutable(); + unreachable_.add(s); + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List + workstationConfigs_ = java.util.Collections.emptyList(); + + private void ensureWorkstationConfigsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + workstationConfigs_ = + new java.util.ArrayList( + workstationConfigs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationConfig, + com.google.cloud.workstations.v1beta.WorkstationConfig.Builder, + com.google.cloud.workstations.v1beta.WorkstationConfigOrBuilder> + workstationConfigsBuilder_; + + /** + * + * + *
+     * The requested configs.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + public java.util.List + getWorkstationConfigsList() { + if (workstationConfigsBuilder_ == null) { + return java.util.Collections.unmodifiableList(workstationConfigs_); + } else { + return workstationConfigsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The requested configs.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + public int getWorkstationConfigsCount() { + if (workstationConfigsBuilder_ == null) { + return workstationConfigs_.size(); + } else { + return workstationConfigsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The requested configs.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + public com.google.cloud.workstations.v1beta.WorkstationConfig getWorkstationConfigs(int index) { + if (workstationConfigsBuilder_ == null) { + return workstationConfigs_.get(index); + } else { + return workstationConfigsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The requested configs.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + public Builder setWorkstationConfigs( + int index, com.google.cloud.workstations.v1beta.WorkstationConfig value) { + if (workstationConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWorkstationConfigsIsMutable(); + workstationConfigs_.set(index, value); + onChanged(); + } else { + workstationConfigsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The requested configs.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + public Builder setWorkstationConfigs( + int index, com.google.cloud.workstations.v1beta.WorkstationConfig.Builder builderForValue) { + if (workstationConfigsBuilder_ == null) { + ensureWorkstationConfigsIsMutable(); + workstationConfigs_.set(index, builderForValue.build()); + onChanged(); + } else { + workstationConfigsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The requested configs.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + public Builder addWorkstationConfigs( + com.google.cloud.workstations.v1beta.WorkstationConfig value) { + if (workstationConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWorkstationConfigsIsMutable(); + workstationConfigs_.add(value); + onChanged(); + } else { + workstationConfigsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The requested configs.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + public Builder addWorkstationConfigs( + int index, com.google.cloud.workstations.v1beta.WorkstationConfig value) { + if (workstationConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWorkstationConfigsIsMutable(); + workstationConfigs_.add(index, value); + onChanged(); + } else { + workstationConfigsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The requested configs.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + public Builder addWorkstationConfigs( + com.google.cloud.workstations.v1beta.WorkstationConfig.Builder builderForValue) { + if (workstationConfigsBuilder_ == null) { + ensureWorkstationConfigsIsMutable(); + workstationConfigs_.add(builderForValue.build()); + onChanged(); + } else { + workstationConfigsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The requested configs.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + public Builder addWorkstationConfigs( + int index, com.google.cloud.workstations.v1beta.WorkstationConfig.Builder builderForValue) { + if (workstationConfigsBuilder_ == null) { + ensureWorkstationConfigsIsMutable(); + workstationConfigs_.add(index, builderForValue.build()); + onChanged(); + } else { + workstationConfigsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The requested configs.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + public Builder addAllWorkstationConfigs( + java.lang.Iterable + values) { + if (workstationConfigsBuilder_ == null) { + ensureWorkstationConfigsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, workstationConfigs_); + onChanged(); + } else { + workstationConfigsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The requested configs.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + public Builder clearWorkstationConfigs() { + if (workstationConfigsBuilder_ == null) { + workstationConfigs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + workstationConfigsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The requested configs.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + public Builder removeWorkstationConfigs(int index) { + if (workstationConfigsBuilder_ == null) { + ensureWorkstationConfigsIsMutable(); + workstationConfigs_.remove(index); + onChanged(); + } else { + workstationConfigsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The requested configs.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + public com.google.cloud.workstations.v1beta.WorkstationConfig.Builder + getWorkstationConfigsBuilder(int index) { + return getWorkstationConfigsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The requested configs.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + public com.google.cloud.workstations.v1beta.WorkstationConfigOrBuilder + getWorkstationConfigsOrBuilder(int index) { + if (workstationConfigsBuilder_ == null) { + return workstationConfigs_.get(index); + } else { + return workstationConfigsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The requested configs.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + public java.util.List + getWorkstationConfigsOrBuilderList() { + if (workstationConfigsBuilder_ != null) { + return workstationConfigsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(workstationConfigs_); + } + } + /** + * + * + *
+     * The requested configs.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + public com.google.cloud.workstations.v1beta.WorkstationConfig.Builder + addWorkstationConfigsBuilder() { + return getWorkstationConfigsFieldBuilder() + .addBuilder(com.google.cloud.workstations.v1beta.WorkstationConfig.getDefaultInstance()); + } + /** + * + * + *
+     * The requested configs.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + public com.google.cloud.workstations.v1beta.WorkstationConfig.Builder + addWorkstationConfigsBuilder(int index) { + return getWorkstationConfigsFieldBuilder() + .addBuilder( + index, com.google.cloud.workstations.v1beta.WorkstationConfig.getDefaultInstance()); + } + /** + * + * + *
+     * The requested configs.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + public java.util.List + getWorkstationConfigsBuilderList() { + return getWorkstationConfigsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationConfig, + com.google.cloud.workstations.v1beta.WorkstationConfig.Builder, + com.google.cloud.workstations.v1beta.WorkstationConfigOrBuilder> + getWorkstationConfigsFieldBuilder() { + if (workstationConfigsBuilder_ == null) { + workstationConfigsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationConfig, + com.google.cloud.workstations.v1beta.WorkstationConfig.Builder, + com.google.cloud.workstations.v1beta.WorkstationConfigOrBuilder>( + workstationConfigs_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + workstationConfigs_ = null; + } + return workstationConfigsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList unreachable_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureUnreachableIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_.getUnmodifiableView(); + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + onChanged(); + return this; + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse) + private static final com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse(); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListUsableWorkstationConfigsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListUsableWorkstationConfigsResponseOrBuilder.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListUsableWorkstationConfigsResponseOrBuilder.java new file mode 100644 index 000000000000..ba4f13fd0fad --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListUsableWorkstationConfigsResponseOrBuilder.java @@ -0,0 +1,162 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +public interface ListUsableWorkstationConfigsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The requested configs.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + java.util.List + getWorkstationConfigsList(); + /** + * + * + *
+   * The requested configs.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + com.google.cloud.workstations.v1beta.WorkstationConfig getWorkstationConfigs(int index); + /** + * + * + *
+   * The requested configs.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + int getWorkstationConfigsCount(); + /** + * + * + *
+   * The requested configs.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + java.util.List + getWorkstationConfigsOrBuilderList(); + /** + * + * + *
+   * The requested configs.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + com.google.cloud.workstations.v1beta.WorkstationConfigOrBuilder getWorkstationConfigsOrBuilder( + int index); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListUsableWorkstationsRequest.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListUsableWorkstationsRequest.java new file mode 100644 index 000000000000..be2239a5de45 --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListUsableWorkstationsRequest.java @@ -0,0 +1,930 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +/** + * + * + *
+ * Request message for ListUsableWorkstations.
+ * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.ListUsableWorkstationsRequest} + */ +public final class ListUsableWorkstationsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workstations.v1beta.ListUsableWorkstationsRequest) + ListUsableWorkstationsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListUsableWorkstationsRequest.newBuilder() to construct. + private ListUsableWorkstationsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListUsableWorkstationsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListUsableWorkstationsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListUsableWorkstationsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListUsableWorkstationsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest.class, + com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + /** + * + * + *
+   * Maximum number of items to return.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest)) { + return super.equals(obj); + } + com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest other = + (com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for ListUsableWorkstations.
+   * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.ListUsableWorkstationsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workstations.v1beta.ListUsableWorkstationsRequest) + com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListUsableWorkstationsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListUsableWorkstationsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest.class, + com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest.Builder.class); + } + + // Construct using + // com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListUsableWorkstationsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest + getDefaultInstanceForType() { + return com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest build() { + com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest buildPartial() { + com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest result = + new com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest) { + return mergeFrom( + (com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest other) { + if (other + == com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workstations.v1beta.ListUsableWorkstationsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workstations.v1beta.ListUsableWorkstationsRequest) + private static final com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest(); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListUsableWorkstationsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListUsableWorkstationsRequestOrBuilder.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListUsableWorkstationsRequestOrBuilder.java new file mode 100644 index 000000000000..9c8c4043cda1 --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListUsableWorkstationsRequestOrBuilder.java @@ -0,0 +1,92 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +public interface ListUsableWorkstationsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workstations.v1beta.ListUsableWorkstationsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Maximum number of items to return.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListUsableWorkstationsResponse.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListUsableWorkstationsResponse.java new file mode 100644 index 000000000000..24ed6ef2c5c7 --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListUsableWorkstationsResponse.java @@ -0,0 +1,1424 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +/** + * + * + *
+ * Response message for ListUsableWorkstations.
+ * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.ListUsableWorkstationsResponse} + */ +public final class ListUsableWorkstationsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workstations.v1beta.ListUsableWorkstationsResponse) + ListUsableWorkstationsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListUsableWorkstationsResponse.newBuilder() to construct. + private ListUsableWorkstationsResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListUsableWorkstationsResponse() { + workstations_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListUsableWorkstationsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListUsableWorkstationsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListUsableWorkstationsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse.class, + com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse.Builder.class); + } + + public static final int WORKSTATIONS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List workstations_; + /** + * + * + *
+   * The requested workstations.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + @java.lang.Override + public java.util.List getWorkstationsList() { + return workstations_; + } + /** + * + * + *
+   * The requested workstations.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + @java.lang.Override + public java.util.List + getWorkstationsOrBuilderList() { + return workstations_; + } + /** + * + * + *
+   * The requested workstations.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + @java.lang.Override + public int getWorkstationsCount() { + return workstations_.size(); + } + /** + * + * + *
+   * The requested workstations.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.Workstation getWorkstations(int index) { + return workstations_.get(index); + } + /** + * + * + *
+   * The requested workstations.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationOrBuilder getWorkstationsOrBuilder( + int index) { + return workstations_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UNREACHABLE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringList unreachable_; + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < workstations_.size(); i++) { + output.writeMessage(1, workstations_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < workstations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, workstations_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse)) { + return super.equals(obj); + } + com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse other = + (com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse) obj; + + if (!getWorkstationsList().equals(other.getWorkstationsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getWorkstationsCount() > 0) { + hash = (37 * hash) + WORKSTATIONS_FIELD_NUMBER; + hash = (53 * hash) + getWorkstationsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for ListUsableWorkstations.
+   * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.ListUsableWorkstationsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workstations.v1beta.ListUsableWorkstationsResponse) + com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListUsableWorkstationsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListUsableWorkstationsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse.class, + com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse.Builder.class); + } + + // Construct using + // com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (workstationsBuilder_ == null) { + workstations_ = java.util.Collections.emptyList(); + } else { + workstations_ = null; + workstationsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListUsableWorkstationsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse + getDefaultInstanceForType() { + return com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse build() { + com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse buildPartial() { + com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse result = + new com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse result) { + if (workstationsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + workstations_ = java.util.Collections.unmodifiableList(workstations_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.workstations_ = workstations_; + } else { + result.workstations_ = workstationsBuilder_.build(); + } + if (((bitField0_ & 0x00000004) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.unreachable_ = unreachable_; + } + + private void buildPartial0( + com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse) { + return mergeFrom( + (com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse other) { + if (other + == com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse + .getDefaultInstance()) return this; + if (workstationsBuilder_ == null) { + if (!other.workstations_.isEmpty()) { + if (workstations_.isEmpty()) { + workstations_ = other.workstations_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureWorkstationsIsMutable(); + workstations_.addAll(other.workstations_); + } + onChanged(); + } + } else { + if (!other.workstations_.isEmpty()) { + if (workstationsBuilder_.isEmpty()) { + workstationsBuilder_.dispose(); + workstationsBuilder_ = null; + workstations_ = other.workstations_; + bitField0_ = (bitField0_ & ~0x00000001); + workstationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getWorkstationsFieldBuilder() + : null; + } else { + workstationsBuilder_.addAllMessages(other.workstations_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.workstations.v1beta.Workstation m = + input.readMessage( + com.google.cloud.workstations.v1beta.Workstation.parser(), + extensionRegistry); + if (workstationsBuilder_ == null) { + ensureWorkstationsIsMutable(); + workstations_.add(m); + } else { + workstationsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUnreachableIsMutable(); + unreachable_.add(s); + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List workstations_ = + java.util.Collections.emptyList(); + + private void ensureWorkstationsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + workstations_ = + new java.util.ArrayList( + workstations_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.workstations.v1beta.Workstation, + com.google.cloud.workstations.v1beta.Workstation.Builder, + com.google.cloud.workstations.v1beta.WorkstationOrBuilder> + workstationsBuilder_; + + /** + * + * + *
+     * The requested workstations.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + public java.util.List getWorkstationsList() { + if (workstationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(workstations_); + } else { + return workstationsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The requested workstations.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + public int getWorkstationsCount() { + if (workstationsBuilder_ == null) { + return workstations_.size(); + } else { + return workstationsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The requested workstations.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + public com.google.cloud.workstations.v1beta.Workstation getWorkstations(int index) { + if (workstationsBuilder_ == null) { + return workstations_.get(index); + } else { + return workstationsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The requested workstations.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + public Builder setWorkstations( + int index, com.google.cloud.workstations.v1beta.Workstation value) { + if (workstationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWorkstationsIsMutable(); + workstations_.set(index, value); + onChanged(); + } else { + workstationsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The requested workstations.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + public Builder setWorkstations( + int index, com.google.cloud.workstations.v1beta.Workstation.Builder builderForValue) { + if (workstationsBuilder_ == null) { + ensureWorkstationsIsMutable(); + workstations_.set(index, builderForValue.build()); + onChanged(); + } else { + workstationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The requested workstations.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + public Builder addWorkstations(com.google.cloud.workstations.v1beta.Workstation value) { + if (workstationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWorkstationsIsMutable(); + workstations_.add(value); + onChanged(); + } else { + workstationsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The requested workstations.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + public Builder addWorkstations( + int index, com.google.cloud.workstations.v1beta.Workstation value) { + if (workstationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWorkstationsIsMutable(); + workstations_.add(index, value); + onChanged(); + } else { + workstationsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The requested workstations.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + public Builder addWorkstations( + com.google.cloud.workstations.v1beta.Workstation.Builder builderForValue) { + if (workstationsBuilder_ == null) { + ensureWorkstationsIsMutable(); + workstations_.add(builderForValue.build()); + onChanged(); + } else { + workstationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The requested workstations.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + public Builder addWorkstations( + int index, com.google.cloud.workstations.v1beta.Workstation.Builder builderForValue) { + if (workstationsBuilder_ == null) { + ensureWorkstationsIsMutable(); + workstations_.add(index, builderForValue.build()); + onChanged(); + } else { + workstationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The requested workstations.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + public Builder addAllWorkstations( + java.lang.Iterable values) { + if (workstationsBuilder_ == null) { + ensureWorkstationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, workstations_); + onChanged(); + } else { + workstationsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The requested workstations.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + public Builder clearWorkstations() { + if (workstationsBuilder_ == null) { + workstations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + workstationsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The requested workstations.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + public Builder removeWorkstations(int index) { + if (workstationsBuilder_ == null) { + ensureWorkstationsIsMutable(); + workstations_.remove(index); + onChanged(); + } else { + workstationsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The requested workstations.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + public com.google.cloud.workstations.v1beta.Workstation.Builder getWorkstationsBuilder( + int index) { + return getWorkstationsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The requested workstations.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + public com.google.cloud.workstations.v1beta.WorkstationOrBuilder getWorkstationsOrBuilder( + int index) { + if (workstationsBuilder_ == null) { + return workstations_.get(index); + } else { + return workstationsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The requested workstations.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + public java.util.List + getWorkstationsOrBuilderList() { + if (workstationsBuilder_ != null) { + return workstationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(workstations_); + } + } + /** + * + * + *
+     * The requested workstations.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + public com.google.cloud.workstations.v1beta.Workstation.Builder addWorkstationsBuilder() { + return getWorkstationsFieldBuilder() + .addBuilder(com.google.cloud.workstations.v1beta.Workstation.getDefaultInstance()); + } + /** + * + * + *
+     * The requested workstations.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + public com.google.cloud.workstations.v1beta.Workstation.Builder addWorkstationsBuilder( + int index) { + return getWorkstationsFieldBuilder() + .addBuilder(index, com.google.cloud.workstations.v1beta.Workstation.getDefaultInstance()); + } + /** + * + * + *
+     * The requested workstations.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + public java.util.List + getWorkstationsBuilderList() { + return getWorkstationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.workstations.v1beta.Workstation, + com.google.cloud.workstations.v1beta.Workstation.Builder, + com.google.cloud.workstations.v1beta.WorkstationOrBuilder> + getWorkstationsFieldBuilder() { + if (workstationsBuilder_ == null) { + workstationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.workstations.v1beta.Workstation, + com.google.cloud.workstations.v1beta.Workstation.Builder, + com.google.cloud.workstations.v1beta.WorkstationOrBuilder>( + workstations_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + workstations_ = null; + } + return workstationsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList unreachable_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureUnreachableIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_.getUnmodifiableView(); + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + onChanged(); + return this; + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workstations.v1beta.ListUsableWorkstationsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workstations.v1beta.ListUsableWorkstationsResponse) + private static final com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse(); + } + + public static com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListUsableWorkstationsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListUsableWorkstationsResponseOrBuilder.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListUsableWorkstationsResponseOrBuilder.java new file mode 100644 index 000000000000..9e6cd7b574a1 --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListUsableWorkstationsResponseOrBuilder.java @@ -0,0 +1,155 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +public interface ListUsableWorkstationsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workstations.v1beta.ListUsableWorkstationsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The requested workstations.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + java.util.List getWorkstationsList(); + /** + * + * + *
+   * The requested workstations.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + com.google.cloud.workstations.v1beta.Workstation getWorkstations(int index); + /** + * + * + *
+   * The requested workstations.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + int getWorkstationsCount(); + /** + * + * + *
+   * The requested workstations.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + java.util.List + getWorkstationsOrBuilderList(); + /** + * + * + *
+   * The requested workstations.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + com.google.cloud.workstations.v1beta.WorkstationOrBuilder getWorkstationsOrBuilder(int index); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListWorkstationClustersRequest.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListWorkstationClustersRequest.java new file mode 100644 index 000000000000..c9b5de6d1a69 --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListWorkstationClustersRequest.java @@ -0,0 +1,931 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +/** + * + * + *
+ * Request message for ListWorkstationClusters.
+ * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.ListWorkstationClustersRequest} + */ +public final class ListWorkstationClustersRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workstations.v1beta.ListWorkstationClustersRequest) + ListWorkstationClustersRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListWorkstationClustersRequest.newBuilder() to construct. + private ListWorkstationClustersRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListWorkstationClustersRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListWorkstationClustersRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListWorkstationClustersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListWorkstationClustersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest.class, + com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + /** + * + * + *
+   * Maximum number of items to return.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest)) { + return super.equals(obj); + } + com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest other = + (com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for ListWorkstationClusters.
+   * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.ListWorkstationClustersRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workstations.v1beta.ListWorkstationClustersRequest) + com.google.cloud.workstations.v1beta.ListWorkstationClustersRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListWorkstationClustersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListWorkstationClustersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest.class, + com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest.Builder.class); + } + + // Construct using + // com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListWorkstationClustersRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest + getDefaultInstanceForType() { + return com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest build() { + com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest buildPartial() { + com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest result = + new com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest) { + return mergeFrom( + (com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest other) { + if (other + == com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workstations.v1beta.ListWorkstationClustersRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workstations.v1beta.ListWorkstationClustersRequest) + private static final com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest(); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListWorkstationClustersRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListWorkstationClustersRequestOrBuilder.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListWorkstationClustersRequestOrBuilder.java new file mode 100644 index 000000000000..0c149c0553c4 --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListWorkstationClustersRequestOrBuilder.java @@ -0,0 +1,92 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +public interface ListWorkstationClustersRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workstations.v1beta.ListWorkstationClustersRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Maximum number of items to return.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListWorkstationClustersResponse.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListWorkstationClustersResponse.java new file mode 100644 index 000000000000..dee4842d8e8f --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListWorkstationClustersResponse.java @@ -0,0 +1,1462 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +/** + * + * + *
+ * Response message for ListWorkstationClusters.
+ * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.ListWorkstationClustersResponse} + */ +public final class ListWorkstationClustersResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workstations.v1beta.ListWorkstationClustersResponse) + ListWorkstationClustersResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListWorkstationClustersResponse.newBuilder() to construct. + private ListWorkstationClustersResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListWorkstationClustersResponse() { + workstationClusters_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListWorkstationClustersResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListWorkstationClustersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListWorkstationClustersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse.class, + com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse.Builder.class); + } + + public static final int WORKSTATION_CLUSTERS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List + workstationClusters_; + /** + * + * + *
+   * The requested workstation clusters.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationCluster workstation_clusters = 1; + * + */ + @java.lang.Override + public java.util.List + getWorkstationClustersList() { + return workstationClusters_; + } + /** + * + * + *
+   * The requested workstation clusters.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationCluster workstation_clusters = 1; + * + */ + @java.lang.Override + public java.util.List + getWorkstationClustersOrBuilderList() { + return workstationClusters_; + } + /** + * + * + *
+   * The requested workstation clusters.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationCluster workstation_clusters = 1; + * + */ + @java.lang.Override + public int getWorkstationClustersCount() { + return workstationClusters_.size(); + } + /** + * + * + *
+   * The requested workstation clusters.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationCluster workstation_clusters = 1; + * + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationCluster getWorkstationClusters(int index) { + return workstationClusters_.get(index); + } + /** + * + * + *
+   * The requested workstation clusters.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationCluster workstation_clusters = 1; + * + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationClusterOrBuilder + getWorkstationClustersOrBuilder(int index) { + return workstationClusters_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UNREACHABLE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringList unreachable_; + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < workstationClusters_.size(); i++) { + output.writeMessage(1, workstationClusters_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < workstationClusters_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, workstationClusters_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse)) { + return super.equals(obj); + } + com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse other = + (com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse) obj; + + if (!getWorkstationClustersList().equals(other.getWorkstationClustersList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getWorkstationClustersCount() > 0) { + hash = (37 * hash) + WORKSTATION_CLUSTERS_FIELD_NUMBER; + hash = (53 * hash) + getWorkstationClustersList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for ListWorkstationClusters.
+   * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.ListWorkstationClustersResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workstations.v1beta.ListWorkstationClustersResponse) + com.google.cloud.workstations.v1beta.ListWorkstationClustersResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListWorkstationClustersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListWorkstationClustersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse.class, + com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse.Builder.class); + } + + // Construct using + // com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (workstationClustersBuilder_ == null) { + workstationClusters_ = java.util.Collections.emptyList(); + } else { + workstationClusters_ = null; + workstationClustersBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListWorkstationClustersResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse + getDefaultInstanceForType() { + return com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse build() { + com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse buildPartial() { + com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse result = + new com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse result) { + if (workstationClustersBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + workstationClusters_ = java.util.Collections.unmodifiableList(workstationClusters_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.workstationClusters_ = workstationClusters_; + } else { + result.workstationClusters_ = workstationClustersBuilder_.build(); + } + if (((bitField0_ & 0x00000004) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.unreachable_ = unreachable_; + } + + private void buildPartial0( + com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse) { + return mergeFrom( + (com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse other) { + if (other + == com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse + .getDefaultInstance()) return this; + if (workstationClustersBuilder_ == null) { + if (!other.workstationClusters_.isEmpty()) { + if (workstationClusters_.isEmpty()) { + workstationClusters_ = other.workstationClusters_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureWorkstationClustersIsMutable(); + workstationClusters_.addAll(other.workstationClusters_); + } + onChanged(); + } + } else { + if (!other.workstationClusters_.isEmpty()) { + if (workstationClustersBuilder_.isEmpty()) { + workstationClustersBuilder_.dispose(); + workstationClustersBuilder_ = null; + workstationClusters_ = other.workstationClusters_; + bitField0_ = (bitField0_ & ~0x00000001); + workstationClustersBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getWorkstationClustersFieldBuilder() + : null; + } else { + workstationClustersBuilder_.addAllMessages(other.workstationClusters_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.workstations.v1beta.WorkstationCluster m = + input.readMessage( + com.google.cloud.workstations.v1beta.WorkstationCluster.parser(), + extensionRegistry); + if (workstationClustersBuilder_ == null) { + ensureWorkstationClustersIsMutable(); + workstationClusters_.add(m); + } else { + workstationClustersBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUnreachableIsMutable(); + unreachable_.add(s); + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List + workstationClusters_ = java.util.Collections.emptyList(); + + private void ensureWorkstationClustersIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + workstationClusters_ = + new java.util.ArrayList( + workstationClusters_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationCluster, + com.google.cloud.workstations.v1beta.WorkstationCluster.Builder, + com.google.cloud.workstations.v1beta.WorkstationClusterOrBuilder> + workstationClustersBuilder_; + + /** + * + * + *
+     * The requested workstation clusters.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationCluster workstation_clusters = 1; + * + */ + public java.util.List + getWorkstationClustersList() { + if (workstationClustersBuilder_ == null) { + return java.util.Collections.unmodifiableList(workstationClusters_); + } else { + return workstationClustersBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The requested workstation clusters.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationCluster workstation_clusters = 1; + * + */ + public int getWorkstationClustersCount() { + if (workstationClustersBuilder_ == null) { + return workstationClusters_.size(); + } else { + return workstationClustersBuilder_.getCount(); + } + } + /** + * + * + *
+     * The requested workstation clusters.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationCluster workstation_clusters = 1; + * + */ + public com.google.cloud.workstations.v1beta.WorkstationCluster getWorkstationClusters( + int index) { + if (workstationClustersBuilder_ == null) { + return workstationClusters_.get(index); + } else { + return workstationClustersBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The requested workstation clusters.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationCluster workstation_clusters = 1; + * + */ + public Builder setWorkstationClusters( + int index, com.google.cloud.workstations.v1beta.WorkstationCluster value) { + if (workstationClustersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWorkstationClustersIsMutable(); + workstationClusters_.set(index, value); + onChanged(); + } else { + workstationClustersBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The requested workstation clusters.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationCluster workstation_clusters = 1; + * + */ + public Builder setWorkstationClusters( + int index, + com.google.cloud.workstations.v1beta.WorkstationCluster.Builder builderForValue) { + if (workstationClustersBuilder_ == null) { + ensureWorkstationClustersIsMutable(); + workstationClusters_.set(index, builderForValue.build()); + onChanged(); + } else { + workstationClustersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The requested workstation clusters.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationCluster workstation_clusters = 1; + * + */ + public Builder addWorkstationClusters( + com.google.cloud.workstations.v1beta.WorkstationCluster value) { + if (workstationClustersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWorkstationClustersIsMutable(); + workstationClusters_.add(value); + onChanged(); + } else { + workstationClustersBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The requested workstation clusters.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationCluster workstation_clusters = 1; + * + */ + public Builder addWorkstationClusters( + int index, com.google.cloud.workstations.v1beta.WorkstationCluster value) { + if (workstationClustersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWorkstationClustersIsMutable(); + workstationClusters_.add(index, value); + onChanged(); + } else { + workstationClustersBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The requested workstation clusters.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationCluster workstation_clusters = 1; + * + */ + public Builder addWorkstationClusters( + com.google.cloud.workstations.v1beta.WorkstationCluster.Builder builderForValue) { + if (workstationClustersBuilder_ == null) { + ensureWorkstationClustersIsMutable(); + workstationClusters_.add(builderForValue.build()); + onChanged(); + } else { + workstationClustersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The requested workstation clusters.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationCluster workstation_clusters = 1; + * + */ + public Builder addWorkstationClusters( + int index, + com.google.cloud.workstations.v1beta.WorkstationCluster.Builder builderForValue) { + if (workstationClustersBuilder_ == null) { + ensureWorkstationClustersIsMutable(); + workstationClusters_.add(index, builderForValue.build()); + onChanged(); + } else { + workstationClustersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The requested workstation clusters.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationCluster workstation_clusters = 1; + * + */ + public Builder addAllWorkstationClusters( + java.lang.Iterable + values) { + if (workstationClustersBuilder_ == null) { + ensureWorkstationClustersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, workstationClusters_); + onChanged(); + } else { + workstationClustersBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The requested workstation clusters.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationCluster workstation_clusters = 1; + * + */ + public Builder clearWorkstationClusters() { + if (workstationClustersBuilder_ == null) { + workstationClusters_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + workstationClustersBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The requested workstation clusters.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationCluster workstation_clusters = 1; + * + */ + public Builder removeWorkstationClusters(int index) { + if (workstationClustersBuilder_ == null) { + ensureWorkstationClustersIsMutable(); + workstationClusters_.remove(index); + onChanged(); + } else { + workstationClustersBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The requested workstation clusters.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationCluster workstation_clusters = 1; + * + */ + public com.google.cloud.workstations.v1beta.WorkstationCluster.Builder + getWorkstationClustersBuilder(int index) { + return getWorkstationClustersFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The requested workstation clusters.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationCluster workstation_clusters = 1; + * + */ + public com.google.cloud.workstations.v1beta.WorkstationClusterOrBuilder + getWorkstationClustersOrBuilder(int index) { + if (workstationClustersBuilder_ == null) { + return workstationClusters_.get(index); + } else { + return workstationClustersBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The requested workstation clusters.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationCluster workstation_clusters = 1; + * + */ + public java.util.List< + ? extends com.google.cloud.workstations.v1beta.WorkstationClusterOrBuilder> + getWorkstationClustersOrBuilderList() { + if (workstationClustersBuilder_ != null) { + return workstationClustersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(workstationClusters_); + } + } + /** + * + * + *
+     * The requested workstation clusters.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationCluster workstation_clusters = 1; + * + */ + public com.google.cloud.workstations.v1beta.WorkstationCluster.Builder + addWorkstationClustersBuilder() { + return getWorkstationClustersFieldBuilder() + .addBuilder(com.google.cloud.workstations.v1beta.WorkstationCluster.getDefaultInstance()); + } + /** + * + * + *
+     * The requested workstation clusters.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationCluster workstation_clusters = 1; + * + */ + public com.google.cloud.workstations.v1beta.WorkstationCluster.Builder + addWorkstationClustersBuilder(int index) { + return getWorkstationClustersFieldBuilder() + .addBuilder( + index, com.google.cloud.workstations.v1beta.WorkstationCluster.getDefaultInstance()); + } + /** + * + * + *
+     * The requested workstation clusters.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationCluster workstation_clusters = 1; + * + */ + public java.util.List + getWorkstationClustersBuilderList() { + return getWorkstationClustersFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationCluster, + com.google.cloud.workstations.v1beta.WorkstationCluster.Builder, + com.google.cloud.workstations.v1beta.WorkstationClusterOrBuilder> + getWorkstationClustersFieldBuilder() { + if (workstationClustersBuilder_ == null) { + workstationClustersBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationCluster, + com.google.cloud.workstations.v1beta.WorkstationCluster.Builder, + com.google.cloud.workstations.v1beta.WorkstationClusterOrBuilder>( + workstationClusters_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + workstationClusters_ = null; + } + return workstationClustersBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList unreachable_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureUnreachableIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_.getUnmodifiableView(); + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + onChanged(); + return this; + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workstations.v1beta.ListWorkstationClustersResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workstations.v1beta.ListWorkstationClustersResponse) + private static final com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse(); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListWorkstationClustersResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListWorkstationClustersResponseOrBuilder.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListWorkstationClustersResponseOrBuilder.java new file mode 100644 index 000000000000..c5080a63d007 --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListWorkstationClustersResponseOrBuilder.java @@ -0,0 +1,162 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +public interface ListWorkstationClustersResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workstations.v1beta.ListWorkstationClustersResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The requested workstation clusters.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationCluster workstation_clusters = 1; + * + */ + java.util.List + getWorkstationClustersList(); + /** + * + * + *
+   * The requested workstation clusters.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationCluster workstation_clusters = 1; + * + */ + com.google.cloud.workstations.v1beta.WorkstationCluster getWorkstationClusters(int index); + /** + * + * + *
+   * The requested workstation clusters.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationCluster workstation_clusters = 1; + * + */ + int getWorkstationClustersCount(); + /** + * + * + *
+   * The requested workstation clusters.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationCluster workstation_clusters = 1; + * + */ + java.util.List + getWorkstationClustersOrBuilderList(); + /** + * + * + *
+   * The requested workstation clusters.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationCluster workstation_clusters = 1; + * + */ + com.google.cloud.workstations.v1beta.WorkstationClusterOrBuilder getWorkstationClustersOrBuilder( + int index); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListWorkstationConfigsRequest.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListWorkstationConfigsRequest.java new file mode 100644 index 000000000000..e0cf8790ad68 --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListWorkstationConfigsRequest.java @@ -0,0 +1,930 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +/** + * + * + *
+ * Request message for ListWorkstationConfigs.
+ * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.ListWorkstationConfigsRequest} + */ +public final class ListWorkstationConfigsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workstations.v1beta.ListWorkstationConfigsRequest) + ListWorkstationConfigsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListWorkstationConfigsRequest.newBuilder() to construct. + private ListWorkstationConfigsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListWorkstationConfigsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListWorkstationConfigsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListWorkstationConfigsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListWorkstationConfigsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest.class, + com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + /** + * + * + *
+   * Maximum number of items to return.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest)) { + return super.equals(obj); + } + com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest other = + (com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for ListWorkstationConfigs.
+   * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.ListWorkstationConfigsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workstations.v1beta.ListWorkstationConfigsRequest) + com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListWorkstationConfigsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListWorkstationConfigsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest.class, + com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest.Builder.class); + } + + // Construct using + // com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListWorkstationConfigsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest + getDefaultInstanceForType() { + return com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest build() { + com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest buildPartial() { + com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest result = + new com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest) { + return mergeFrom( + (com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest other) { + if (other + == com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workstations.v1beta.ListWorkstationConfigsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workstations.v1beta.ListWorkstationConfigsRequest) + private static final com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest(); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListWorkstationConfigsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListWorkstationConfigsRequestOrBuilder.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListWorkstationConfigsRequestOrBuilder.java new file mode 100644 index 000000000000..afcc311c6758 --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListWorkstationConfigsRequestOrBuilder.java @@ -0,0 +1,92 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +public interface ListWorkstationConfigsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workstations.v1beta.ListWorkstationConfigsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Maximum number of items to return.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListWorkstationConfigsResponse.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListWorkstationConfigsResponse.java new file mode 100644 index 000000000000..7d7f07cd8b78 --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListWorkstationConfigsResponse.java @@ -0,0 +1,1458 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +/** + * + * + *
+ * Response message for ListWorkstationConfigs.
+ * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.ListWorkstationConfigsResponse} + */ +public final class ListWorkstationConfigsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workstations.v1beta.ListWorkstationConfigsResponse) + ListWorkstationConfigsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListWorkstationConfigsResponse.newBuilder() to construct. + private ListWorkstationConfigsResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListWorkstationConfigsResponse() { + workstationConfigs_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListWorkstationConfigsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListWorkstationConfigsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListWorkstationConfigsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse.class, + com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse.Builder.class); + } + + public static final int WORKSTATION_CONFIGS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List + workstationConfigs_; + /** + * + * + *
+   * The requested configs.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + @java.lang.Override + public java.util.List + getWorkstationConfigsList() { + return workstationConfigs_; + } + /** + * + * + *
+   * The requested configs.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + @java.lang.Override + public java.util.List + getWorkstationConfigsOrBuilderList() { + return workstationConfigs_; + } + /** + * + * + *
+   * The requested configs.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + @java.lang.Override + public int getWorkstationConfigsCount() { + return workstationConfigs_.size(); + } + /** + * + * + *
+   * The requested configs.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig getWorkstationConfigs(int index) { + return workstationConfigs_.get(index); + } + /** + * + * + *
+   * The requested configs.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfigOrBuilder + getWorkstationConfigsOrBuilder(int index) { + return workstationConfigs_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UNREACHABLE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringList unreachable_; + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < workstationConfigs_.size(); i++) { + output.writeMessage(1, workstationConfigs_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < workstationConfigs_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, workstationConfigs_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse)) { + return super.equals(obj); + } + com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse other = + (com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse) obj; + + if (!getWorkstationConfigsList().equals(other.getWorkstationConfigsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getWorkstationConfigsCount() > 0) { + hash = (37 * hash) + WORKSTATION_CONFIGS_FIELD_NUMBER; + hash = (53 * hash) + getWorkstationConfigsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for ListWorkstationConfigs.
+   * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.ListWorkstationConfigsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workstations.v1beta.ListWorkstationConfigsResponse) + com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListWorkstationConfigsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListWorkstationConfigsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse.class, + com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse.Builder.class); + } + + // Construct using + // com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (workstationConfigsBuilder_ == null) { + workstationConfigs_ = java.util.Collections.emptyList(); + } else { + workstationConfigs_ = null; + workstationConfigsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListWorkstationConfigsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse + getDefaultInstanceForType() { + return com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse build() { + com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse buildPartial() { + com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse result = + new com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse result) { + if (workstationConfigsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + workstationConfigs_ = java.util.Collections.unmodifiableList(workstationConfigs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.workstationConfigs_ = workstationConfigs_; + } else { + result.workstationConfigs_ = workstationConfigsBuilder_.build(); + } + if (((bitField0_ & 0x00000004) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.unreachable_ = unreachable_; + } + + private void buildPartial0( + com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse) { + return mergeFrom( + (com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse other) { + if (other + == com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse + .getDefaultInstance()) return this; + if (workstationConfigsBuilder_ == null) { + if (!other.workstationConfigs_.isEmpty()) { + if (workstationConfigs_.isEmpty()) { + workstationConfigs_ = other.workstationConfigs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureWorkstationConfigsIsMutable(); + workstationConfigs_.addAll(other.workstationConfigs_); + } + onChanged(); + } + } else { + if (!other.workstationConfigs_.isEmpty()) { + if (workstationConfigsBuilder_.isEmpty()) { + workstationConfigsBuilder_.dispose(); + workstationConfigsBuilder_ = null; + workstationConfigs_ = other.workstationConfigs_; + bitField0_ = (bitField0_ & ~0x00000001); + workstationConfigsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getWorkstationConfigsFieldBuilder() + : null; + } else { + workstationConfigsBuilder_.addAllMessages(other.workstationConfigs_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.workstations.v1beta.WorkstationConfig m = + input.readMessage( + com.google.cloud.workstations.v1beta.WorkstationConfig.parser(), + extensionRegistry); + if (workstationConfigsBuilder_ == null) { + ensureWorkstationConfigsIsMutable(); + workstationConfigs_.add(m); + } else { + workstationConfigsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUnreachableIsMutable(); + unreachable_.add(s); + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List + workstationConfigs_ = java.util.Collections.emptyList(); + + private void ensureWorkstationConfigsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + workstationConfigs_ = + new java.util.ArrayList( + workstationConfigs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationConfig, + com.google.cloud.workstations.v1beta.WorkstationConfig.Builder, + com.google.cloud.workstations.v1beta.WorkstationConfigOrBuilder> + workstationConfigsBuilder_; + + /** + * + * + *
+     * The requested configs.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + public java.util.List + getWorkstationConfigsList() { + if (workstationConfigsBuilder_ == null) { + return java.util.Collections.unmodifiableList(workstationConfigs_); + } else { + return workstationConfigsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The requested configs.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + public int getWorkstationConfigsCount() { + if (workstationConfigsBuilder_ == null) { + return workstationConfigs_.size(); + } else { + return workstationConfigsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The requested configs.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + public com.google.cloud.workstations.v1beta.WorkstationConfig getWorkstationConfigs(int index) { + if (workstationConfigsBuilder_ == null) { + return workstationConfigs_.get(index); + } else { + return workstationConfigsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The requested configs.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + public Builder setWorkstationConfigs( + int index, com.google.cloud.workstations.v1beta.WorkstationConfig value) { + if (workstationConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWorkstationConfigsIsMutable(); + workstationConfigs_.set(index, value); + onChanged(); + } else { + workstationConfigsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The requested configs.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + public Builder setWorkstationConfigs( + int index, com.google.cloud.workstations.v1beta.WorkstationConfig.Builder builderForValue) { + if (workstationConfigsBuilder_ == null) { + ensureWorkstationConfigsIsMutable(); + workstationConfigs_.set(index, builderForValue.build()); + onChanged(); + } else { + workstationConfigsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The requested configs.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + public Builder addWorkstationConfigs( + com.google.cloud.workstations.v1beta.WorkstationConfig value) { + if (workstationConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWorkstationConfigsIsMutable(); + workstationConfigs_.add(value); + onChanged(); + } else { + workstationConfigsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The requested configs.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + public Builder addWorkstationConfigs( + int index, com.google.cloud.workstations.v1beta.WorkstationConfig value) { + if (workstationConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWorkstationConfigsIsMutable(); + workstationConfigs_.add(index, value); + onChanged(); + } else { + workstationConfigsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The requested configs.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + public Builder addWorkstationConfigs( + com.google.cloud.workstations.v1beta.WorkstationConfig.Builder builderForValue) { + if (workstationConfigsBuilder_ == null) { + ensureWorkstationConfigsIsMutable(); + workstationConfigs_.add(builderForValue.build()); + onChanged(); + } else { + workstationConfigsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The requested configs.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + public Builder addWorkstationConfigs( + int index, com.google.cloud.workstations.v1beta.WorkstationConfig.Builder builderForValue) { + if (workstationConfigsBuilder_ == null) { + ensureWorkstationConfigsIsMutable(); + workstationConfigs_.add(index, builderForValue.build()); + onChanged(); + } else { + workstationConfigsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The requested configs.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + public Builder addAllWorkstationConfigs( + java.lang.Iterable + values) { + if (workstationConfigsBuilder_ == null) { + ensureWorkstationConfigsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, workstationConfigs_); + onChanged(); + } else { + workstationConfigsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The requested configs.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + public Builder clearWorkstationConfigs() { + if (workstationConfigsBuilder_ == null) { + workstationConfigs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + workstationConfigsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The requested configs.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + public Builder removeWorkstationConfigs(int index) { + if (workstationConfigsBuilder_ == null) { + ensureWorkstationConfigsIsMutable(); + workstationConfigs_.remove(index); + onChanged(); + } else { + workstationConfigsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The requested configs.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + public com.google.cloud.workstations.v1beta.WorkstationConfig.Builder + getWorkstationConfigsBuilder(int index) { + return getWorkstationConfigsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The requested configs.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + public com.google.cloud.workstations.v1beta.WorkstationConfigOrBuilder + getWorkstationConfigsOrBuilder(int index) { + if (workstationConfigsBuilder_ == null) { + return workstationConfigs_.get(index); + } else { + return workstationConfigsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The requested configs.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + public java.util.List + getWorkstationConfigsOrBuilderList() { + if (workstationConfigsBuilder_ != null) { + return workstationConfigsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(workstationConfigs_); + } + } + /** + * + * + *
+     * The requested configs.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + public com.google.cloud.workstations.v1beta.WorkstationConfig.Builder + addWorkstationConfigsBuilder() { + return getWorkstationConfigsFieldBuilder() + .addBuilder(com.google.cloud.workstations.v1beta.WorkstationConfig.getDefaultInstance()); + } + /** + * + * + *
+     * The requested configs.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + public com.google.cloud.workstations.v1beta.WorkstationConfig.Builder + addWorkstationConfigsBuilder(int index) { + return getWorkstationConfigsFieldBuilder() + .addBuilder( + index, com.google.cloud.workstations.v1beta.WorkstationConfig.getDefaultInstance()); + } + /** + * + * + *
+     * The requested configs.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + public java.util.List + getWorkstationConfigsBuilderList() { + return getWorkstationConfigsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationConfig, + com.google.cloud.workstations.v1beta.WorkstationConfig.Builder, + com.google.cloud.workstations.v1beta.WorkstationConfigOrBuilder> + getWorkstationConfigsFieldBuilder() { + if (workstationConfigsBuilder_ == null) { + workstationConfigsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationConfig, + com.google.cloud.workstations.v1beta.WorkstationConfig.Builder, + com.google.cloud.workstations.v1beta.WorkstationConfigOrBuilder>( + workstationConfigs_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + workstationConfigs_ = null; + } + return workstationConfigsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList unreachable_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureUnreachableIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_.getUnmodifiableView(); + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + onChanged(); + return this; + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workstations.v1beta.ListWorkstationConfigsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workstations.v1beta.ListWorkstationConfigsResponse) + private static final com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse(); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListWorkstationConfigsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListWorkstationConfigsResponseOrBuilder.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListWorkstationConfigsResponseOrBuilder.java new file mode 100644 index 000000000000..36a29daf493c --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListWorkstationConfigsResponseOrBuilder.java @@ -0,0 +1,162 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +public interface ListWorkstationConfigsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workstations.v1beta.ListWorkstationConfigsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The requested configs.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + java.util.List + getWorkstationConfigsList(); + /** + * + * + *
+   * The requested configs.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + com.google.cloud.workstations.v1beta.WorkstationConfig getWorkstationConfigs(int index); + /** + * + * + *
+   * The requested configs.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + int getWorkstationConfigsCount(); + /** + * + * + *
+   * The requested configs.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + java.util.List + getWorkstationConfigsOrBuilderList(); + /** + * + * + *
+   * The requested configs.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig workstation_configs = 1; + * + */ + com.google.cloud.workstations.v1beta.WorkstationConfigOrBuilder getWorkstationConfigsOrBuilder( + int index); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListWorkstationsRequest.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListWorkstationsRequest.java new file mode 100644 index 000000000000..abe3e0f63f97 --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListWorkstationsRequest.java @@ -0,0 +1,923 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +/** + * + * + *
+ * Request message for ListWorkstations.
+ * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.ListWorkstationsRequest} + */ +public final class ListWorkstationsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workstations.v1beta.ListWorkstationsRequest) + ListWorkstationsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListWorkstationsRequest.newBuilder() to construct. + private ListWorkstationsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListWorkstationsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListWorkstationsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListWorkstationsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListWorkstationsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.ListWorkstationsRequest.class, + com.google.cloud.workstations.v1beta.ListWorkstationsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + /** + * + * + *
+   * Maximum number of items to return.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workstations.v1beta.ListWorkstationsRequest)) { + return super.equals(obj); + } + com.google.cloud.workstations.v1beta.ListWorkstationsRequest other = + (com.google.cloud.workstations.v1beta.ListWorkstationsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workstations.v1beta.ListWorkstationsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for ListWorkstations.
+   * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.ListWorkstationsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workstations.v1beta.ListWorkstationsRequest) + com.google.cloud.workstations.v1beta.ListWorkstationsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListWorkstationsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListWorkstationsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.ListWorkstationsRequest.class, + com.google.cloud.workstations.v1beta.ListWorkstationsRequest.Builder.class); + } + + // Construct using com.google.cloud.workstations.v1beta.ListWorkstationsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListWorkstationsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.ListWorkstationsRequest + getDefaultInstanceForType() { + return com.google.cloud.workstations.v1beta.ListWorkstationsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.ListWorkstationsRequest build() { + com.google.cloud.workstations.v1beta.ListWorkstationsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.ListWorkstationsRequest buildPartial() { + com.google.cloud.workstations.v1beta.ListWorkstationsRequest result = + new com.google.cloud.workstations.v1beta.ListWorkstationsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.workstations.v1beta.ListWorkstationsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workstations.v1beta.ListWorkstationsRequest) { + return mergeFrom((com.google.cloud.workstations.v1beta.ListWorkstationsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.workstations.v1beta.ListWorkstationsRequest other) { + if (other + == com.google.cloud.workstations.v1beta.ListWorkstationsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent resource name.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Maximum number of items to return.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workstations.v1beta.ListWorkstationsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workstations.v1beta.ListWorkstationsRequest) + private static final com.google.cloud.workstations.v1beta.ListWorkstationsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workstations.v1beta.ListWorkstationsRequest(); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListWorkstationsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.ListWorkstationsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListWorkstationsRequestOrBuilder.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListWorkstationsRequestOrBuilder.java new file mode 100644 index 000000000000..5c7811c58f6b --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListWorkstationsRequestOrBuilder.java @@ -0,0 +1,92 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +public interface ListWorkstationsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workstations.v1beta.ListWorkstationsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Parent resource name.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Maximum number of items to return.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListWorkstationsResponse.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListWorkstationsResponse.java new file mode 100644 index 000000000000..98ce26f821d9 --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListWorkstationsResponse.java @@ -0,0 +1,1416 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +/** + * + * + *
+ * Response message for ListWorkstations.
+ * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.ListWorkstationsResponse} + */ +public final class ListWorkstationsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workstations.v1beta.ListWorkstationsResponse) + ListWorkstationsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListWorkstationsResponse.newBuilder() to construct. + private ListWorkstationsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListWorkstationsResponse() { + workstations_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListWorkstationsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListWorkstationsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListWorkstationsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.ListWorkstationsResponse.class, + com.google.cloud.workstations.v1beta.ListWorkstationsResponse.Builder.class); + } + + public static final int WORKSTATIONS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List workstations_; + /** + * + * + *
+   * The requested workstations.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + @java.lang.Override + public java.util.List getWorkstationsList() { + return workstations_; + } + /** + * + * + *
+   * The requested workstations.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + @java.lang.Override + public java.util.List + getWorkstationsOrBuilderList() { + return workstations_; + } + /** + * + * + *
+   * The requested workstations.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + @java.lang.Override + public int getWorkstationsCount() { + return workstations_.size(); + } + /** + * + * + *
+   * The requested workstations.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.Workstation getWorkstations(int index) { + return workstations_.get(index); + } + /** + * + * + *
+   * The requested workstations.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationOrBuilder getWorkstationsOrBuilder( + int index) { + return workstations_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UNREACHABLE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringList unreachable_; + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < workstations_.size(); i++) { + output.writeMessage(1, workstations_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < workstations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, workstations_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workstations.v1beta.ListWorkstationsResponse)) { + return super.equals(obj); + } + com.google.cloud.workstations.v1beta.ListWorkstationsResponse other = + (com.google.cloud.workstations.v1beta.ListWorkstationsResponse) obj; + + if (!getWorkstationsList().equals(other.getWorkstationsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getWorkstationsCount() > 0) { + hash = (37 * hash) + WORKSTATIONS_FIELD_NUMBER; + hash = (53 * hash) + getWorkstationsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workstations.v1beta.ListWorkstationsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for ListWorkstations.
+   * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.ListWorkstationsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workstations.v1beta.ListWorkstationsResponse) + com.google.cloud.workstations.v1beta.ListWorkstationsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListWorkstationsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListWorkstationsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.ListWorkstationsResponse.class, + com.google.cloud.workstations.v1beta.ListWorkstationsResponse.Builder.class); + } + + // Construct using com.google.cloud.workstations.v1beta.ListWorkstationsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (workstationsBuilder_ == null) { + workstations_ = java.util.Collections.emptyList(); + } else { + workstations_ = null; + workstationsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_ListWorkstationsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.ListWorkstationsResponse + getDefaultInstanceForType() { + return com.google.cloud.workstations.v1beta.ListWorkstationsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.ListWorkstationsResponse build() { + com.google.cloud.workstations.v1beta.ListWorkstationsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.ListWorkstationsResponse buildPartial() { + com.google.cloud.workstations.v1beta.ListWorkstationsResponse result = + new com.google.cloud.workstations.v1beta.ListWorkstationsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.workstations.v1beta.ListWorkstationsResponse result) { + if (workstationsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + workstations_ = java.util.Collections.unmodifiableList(workstations_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.workstations_ = workstations_; + } else { + result.workstations_ = workstationsBuilder_.build(); + } + if (((bitField0_ & 0x00000004) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.unreachable_ = unreachable_; + } + + private void buildPartial0( + com.google.cloud.workstations.v1beta.ListWorkstationsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workstations.v1beta.ListWorkstationsResponse) { + return mergeFrom((com.google.cloud.workstations.v1beta.ListWorkstationsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.workstations.v1beta.ListWorkstationsResponse other) { + if (other + == com.google.cloud.workstations.v1beta.ListWorkstationsResponse.getDefaultInstance()) + return this; + if (workstationsBuilder_ == null) { + if (!other.workstations_.isEmpty()) { + if (workstations_.isEmpty()) { + workstations_ = other.workstations_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureWorkstationsIsMutable(); + workstations_.addAll(other.workstations_); + } + onChanged(); + } + } else { + if (!other.workstations_.isEmpty()) { + if (workstationsBuilder_.isEmpty()) { + workstationsBuilder_.dispose(); + workstationsBuilder_ = null; + workstations_ = other.workstations_; + bitField0_ = (bitField0_ & ~0x00000001); + workstationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getWorkstationsFieldBuilder() + : null; + } else { + workstationsBuilder_.addAllMessages(other.workstations_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.workstations.v1beta.Workstation m = + input.readMessage( + com.google.cloud.workstations.v1beta.Workstation.parser(), + extensionRegistry); + if (workstationsBuilder_ == null) { + ensureWorkstationsIsMutable(); + workstations_.add(m); + } else { + workstationsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUnreachableIsMutable(); + unreachable_.add(s); + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List workstations_ = + java.util.Collections.emptyList(); + + private void ensureWorkstationsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + workstations_ = + new java.util.ArrayList( + workstations_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.workstations.v1beta.Workstation, + com.google.cloud.workstations.v1beta.Workstation.Builder, + com.google.cloud.workstations.v1beta.WorkstationOrBuilder> + workstationsBuilder_; + + /** + * + * + *
+     * The requested workstations.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + public java.util.List getWorkstationsList() { + if (workstationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(workstations_); + } else { + return workstationsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The requested workstations.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + public int getWorkstationsCount() { + if (workstationsBuilder_ == null) { + return workstations_.size(); + } else { + return workstationsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The requested workstations.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + public com.google.cloud.workstations.v1beta.Workstation getWorkstations(int index) { + if (workstationsBuilder_ == null) { + return workstations_.get(index); + } else { + return workstationsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The requested workstations.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + public Builder setWorkstations( + int index, com.google.cloud.workstations.v1beta.Workstation value) { + if (workstationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWorkstationsIsMutable(); + workstations_.set(index, value); + onChanged(); + } else { + workstationsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The requested workstations.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + public Builder setWorkstations( + int index, com.google.cloud.workstations.v1beta.Workstation.Builder builderForValue) { + if (workstationsBuilder_ == null) { + ensureWorkstationsIsMutable(); + workstations_.set(index, builderForValue.build()); + onChanged(); + } else { + workstationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The requested workstations.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + public Builder addWorkstations(com.google.cloud.workstations.v1beta.Workstation value) { + if (workstationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWorkstationsIsMutable(); + workstations_.add(value); + onChanged(); + } else { + workstationsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The requested workstations.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + public Builder addWorkstations( + int index, com.google.cloud.workstations.v1beta.Workstation value) { + if (workstationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWorkstationsIsMutable(); + workstations_.add(index, value); + onChanged(); + } else { + workstationsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The requested workstations.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + public Builder addWorkstations( + com.google.cloud.workstations.v1beta.Workstation.Builder builderForValue) { + if (workstationsBuilder_ == null) { + ensureWorkstationsIsMutable(); + workstations_.add(builderForValue.build()); + onChanged(); + } else { + workstationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The requested workstations.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + public Builder addWorkstations( + int index, com.google.cloud.workstations.v1beta.Workstation.Builder builderForValue) { + if (workstationsBuilder_ == null) { + ensureWorkstationsIsMutable(); + workstations_.add(index, builderForValue.build()); + onChanged(); + } else { + workstationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The requested workstations.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + public Builder addAllWorkstations( + java.lang.Iterable values) { + if (workstationsBuilder_ == null) { + ensureWorkstationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, workstations_); + onChanged(); + } else { + workstationsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The requested workstations.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + public Builder clearWorkstations() { + if (workstationsBuilder_ == null) { + workstations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + workstationsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The requested workstations.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + public Builder removeWorkstations(int index) { + if (workstationsBuilder_ == null) { + ensureWorkstationsIsMutable(); + workstations_.remove(index); + onChanged(); + } else { + workstationsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The requested workstations.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + public com.google.cloud.workstations.v1beta.Workstation.Builder getWorkstationsBuilder( + int index) { + return getWorkstationsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The requested workstations.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + public com.google.cloud.workstations.v1beta.WorkstationOrBuilder getWorkstationsOrBuilder( + int index) { + if (workstationsBuilder_ == null) { + return workstations_.get(index); + } else { + return workstationsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The requested workstations.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + public java.util.List + getWorkstationsOrBuilderList() { + if (workstationsBuilder_ != null) { + return workstationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(workstations_); + } + } + /** + * + * + *
+     * The requested workstations.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + public com.google.cloud.workstations.v1beta.Workstation.Builder addWorkstationsBuilder() { + return getWorkstationsFieldBuilder() + .addBuilder(com.google.cloud.workstations.v1beta.Workstation.getDefaultInstance()); + } + /** + * + * + *
+     * The requested workstations.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + public com.google.cloud.workstations.v1beta.Workstation.Builder addWorkstationsBuilder( + int index) { + return getWorkstationsFieldBuilder() + .addBuilder(index, com.google.cloud.workstations.v1beta.Workstation.getDefaultInstance()); + } + /** + * + * + *
+     * The requested workstations.
+     * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + public java.util.List + getWorkstationsBuilderList() { + return getWorkstationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.workstations.v1beta.Workstation, + com.google.cloud.workstations.v1beta.Workstation.Builder, + com.google.cloud.workstations.v1beta.WorkstationOrBuilder> + getWorkstationsFieldBuilder() { + if (workstationsBuilder_ == null) { + workstationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.workstations.v1beta.Workstation, + com.google.cloud.workstations.v1beta.Workstation.Builder, + com.google.cloud.workstations.v1beta.WorkstationOrBuilder>( + workstations_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + workstations_ = null; + } + return workstationsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList unreachable_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureUnreachableIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_.getUnmodifiableView(); + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + onChanged(); + return this; + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workstations.v1beta.ListWorkstationsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workstations.v1beta.ListWorkstationsResponse) + private static final com.google.cloud.workstations.v1beta.ListWorkstationsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workstations.v1beta.ListWorkstationsResponse(); + } + + public static com.google.cloud.workstations.v1beta.ListWorkstationsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListWorkstationsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.ListWorkstationsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListWorkstationsResponseOrBuilder.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListWorkstationsResponseOrBuilder.java new file mode 100644 index 000000000000..771a541e8af9 --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/ListWorkstationsResponseOrBuilder.java @@ -0,0 +1,155 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +public interface ListWorkstationsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workstations.v1beta.ListWorkstationsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The requested workstations.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + java.util.List getWorkstationsList(); + /** + * + * + *
+   * The requested workstations.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + com.google.cloud.workstations.v1beta.Workstation getWorkstations(int index); + /** + * + * + *
+   * The requested workstations.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + int getWorkstationsCount(); + /** + * + * + *
+   * The requested workstations.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + java.util.List + getWorkstationsOrBuilderList(); + /** + * + * + *
+   * The requested workstations.
+   * 
+ * + * repeated .google.cloud.workstations.v1beta.Workstation workstations = 1; + */ + com.google.cloud.workstations.v1beta.WorkstationOrBuilder getWorkstationsOrBuilder(int index); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/LocationName.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/LocationName.java new file mode 100644 index 000000000000..3e46689ffe6b --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/LocationName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2022 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.workstations.v1beta; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class LocationName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + + @Deprecated + protected LocationName() { + project = null; + location = null; + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LocationName of(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + public static String format(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + public static LocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION.validatedMatch( + formattedString, "LocationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (LocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION.instantiate("project", project, "location", location); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + LocationName that = ((LocationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for projects/{project}/locations/{location}. */ + public static class Builder { + private String project; + private String location; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder(LocationName locationName) { + this.project = locationName.project; + this.location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/OperationMetadata.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/OperationMetadata.java new file mode 100644 index 000000000000..38df5b8e41b5 --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/OperationMetadata.java @@ -0,0 +1,1822 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +/** + * + * + *
+ * Metadata for long-running operations.
+ * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.OperationMetadata} + */ +public final class OperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workstations.v1beta.OperationMetadata) + OperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use OperationMetadata.newBuilder() to construct. + private OperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OperationMetadata() { + target_ = ""; + verb_ = ""; + statusMessage_ = ""; + apiVersion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OperationMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.OperationMetadata.class, + com.google.cloud.workstations.v1beta.OperationMetadata.Builder.class); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Time that the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. Time that the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. Time that the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int END_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp endTime_; + /** + * + * + *
+   * Output only. Time that the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endTime_ != null; + } + /** + * + * + *
+   * Output only. Time that the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * Output only. Time that the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + public static final int TARGET_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object target_ = ""; + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + @java.lang.Override + public java.lang.String getTarget() { + java.lang.Object ref = target_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + target_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERB_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object verb_ = ""; + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + @java.lang.Override + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + verb_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATUS_MESSAGE_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object statusMessage_ = ""; + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + @java.lang.Override + public java.lang.String getStatusMessage() { + java.lang.Object ref = statusMessage_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + statusMessage_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStatusMessageBytes() { + java.lang.Object ref = statusMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUESTED_CANCELLATION_FIELD_NUMBER = 6; + private boolean requestedCancellation_ = false; + /** + * + * + *
+   * Output only. Identifies whether the user has requested cancellation
+   * of the operation.
+   * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + @java.lang.Override + public boolean getRequestedCancellation() { + return requestedCancellation_; + } + + public static final int API_VERSION_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object apiVersion_ = ""; + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + @java.lang.Override + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + apiVersion_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (createTime_ != null) { + output.writeMessage(1, getCreateTime()); + } + if (endTime_ != null) { + output.writeMessage(2, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(target_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, target_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(verb_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, verb_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(statusMessage_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, statusMessage_); + } + if (requestedCancellation_ != false) { + output.writeBool(6, requestedCancellation_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiVersion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, apiVersion_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCreateTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(target_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, target_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(verb_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, verb_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(statusMessage_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, statusMessage_); + } + if (requestedCancellation_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, requestedCancellation_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiVersion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, apiVersion_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workstations.v1beta.OperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.workstations.v1beta.OperationMetadata other = + (com.google.cloud.workstations.v1beta.OperationMetadata) obj; + + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!getTarget().equals(other.getTarget())) return false; + if (!getVerb().equals(other.getVerb())) return false; + if (!getStatusMessage().equals(other.getStatusMessage())) return false; + if (getRequestedCancellation() != other.getRequestedCancellation()) return false; + if (!getApiVersion().equals(other.getApiVersion())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (37 * hash) + TARGET_FIELD_NUMBER; + hash = (53 * hash) + getTarget().hashCode(); + hash = (37 * hash) + VERB_FIELD_NUMBER; + hash = (53 * hash) + getVerb().hashCode(); + hash = (37 * hash) + STATUS_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getStatusMessage().hashCode(); + hash = (37 * hash) + REQUESTED_CANCELLATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRequestedCancellation()); + hash = (37 * hash) + API_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getApiVersion().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workstations.v1beta.OperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.OperationMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.OperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.OperationMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.OperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.OperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.OperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.OperationMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.OperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.OperationMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.OperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.OperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workstations.v1beta.OperationMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Metadata for long-running operations.
+   * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.OperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workstations.v1beta.OperationMetadata) + com.google.cloud.workstations.v1beta.OperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.OperationMetadata.class, + com.google.cloud.workstations.v1beta.OperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.workstations.v1beta.OperationMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + target_ = ""; + verb_ = ""; + statusMessage_ = ""; + requestedCancellation_ = false; + apiVersion_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_OperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.OperationMetadata getDefaultInstanceForType() { + return com.google.cloud.workstations.v1beta.OperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.OperationMetadata build() { + com.google.cloud.workstations.v1beta.OperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.OperationMetadata buildPartial() { + com.google.cloud.workstations.v1beta.OperationMetadata result = + new com.google.cloud.workstations.v1beta.OperationMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.workstations.v1beta.OperationMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.target_ = target_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.verb_ = verb_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.statusMessage_ = statusMessage_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.requestedCancellation_ = requestedCancellation_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.apiVersion_ = apiVersion_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workstations.v1beta.OperationMetadata) { + return mergeFrom((com.google.cloud.workstations.v1beta.OperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.workstations.v1beta.OperationMetadata other) { + if (other == com.google.cloud.workstations.v1beta.OperationMetadata.getDefaultInstance()) + return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (!other.getTarget().isEmpty()) { + target_ = other.target_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getVerb().isEmpty()) { + verb_ = other.verb_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getStatusMessage().isEmpty()) { + statusMessage_ = other.statusMessage_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.getRequestedCancellation() != false) { + setRequestedCancellation(other.getRequestedCancellation()); + } + if (!other.getApiVersion().isEmpty()) { + apiVersion_ = other.apiVersion_; + bitField0_ |= 0x00000040; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + target_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + verb_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + statusMessage_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 48: + { + requestedCancellation_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 58: + { + apiVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. Time that the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Output only. Time that the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Time that the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time that the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time that the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time that the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000001); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time that the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Time that the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. Time that the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+     * Output only. Time that the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Output only. Time that the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Time that the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + } else { + endTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time that the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time that the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time that the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000002); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time that the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Time that the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + * + * + *
+     * Output only. Time that the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private java.lang.Object target_ = ""; + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + public java.lang.String getTarget() { + java.lang.Object ref = target_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + target_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The target to set. + * @return This builder for chaining. + */ + public Builder setTarget(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + target_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearTarget() { + target_ = getDefaultInstance().getTarget(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for target to set. + * @return This builder for chaining. + */ + public Builder setTargetBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + target_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object verb_ = ""; + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + verb_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The verb to set. + * @return This builder for chaining. + */ + public Builder setVerb(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + verb_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearVerb() { + verb_ = getDefaultInstance().getVerb(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for verb to set. + * @return This builder for chaining. + */ + public Builder setVerbBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + verb_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object statusMessage_ = ""; + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + public java.lang.String getStatusMessage() { + java.lang.Object ref = statusMessage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + statusMessage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + public com.google.protobuf.ByteString getStatusMessageBytes() { + java.lang.Object ref = statusMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The statusMessage to set. + * @return This builder for chaining. + */ + public Builder setStatusMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + statusMessage_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearStatusMessage() { + statusMessage_ = getDefaultInstance().getStatusMessage(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for statusMessage to set. + * @return This builder for chaining. + */ + public Builder setStatusMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + statusMessage_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private boolean requestedCancellation_; + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation.
+     * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + @java.lang.Override + public boolean getRequestedCancellation() { + return requestedCancellation_; + } + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation.
+     * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The requestedCancellation to set. + * @return This builder for chaining. + */ + public Builder setRequestedCancellation(boolean value) { + + requestedCancellation_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation.
+     * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearRequestedCancellation() { + bitField0_ = (bitField0_ & ~0x00000020); + requestedCancellation_ = false; + onChanged(); + return this; + } + + private java.lang.Object apiVersion_ = ""; + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + apiVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + apiVersion_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearApiVersion() { + apiVersion_ = getDefaultInstance().getApiVersion(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + apiVersion_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workstations.v1beta.OperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workstations.v1beta.OperationMetadata) + private static final com.google.cloud.workstations.v1beta.OperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workstations.v1beta.OperationMetadata(); + } + + public static com.google.cloud.workstations.v1beta.OperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.OperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/OperationMetadataOrBuilder.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/OperationMetadataOrBuilder.java new file mode 100644 index 000000000000..fd274b56bbc0 --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/OperationMetadataOrBuilder.java @@ -0,0 +1,215 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +public interface OperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workstations.v1beta.OperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Time that the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Time that the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Time that the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Time that the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + * + * + *
+   * Output only. Time that the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * Output only. Time that the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + java.lang.String getTarget(); + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + com.google.protobuf.ByteString getTargetBytes(); + + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + java.lang.String getVerb(); + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + com.google.protobuf.ByteString getVerbBytes(); + + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + java.lang.String getStatusMessage(); + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + com.google.protobuf.ByteString getStatusMessageBytes(); + + /** + * + * + *
+   * Output only. Identifies whether the user has requested cancellation
+   * of the operation.
+   * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + boolean getRequestedCancellation(); + + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + java.lang.String getApiVersion(); + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + com.google.protobuf.ByteString getApiVersionBytes(); +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/StartWorkstationRequest.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/StartWorkstationRequest.java new file mode 100644 index 000000000000..afd26e3d3ce7 --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/StartWorkstationRequest.java @@ -0,0 +1,934 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +/** + * + * + *
+ * Request message for StartWorkstation.
+ * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.StartWorkstationRequest} + */ +public final class StartWorkstationRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workstations.v1beta.StartWorkstationRequest) + StartWorkstationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use StartWorkstationRequest.newBuilder() to construct. + private StartWorkstationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StartWorkstationRequest() { + name_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StartWorkstationRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_StartWorkstationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_StartWorkstationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.StartWorkstationRequest.class, + com.google.cloud.workstations.v1beta.StartWorkstationRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Name of the workstation to start.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the workstation to start.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 2; + private boolean validateOnly_ = false; + /** + * + * + *
+   * If set, validate the request and preview the review, but do not actually
+   * apply it.
+   * 
+ * + * bool validate_only = 2; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + public static final int ETAG_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * If set, the request will be rejected if the latest version of the
+   * workstation on the server does not have this etag.
+   * 
+ * + * string etag = 3; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * If set, the request will be rejected if the latest version of the
+   * workstation on the server does not have this etag.
+   * 
+ * + * string etag = 3; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (validateOnly_ != false) { + output.writeBool(2, validateOnly_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, etag_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, validateOnly_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, etag_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workstations.v1beta.StartWorkstationRequest)) { + return super.equals(obj); + } + com.google.cloud.workstations.v1beta.StartWorkstationRequest other = + (com.google.cloud.workstations.v1beta.StartWorkstationRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workstations.v1beta.StartWorkstationRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.StartWorkstationRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.StartWorkstationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.StartWorkstationRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.StartWorkstationRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.StartWorkstationRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.StartWorkstationRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.StartWorkstationRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.StartWorkstationRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.StartWorkstationRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.StartWorkstationRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.StartWorkstationRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workstations.v1beta.StartWorkstationRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for StartWorkstation.
+   * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.StartWorkstationRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workstations.v1beta.StartWorkstationRequest) + com.google.cloud.workstations.v1beta.StartWorkstationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_StartWorkstationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_StartWorkstationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.StartWorkstationRequest.class, + com.google.cloud.workstations.v1beta.StartWorkstationRequest.Builder.class); + } + + // Construct using com.google.cloud.workstations.v1beta.StartWorkstationRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + validateOnly_ = false; + etag_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_StartWorkstationRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.StartWorkstationRequest + getDefaultInstanceForType() { + return com.google.cloud.workstations.v1beta.StartWorkstationRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.StartWorkstationRequest build() { + com.google.cloud.workstations.v1beta.StartWorkstationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.StartWorkstationRequest buildPartial() { + com.google.cloud.workstations.v1beta.StartWorkstationRequest result = + new com.google.cloud.workstations.v1beta.StartWorkstationRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.workstations.v1beta.StartWorkstationRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.validateOnly_ = validateOnly_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.etag_ = etag_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workstations.v1beta.StartWorkstationRequest) { + return mergeFrom((com.google.cloud.workstations.v1beta.StartWorkstationRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.workstations.v1beta.StartWorkstationRequest other) { + if (other + == com.google.cloud.workstations.v1beta.StartWorkstationRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the workstation to start.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the workstation to start.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the workstation to start.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the workstation to start.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the workstation to start.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * If set, validate the request and preview the review, but do not actually
+     * apply it.
+     * 
+ * + * bool validate_only = 2; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * If set, validate the request and preview the review, but do not actually
+     * apply it.
+     * 
+ * + * bool validate_only = 2; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * If set, validate the request and preview the review, but do not actually
+     * apply it.
+     * 
+ * + * bool validate_only = 2; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000002); + validateOnly_ = false; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * If set, the request will be rejected if the latest version of the
+     * workstation on the server does not have this etag.
+     * 
+ * + * string etag = 3; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * If set, the request will be rejected if the latest version of the
+     * workstation on the server does not have this etag.
+     * 
+ * + * string etag = 3; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * If set, the request will be rejected if the latest version of the
+     * workstation on the server does not have this etag.
+     * 
+ * + * string etag = 3; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * If set, the request will be rejected if the latest version of the
+     * workstation on the server does not have this etag.
+     * 
+ * + * string etag = 3; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * If set, the request will be rejected if the latest version of the
+     * workstation on the server does not have this etag.
+     * 
+ * + * string etag = 3; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workstations.v1beta.StartWorkstationRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workstations.v1beta.StartWorkstationRequest) + private static final com.google.cloud.workstations.v1beta.StartWorkstationRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workstations.v1beta.StartWorkstationRequest(); + } + + public static com.google.cloud.workstations.v1beta.StartWorkstationRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StartWorkstationRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.StartWorkstationRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/StartWorkstationRequestOrBuilder.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/StartWorkstationRequestOrBuilder.java new file mode 100644 index 000000000000..fc45a5e2b33c --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/StartWorkstationRequestOrBuilder.java @@ -0,0 +1,95 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +public interface StartWorkstationRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workstations.v1beta.StartWorkstationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the workstation to start.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the workstation to start.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * If set, validate the request and preview the review, but do not actually
+   * apply it.
+   * 
+ * + * bool validate_only = 2; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + /** + * + * + *
+   * If set, the request will be rejected if the latest version of the
+   * workstation on the server does not have this etag.
+   * 
+ * + * string etag = 3; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * If set, the request will be rejected if the latest version of the
+   * workstation on the server does not have this etag.
+   * 
+ * + * string etag = 3; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/StopWorkstationRequest.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/StopWorkstationRequest.java new file mode 100644 index 000000000000..e9d74a60b1cf --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/StopWorkstationRequest.java @@ -0,0 +1,930 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +/** + * + * + *
+ * Request message for StopWorkstation.
+ * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.StopWorkstationRequest} + */ +public final class StopWorkstationRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workstations.v1beta.StopWorkstationRequest) + StopWorkstationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use StopWorkstationRequest.newBuilder() to construct. + private StopWorkstationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StopWorkstationRequest() { + name_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StopWorkstationRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_StopWorkstationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_StopWorkstationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.StopWorkstationRequest.class, + com.google.cloud.workstations.v1beta.StopWorkstationRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Name of the workstation to stop.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the workstation to stop.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 2; + private boolean validateOnly_ = false; + /** + * + * + *
+   * If set, validate the request and preview the review, but do not actually
+   * apply it.
+   * 
+ * + * bool validate_only = 2; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + public static final int ETAG_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * If set, the request will be rejected if the latest version of the
+   * workstation on the server does not have this etag.
+   * 
+ * + * string etag = 3; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * If set, the request will be rejected if the latest version of the
+   * workstation on the server does not have this etag.
+   * 
+ * + * string etag = 3; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (validateOnly_ != false) { + output.writeBool(2, validateOnly_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, etag_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, validateOnly_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, etag_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workstations.v1beta.StopWorkstationRequest)) { + return super.equals(obj); + } + com.google.cloud.workstations.v1beta.StopWorkstationRequest other = + (com.google.cloud.workstations.v1beta.StopWorkstationRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workstations.v1beta.StopWorkstationRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.StopWorkstationRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.StopWorkstationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.StopWorkstationRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.StopWorkstationRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.StopWorkstationRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.StopWorkstationRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.StopWorkstationRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.StopWorkstationRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.StopWorkstationRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.StopWorkstationRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.StopWorkstationRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workstations.v1beta.StopWorkstationRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for StopWorkstation.
+   * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.StopWorkstationRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workstations.v1beta.StopWorkstationRequest) + com.google.cloud.workstations.v1beta.StopWorkstationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_StopWorkstationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_StopWorkstationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.StopWorkstationRequest.class, + com.google.cloud.workstations.v1beta.StopWorkstationRequest.Builder.class); + } + + // Construct using com.google.cloud.workstations.v1beta.StopWorkstationRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + validateOnly_ = false; + etag_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_StopWorkstationRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.StopWorkstationRequest getDefaultInstanceForType() { + return com.google.cloud.workstations.v1beta.StopWorkstationRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.StopWorkstationRequest build() { + com.google.cloud.workstations.v1beta.StopWorkstationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.StopWorkstationRequest buildPartial() { + com.google.cloud.workstations.v1beta.StopWorkstationRequest result = + new com.google.cloud.workstations.v1beta.StopWorkstationRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.workstations.v1beta.StopWorkstationRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.validateOnly_ = validateOnly_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.etag_ = etag_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workstations.v1beta.StopWorkstationRequest) { + return mergeFrom((com.google.cloud.workstations.v1beta.StopWorkstationRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.workstations.v1beta.StopWorkstationRequest other) { + if (other == com.google.cloud.workstations.v1beta.StopWorkstationRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the workstation to stop.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the workstation to stop.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the workstation to stop.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the workstation to stop.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the workstation to stop.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * If set, validate the request and preview the review, but do not actually
+     * apply it.
+     * 
+ * + * bool validate_only = 2; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * If set, validate the request and preview the review, but do not actually
+     * apply it.
+     * 
+ * + * bool validate_only = 2; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * If set, validate the request and preview the review, but do not actually
+     * apply it.
+     * 
+ * + * bool validate_only = 2; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000002); + validateOnly_ = false; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * If set, the request will be rejected if the latest version of the
+     * workstation on the server does not have this etag.
+     * 
+ * + * string etag = 3; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * If set, the request will be rejected if the latest version of the
+     * workstation on the server does not have this etag.
+     * 
+ * + * string etag = 3; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * If set, the request will be rejected if the latest version of the
+     * workstation on the server does not have this etag.
+     * 
+ * + * string etag = 3; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * If set, the request will be rejected if the latest version of the
+     * workstation on the server does not have this etag.
+     * 
+ * + * string etag = 3; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * If set, the request will be rejected if the latest version of the
+     * workstation on the server does not have this etag.
+     * 
+ * + * string etag = 3; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workstations.v1beta.StopWorkstationRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workstations.v1beta.StopWorkstationRequest) + private static final com.google.cloud.workstations.v1beta.StopWorkstationRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workstations.v1beta.StopWorkstationRequest(); + } + + public static com.google.cloud.workstations.v1beta.StopWorkstationRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StopWorkstationRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.StopWorkstationRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/StopWorkstationRequestOrBuilder.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/StopWorkstationRequestOrBuilder.java new file mode 100644 index 000000000000..fc4d20b5f42b --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/StopWorkstationRequestOrBuilder.java @@ -0,0 +1,95 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +public interface StopWorkstationRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workstations.v1beta.StopWorkstationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the workstation to stop.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the workstation to stop.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * If set, validate the request and preview the review, but do not actually
+   * apply it.
+   * 
+ * + * bool validate_only = 2; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + /** + * + * + *
+   * If set, the request will be rejected if the latest version of the
+   * workstation on the server does not have this etag.
+   * 
+ * + * string etag = 3; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * If set, the request will be rejected if the latest version of the
+   * workstation on the server does not have this etag.
+   * 
+ * + * string etag = 3; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/UpdateWorkstationClusterRequest.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/UpdateWorkstationClusterRequest.java new file mode 100644 index 000000000000..ae1c81cb2b79 --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/UpdateWorkstationClusterRequest.java @@ -0,0 +1,1236 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +/** + * + * + *
+ * Request message for UpdateWorkstationCluster.
+ * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest} + */ +public final class UpdateWorkstationClusterRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest) + UpdateWorkstationClusterRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateWorkstationClusterRequest.newBuilder() to construct. + private UpdateWorkstationClusterRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateWorkstationClusterRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateWorkstationClusterRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_UpdateWorkstationClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_UpdateWorkstationClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest.class, + com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest.Builder.class); + } + + public static final int WORKSTATION_CLUSTER_FIELD_NUMBER = 1; + private com.google.cloud.workstations.v1beta.WorkstationCluster workstationCluster_; + /** + * + * + *
+   * Required. Workstation cluster to update.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster workstation_cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the workstationCluster field is set. + */ + @java.lang.Override + public boolean hasWorkstationCluster() { + return workstationCluster_ != null; + } + /** + * + * + *
+   * Required. Workstation cluster to update.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster workstation_cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The workstationCluster. + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationCluster getWorkstationCluster() { + return workstationCluster_ == null + ? com.google.cloud.workstations.v1beta.WorkstationCluster.getDefaultInstance() + : workstationCluster_; + } + /** + * + * + *
+   * Required. Workstation cluster to update.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster workstation_cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationClusterOrBuilder + getWorkstationClusterOrBuilder() { + return workstationCluster_ == null + ? com.google.cloud.workstations.v1beta.WorkstationCluster.getDefaultInstance() + : workstationCluster_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. Mask that specifies which fields in the workstation cluster
+   * should be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Required. Mask that specifies which fields in the workstation cluster
+   * should be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Required. Mask that specifies which fields in the workstation cluster
+   * should be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 3; + private boolean validateOnly_ = false; + /** + * + * + *
+   * If set, validate the request and preview the review, but do not actually
+   * apply it.
+   * 
+ * + * bool validate_only = 3; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + public static final int ALLOW_MISSING_FIELD_NUMBER = 4; + private boolean allowMissing_ = false; + /** + * + * + *
+   * If set, and the workstation cluster is not found, a new workstation
+   * cluster will be created. In this situation, update_mask is ignored.
+   * 
+ * + * bool allow_missing = 4; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (workstationCluster_ != null) { + output.writeMessage(1, getWorkstationCluster()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + if (validateOnly_ != false) { + output.writeBool(3, validateOnly_); + } + if (allowMissing_ != false) { + output.writeBool(4, allowMissing_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (workstationCluster_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getWorkstationCluster()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, validateOnly_); + } + if (allowMissing_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, allowMissing_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest)) { + return super.equals(obj); + } + com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest other = + (com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest) obj; + + if (hasWorkstationCluster() != other.hasWorkstationCluster()) return false; + if (hasWorkstationCluster()) { + if (!getWorkstationCluster().equals(other.getWorkstationCluster())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (getValidateOnly() != other.getValidateOnly()) return false; + if (getAllowMissing() != other.getAllowMissing()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasWorkstationCluster()) { + hash = (37 * hash) + WORKSTATION_CLUSTER_FIELD_NUMBER; + hash = (53 * hash) + getWorkstationCluster().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (37 * hash) + ALLOW_MISSING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowMissing()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for UpdateWorkstationCluster.
+   * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest) + com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_UpdateWorkstationClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_UpdateWorkstationClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest.class, + com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest.Builder.class); + } + + // Construct using + // com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + workstationCluster_ = null; + if (workstationClusterBuilder_ != null) { + workstationClusterBuilder_.dispose(); + workstationClusterBuilder_ = null; + } + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + validateOnly_ = false; + allowMissing_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_UpdateWorkstationClusterRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest + getDefaultInstanceForType() { + return com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest build() { + com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest buildPartial() { + com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest result = + new com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.workstationCluster_ = + workstationClusterBuilder_ == null + ? workstationCluster_ + : workstationClusterBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.validateOnly_ = validateOnly_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.allowMissing_ = allowMissing_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest) { + return mergeFrom( + (com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest other) { + if (other + == com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest + .getDefaultInstance()) return this; + if (other.hasWorkstationCluster()) { + mergeWorkstationCluster(other.getWorkstationCluster()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + if (other.getAllowMissing() != false) { + setAllowMissing(other.getAllowMissing()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + getWorkstationClusterFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + allowMissing_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.workstations.v1beta.WorkstationCluster workstationCluster_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationCluster, + com.google.cloud.workstations.v1beta.WorkstationCluster.Builder, + com.google.cloud.workstations.v1beta.WorkstationClusterOrBuilder> + workstationClusterBuilder_; + /** + * + * + *
+     * Required. Workstation cluster to update.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster workstation_cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the workstationCluster field is set. + */ + public boolean hasWorkstationCluster() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. Workstation cluster to update.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster workstation_cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The workstationCluster. + */ + public com.google.cloud.workstations.v1beta.WorkstationCluster getWorkstationCluster() { + if (workstationClusterBuilder_ == null) { + return workstationCluster_ == null + ? com.google.cloud.workstations.v1beta.WorkstationCluster.getDefaultInstance() + : workstationCluster_; + } else { + return workstationClusterBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Workstation cluster to update.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster workstation_cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setWorkstationCluster( + com.google.cloud.workstations.v1beta.WorkstationCluster value) { + if (workstationClusterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + workstationCluster_ = value; + } else { + workstationClusterBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Workstation cluster to update.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster workstation_cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setWorkstationCluster( + com.google.cloud.workstations.v1beta.WorkstationCluster.Builder builderForValue) { + if (workstationClusterBuilder_ == null) { + workstationCluster_ = builderForValue.build(); + } else { + workstationClusterBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Workstation cluster to update.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster workstation_cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeWorkstationCluster( + com.google.cloud.workstations.v1beta.WorkstationCluster value) { + if (workstationClusterBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && workstationCluster_ != null + && workstationCluster_ + != com.google.cloud.workstations.v1beta.WorkstationCluster.getDefaultInstance()) { + getWorkstationClusterBuilder().mergeFrom(value); + } else { + workstationCluster_ = value; + } + } else { + workstationClusterBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Workstation cluster to update.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster workstation_cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearWorkstationCluster() { + bitField0_ = (bitField0_ & ~0x00000001); + workstationCluster_ = null; + if (workstationClusterBuilder_ != null) { + workstationClusterBuilder_.dispose(); + workstationClusterBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Workstation cluster to update.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster workstation_cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.workstations.v1beta.WorkstationCluster.Builder + getWorkstationClusterBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getWorkstationClusterFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Workstation cluster to update.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster workstation_cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.workstations.v1beta.WorkstationClusterOrBuilder + getWorkstationClusterOrBuilder() { + if (workstationClusterBuilder_ != null) { + return workstationClusterBuilder_.getMessageOrBuilder(); + } else { + return workstationCluster_ == null + ? com.google.cloud.workstations.v1beta.WorkstationCluster.getDefaultInstance() + : workstationCluster_; + } + } + /** + * + * + *
+     * Required. Workstation cluster to update.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster workstation_cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationCluster, + com.google.cloud.workstations.v1beta.WorkstationCluster.Builder, + com.google.cloud.workstations.v1beta.WorkstationClusterOrBuilder> + getWorkstationClusterFieldBuilder() { + if (workstationClusterBuilder_ == null) { + workstationClusterBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationCluster, + com.google.cloud.workstations.v1beta.WorkstationCluster.Builder, + com.google.cloud.workstations.v1beta.WorkstationClusterOrBuilder>( + getWorkstationCluster(), getParentForChildren(), isClean()); + workstationCluster_ = null; + } + return workstationClusterBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Required. Mask that specifies which fields in the workstation cluster
+     * should be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. Mask that specifies which fields in the workstation cluster
+     * should be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Mask that specifies which fields in the workstation cluster
+     * should be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Mask that specifies which fields in the workstation cluster
+     * should be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Mask that specifies which fields in the workstation cluster
+     * should be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Mask that specifies which fields in the workstation cluster
+     * should be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Mask that specifies which fields in the workstation cluster
+     * should be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Mask that specifies which fields in the workstation cluster
+     * should be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Required. Mask that specifies which fields in the workstation cluster
+     * should be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + private boolean validateOnly_; + /** + * + * + *
+     * If set, validate the request and preview the review, but do not actually
+     * apply it.
+     * 
+ * + * bool validate_only = 3; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * If set, validate the request and preview the review, but do not actually
+     * apply it.
+     * 
+ * + * bool validate_only = 3; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * If set, validate the request and preview the review, but do not actually
+     * apply it.
+     * 
+ * + * bool validate_only = 3; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000004); + validateOnly_ = false; + onChanged(); + return this; + } + + private boolean allowMissing_; + /** + * + * + *
+     * If set, and the workstation cluster is not found, a new workstation
+     * cluster will be created. In this situation, update_mask is ignored.
+     * 
+ * + * bool allow_missing = 4; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + /** + * + * + *
+     * If set, and the workstation cluster is not found, a new workstation
+     * cluster will be created. In this situation, update_mask is ignored.
+     * 
+ * + * bool allow_missing = 4; + * + * @param value The allowMissing to set. + * @return This builder for chaining. + */ + public Builder setAllowMissing(boolean value) { + + allowMissing_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * If set, and the workstation cluster is not found, a new workstation
+     * cluster will be created. In this situation, update_mask is ignored.
+     * 
+ * + * bool allow_missing = 4; + * + * @return This builder for chaining. + */ + public Builder clearAllowMissing() { + bitField0_ = (bitField0_ & ~0x00000008); + allowMissing_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest) + private static final com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest(); + } + + public static com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateWorkstationClusterRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/UpdateWorkstationClusterRequestOrBuilder.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/UpdateWorkstationClusterRequestOrBuilder.java new file mode 100644 index 000000000000..7aa9c7de9091 --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/UpdateWorkstationClusterRequestOrBuilder.java @@ -0,0 +1,135 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +public interface UpdateWorkstationClusterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Workstation cluster to update.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster workstation_cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the workstationCluster field is set. + */ + boolean hasWorkstationCluster(); + /** + * + * + *
+   * Required. Workstation cluster to update.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster workstation_cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The workstationCluster. + */ + com.google.cloud.workstations.v1beta.WorkstationCluster getWorkstationCluster(); + /** + * + * + *
+   * Required. Workstation cluster to update.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster workstation_cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.workstations.v1beta.WorkstationClusterOrBuilder getWorkstationClusterOrBuilder(); + + /** + * + * + *
+   * Required. Mask that specifies which fields in the workstation cluster
+   * should be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. Mask that specifies which fields in the workstation cluster
+   * should be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. Mask that specifies which fields in the workstation cluster
+   * should be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * If set, validate the request and preview the review, but do not actually
+   * apply it.
+   * 
+ * + * bool validate_only = 3; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + /** + * + * + *
+   * If set, and the workstation cluster is not found, a new workstation
+   * cluster will be created. In this situation, update_mask is ignored.
+   * 
+ * + * bool allow_missing = 4; + * + * @return The allowMissing. + */ + boolean getAllowMissing(); +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/UpdateWorkstationConfigRequest.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/UpdateWorkstationConfigRequest.java new file mode 100644 index 000000000000..d2cbed064bef --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/UpdateWorkstationConfigRequest.java @@ -0,0 +1,1224 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +/** + * + * + *
+ * Request message for UpdateWorkstationConfig.
+ * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest} + */ +public final class UpdateWorkstationConfigRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest) + UpdateWorkstationConfigRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateWorkstationConfigRequest.newBuilder() to construct. + private UpdateWorkstationConfigRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateWorkstationConfigRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateWorkstationConfigRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_UpdateWorkstationConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_UpdateWorkstationConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest.class, + com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest.Builder.class); + } + + public static final int WORKSTATION_CONFIG_FIELD_NUMBER = 1; + private com.google.cloud.workstations.v1beta.WorkstationConfig workstationConfig_; + /** + * + * + *
+   * Required. Config to update.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig workstation_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the workstationConfig field is set. + */ + @java.lang.Override + public boolean hasWorkstationConfig() { + return workstationConfig_ != null; + } + /** + * + * + *
+   * Required. Config to update.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig workstation_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The workstationConfig. + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig getWorkstationConfig() { + return workstationConfig_ == null + ? com.google.cloud.workstations.v1beta.WorkstationConfig.getDefaultInstance() + : workstationConfig_; + } + /** + * + * + *
+   * Required. Config to update.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig workstation_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfigOrBuilder + getWorkstationConfigOrBuilder() { + return workstationConfig_ == null + ? com.google.cloud.workstations.v1beta.WorkstationConfig.getDefaultInstance() + : workstationConfig_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. Mask specifying which fields in the config should be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Required. Mask specifying which fields in the config should be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Required. Mask specifying which fields in the config should be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 3; + private boolean validateOnly_ = false; + /** + * + * + *
+   * If set, validate the request and preview the review, but do not actually
+   * apply it.
+   * 
+ * + * bool validate_only = 3; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + public static final int ALLOW_MISSING_FIELD_NUMBER = 4; + private boolean allowMissing_ = false; + /** + * + * + *
+   * If set, and the config is not found, a new config will be created.
+   * In this situation, update_mask is ignored.
+   * 
+ * + * bool allow_missing = 4; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (workstationConfig_ != null) { + output.writeMessage(1, getWorkstationConfig()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + if (validateOnly_ != false) { + output.writeBool(3, validateOnly_); + } + if (allowMissing_ != false) { + output.writeBool(4, allowMissing_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (workstationConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getWorkstationConfig()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, validateOnly_); + } + if (allowMissing_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, allowMissing_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest)) { + return super.equals(obj); + } + com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest other = + (com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest) obj; + + if (hasWorkstationConfig() != other.hasWorkstationConfig()) return false; + if (hasWorkstationConfig()) { + if (!getWorkstationConfig().equals(other.getWorkstationConfig())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (getValidateOnly() != other.getValidateOnly()) return false; + if (getAllowMissing() != other.getAllowMissing()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasWorkstationConfig()) { + hash = (37 * hash) + WORKSTATION_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getWorkstationConfig().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (37 * hash) + ALLOW_MISSING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowMissing()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for UpdateWorkstationConfig.
+   * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest) + com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_UpdateWorkstationConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_UpdateWorkstationConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest.class, + com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest.Builder.class); + } + + // Construct using + // com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + workstationConfig_ = null; + if (workstationConfigBuilder_ != null) { + workstationConfigBuilder_.dispose(); + workstationConfigBuilder_ = null; + } + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + validateOnly_ = false; + allowMissing_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_UpdateWorkstationConfigRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest + getDefaultInstanceForType() { + return com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest build() { + com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest buildPartial() { + com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest result = + new com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.workstationConfig_ = + workstationConfigBuilder_ == null + ? workstationConfig_ + : workstationConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.validateOnly_ = validateOnly_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.allowMissing_ = allowMissing_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest) { + return mergeFrom( + (com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest other) { + if (other + == com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest + .getDefaultInstance()) return this; + if (other.hasWorkstationConfig()) { + mergeWorkstationConfig(other.getWorkstationConfig()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + if (other.getAllowMissing() != false) { + setAllowMissing(other.getAllowMissing()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + getWorkstationConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + allowMissing_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.workstations.v1beta.WorkstationConfig workstationConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationConfig, + com.google.cloud.workstations.v1beta.WorkstationConfig.Builder, + com.google.cloud.workstations.v1beta.WorkstationConfigOrBuilder> + workstationConfigBuilder_; + /** + * + * + *
+     * Required. Config to update.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig workstation_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the workstationConfig field is set. + */ + public boolean hasWorkstationConfig() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. Config to update.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig workstation_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The workstationConfig. + */ + public com.google.cloud.workstations.v1beta.WorkstationConfig getWorkstationConfig() { + if (workstationConfigBuilder_ == null) { + return workstationConfig_ == null + ? com.google.cloud.workstations.v1beta.WorkstationConfig.getDefaultInstance() + : workstationConfig_; + } else { + return workstationConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Config to update.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig workstation_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setWorkstationConfig( + com.google.cloud.workstations.v1beta.WorkstationConfig value) { + if (workstationConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + workstationConfig_ = value; + } else { + workstationConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Config to update.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig workstation_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setWorkstationConfig( + com.google.cloud.workstations.v1beta.WorkstationConfig.Builder builderForValue) { + if (workstationConfigBuilder_ == null) { + workstationConfig_ = builderForValue.build(); + } else { + workstationConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Config to update.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig workstation_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeWorkstationConfig( + com.google.cloud.workstations.v1beta.WorkstationConfig value) { + if (workstationConfigBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && workstationConfig_ != null + && workstationConfig_ + != com.google.cloud.workstations.v1beta.WorkstationConfig.getDefaultInstance()) { + getWorkstationConfigBuilder().mergeFrom(value); + } else { + workstationConfig_ = value; + } + } else { + workstationConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Config to update.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig workstation_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearWorkstationConfig() { + bitField0_ = (bitField0_ & ~0x00000001); + workstationConfig_ = null; + if (workstationConfigBuilder_ != null) { + workstationConfigBuilder_.dispose(); + workstationConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Config to update.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig workstation_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.workstations.v1beta.WorkstationConfig.Builder + getWorkstationConfigBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getWorkstationConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Config to update.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig workstation_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.workstations.v1beta.WorkstationConfigOrBuilder + getWorkstationConfigOrBuilder() { + if (workstationConfigBuilder_ != null) { + return workstationConfigBuilder_.getMessageOrBuilder(); + } else { + return workstationConfig_ == null + ? com.google.cloud.workstations.v1beta.WorkstationConfig.getDefaultInstance() + : workstationConfig_; + } + } + /** + * + * + *
+     * Required. Config to update.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig workstation_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationConfig, + com.google.cloud.workstations.v1beta.WorkstationConfig.Builder, + com.google.cloud.workstations.v1beta.WorkstationConfigOrBuilder> + getWorkstationConfigFieldBuilder() { + if (workstationConfigBuilder_ == null) { + workstationConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationConfig, + com.google.cloud.workstations.v1beta.WorkstationConfig.Builder, + com.google.cloud.workstations.v1beta.WorkstationConfigOrBuilder>( + getWorkstationConfig(), getParentForChildren(), isClean()); + workstationConfig_ = null; + } + return workstationConfigBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Required. Mask specifying which fields in the config should be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. Mask specifying which fields in the config should be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Mask specifying which fields in the config should be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Mask specifying which fields in the config should be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Mask specifying which fields in the config should be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Mask specifying which fields in the config should be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Mask specifying which fields in the config should be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Mask specifying which fields in the config should be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Required. Mask specifying which fields in the config should be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + private boolean validateOnly_; + /** + * + * + *
+     * If set, validate the request and preview the review, but do not actually
+     * apply it.
+     * 
+ * + * bool validate_only = 3; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * If set, validate the request and preview the review, but do not actually
+     * apply it.
+     * 
+ * + * bool validate_only = 3; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * If set, validate the request and preview the review, but do not actually
+     * apply it.
+     * 
+ * + * bool validate_only = 3; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000004); + validateOnly_ = false; + onChanged(); + return this; + } + + private boolean allowMissing_; + /** + * + * + *
+     * If set, and the config is not found, a new config will be created.
+     * In this situation, update_mask is ignored.
+     * 
+ * + * bool allow_missing = 4; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + /** + * + * + *
+     * If set, and the config is not found, a new config will be created.
+     * In this situation, update_mask is ignored.
+     * 
+ * + * bool allow_missing = 4; + * + * @param value The allowMissing to set. + * @return This builder for chaining. + */ + public Builder setAllowMissing(boolean value) { + + allowMissing_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * If set, and the config is not found, a new config will be created.
+     * In this situation, update_mask is ignored.
+     * 
+ * + * bool allow_missing = 4; + * + * @return This builder for chaining. + */ + public Builder clearAllowMissing() { + bitField0_ = (bitField0_ & ~0x00000008); + allowMissing_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest) + private static final com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest(); + } + + public static com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateWorkstationConfigRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/UpdateWorkstationConfigRequestOrBuilder.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/UpdateWorkstationConfigRequestOrBuilder.java new file mode 100644 index 000000000000..05d06ef3b1e0 --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/UpdateWorkstationConfigRequestOrBuilder.java @@ -0,0 +1,132 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +public interface UpdateWorkstationConfigRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Config to update.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig workstation_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the workstationConfig field is set. + */ + boolean hasWorkstationConfig(); + /** + * + * + *
+   * Required. Config to update.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig workstation_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The workstationConfig. + */ + com.google.cloud.workstations.v1beta.WorkstationConfig getWorkstationConfig(); + /** + * + * + *
+   * Required. Config to update.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig workstation_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.workstations.v1beta.WorkstationConfigOrBuilder getWorkstationConfigOrBuilder(); + + /** + * + * + *
+   * Required. Mask specifying which fields in the config should be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. Mask specifying which fields in the config should be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. Mask specifying which fields in the config should be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * If set, validate the request and preview the review, but do not actually
+   * apply it.
+   * 
+ * + * bool validate_only = 3; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + /** + * + * + *
+   * If set, and the config is not found, a new config will be created.
+   * In this situation, update_mask is ignored.
+   * 
+ * + * bool allow_missing = 4; + * + * @return The allowMissing. + */ + boolean getAllowMissing(); +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/UpdateWorkstationRequest.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/UpdateWorkstationRequest.java new file mode 100644 index 000000000000..9de4b9fb3adc --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/UpdateWorkstationRequest.java @@ -0,0 +1,1208 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +/** + * + * + *
+ * Request message for UpdateWorkstation.
+ * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.UpdateWorkstationRequest} + */ +public final class UpdateWorkstationRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workstations.v1beta.UpdateWorkstationRequest) + UpdateWorkstationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateWorkstationRequest.newBuilder() to construct. + private UpdateWorkstationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateWorkstationRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateWorkstationRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_UpdateWorkstationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_UpdateWorkstationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.UpdateWorkstationRequest.class, + com.google.cloud.workstations.v1beta.UpdateWorkstationRequest.Builder.class); + } + + public static final int WORKSTATION_FIELD_NUMBER = 1; + private com.google.cloud.workstations.v1beta.Workstation workstation_; + /** + * + * + *
+   * Required. Workstation to update.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.Workstation workstation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the workstation field is set. + */ + @java.lang.Override + public boolean hasWorkstation() { + return workstation_ != null; + } + /** + * + * + *
+   * Required. Workstation to update.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.Workstation workstation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The workstation. + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.Workstation getWorkstation() { + return workstation_ == null + ? com.google.cloud.workstations.v1beta.Workstation.getDefaultInstance() + : workstation_; + } + /** + * + * + *
+   * Required. Workstation to update.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.Workstation workstation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationOrBuilder getWorkstationOrBuilder() { + return workstation_ == null + ? com.google.cloud.workstations.v1beta.Workstation.getDefaultInstance() + : workstation_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. Mask specifying which fields in the config should be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Required. Mask specifying which fields in the config should be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Required. Mask specifying which fields in the config should be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 3; + private boolean validateOnly_ = false; + /** + * + * + *
+   * If set, validate the request and preview the review, but do not actually
+   * apply it.
+   * 
+ * + * bool validate_only = 3; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + public static final int ALLOW_MISSING_FIELD_NUMBER = 4; + private boolean allowMissing_ = false; + /** + * + * + *
+   * If set, and the config is not found, a new config will be created.
+   * In this situation, update_mask is ignored.
+   * 
+ * + * bool allow_missing = 4; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (workstation_ != null) { + output.writeMessage(1, getWorkstation()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + if (validateOnly_ != false) { + output.writeBool(3, validateOnly_); + } + if (allowMissing_ != false) { + output.writeBool(4, allowMissing_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (workstation_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getWorkstation()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, validateOnly_); + } + if (allowMissing_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, allowMissing_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workstations.v1beta.UpdateWorkstationRequest)) { + return super.equals(obj); + } + com.google.cloud.workstations.v1beta.UpdateWorkstationRequest other = + (com.google.cloud.workstations.v1beta.UpdateWorkstationRequest) obj; + + if (hasWorkstation() != other.hasWorkstation()) return false; + if (hasWorkstation()) { + if (!getWorkstation().equals(other.getWorkstation())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (getValidateOnly() != other.getValidateOnly()) return false; + if (getAllowMissing() != other.getAllowMissing()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasWorkstation()) { + hash = (37 * hash) + WORKSTATION_FIELD_NUMBER; + hash = (53 * hash) + getWorkstation().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (37 * hash) + ALLOW_MISSING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowMissing()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workstations.v1beta.UpdateWorkstationRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.UpdateWorkstationRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.UpdateWorkstationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.UpdateWorkstationRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.UpdateWorkstationRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.UpdateWorkstationRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.UpdateWorkstationRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.UpdateWorkstationRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.UpdateWorkstationRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.UpdateWorkstationRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.UpdateWorkstationRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.UpdateWorkstationRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workstations.v1beta.UpdateWorkstationRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for UpdateWorkstation.
+   * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.UpdateWorkstationRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workstations.v1beta.UpdateWorkstationRequest) + com.google.cloud.workstations.v1beta.UpdateWorkstationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_UpdateWorkstationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_UpdateWorkstationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.UpdateWorkstationRequest.class, + com.google.cloud.workstations.v1beta.UpdateWorkstationRequest.Builder.class); + } + + // Construct using com.google.cloud.workstations.v1beta.UpdateWorkstationRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + workstation_ = null; + if (workstationBuilder_ != null) { + workstationBuilder_.dispose(); + workstationBuilder_ = null; + } + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + validateOnly_ = false; + allowMissing_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_UpdateWorkstationRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.UpdateWorkstationRequest + getDefaultInstanceForType() { + return com.google.cloud.workstations.v1beta.UpdateWorkstationRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.UpdateWorkstationRequest build() { + com.google.cloud.workstations.v1beta.UpdateWorkstationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.UpdateWorkstationRequest buildPartial() { + com.google.cloud.workstations.v1beta.UpdateWorkstationRequest result = + new com.google.cloud.workstations.v1beta.UpdateWorkstationRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.workstations.v1beta.UpdateWorkstationRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.workstation_ = + workstationBuilder_ == null ? workstation_ : workstationBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.validateOnly_ = validateOnly_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.allowMissing_ = allowMissing_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workstations.v1beta.UpdateWorkstationRequest) { + return mergeFrom((com.google.cloud.workstations.v1beta.UpdateWorkstationRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.workstations.v1beta.UpdateWorkstationRequest other) { + if (other + == com.google.cloud.workstations.v1beta.UpdateWorkstationRequest.getDefaultInstance()) + return this; + if (other.hasWorkstation()) { + mergeWorkstation(other.getWorkstation()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + if (other.getAllowMissing() != false) { + setAllowMissing(other.getAllowMissing()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getWorkstationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + allowMissing_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.workstations.v1beta.Workstation workstation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workstations.v1beta.Workstation, + com.google.cloud.workstations.v1beta.Workstation.Builder, + com.google.cloud.workstations.v1beta.WorkstationOrBuilder> + workstationBuilder_; + /** + * + * + *
+     * Required. Workstation to update.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.Workstation workstation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the workstation field is set. + */ + public boolean hasWorkstation() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. Workstation to update.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.Workstation workstation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The workstation. + */ + public com.google.cloud.workstations.v1beta.Workstation getWorkstation() { + if (workstationBuilder_ == null) { + return workstation_ == null + ? com.google.cloud.workstations.v1beta.Workstation.getDefaultInstance() + : workstation_; + } else { + return workstationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Workstation to update.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.Workstation workstation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setWorkstation(com.google.cloud.workstations.v1beta.Workstation value) { + if (workstationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + workstation_ = value; + } else { + workstationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Workstation to update.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.Workstation workstation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setWorkstation( + com.google.cloud.workstations.v1beta.Workstation.Builder builderForValue) { + if (workstationBuilder_ == null) { + workstation_ = builderForValue.build(); + } else { + workstationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Workstation to update.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.Workstation workstation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeWorkstation(com.google.cloud.workstations.v1beta.Workstation value) { + if (workstationBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && workstation_ != null + && workstation_ + != com.google.cloud.workstations.v1beta.Workstation.getDefaultInstance()) { + getWorkstationBuilder().mergeFrom(value); + } else { + workstation_ = value; + } + } else { + workstationBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Workstation to update.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.Workstation workstation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearWorkstation() { + bitField0_ = (bitField0_ & ~0x00000001); + workstation_ = null; + if (workstationBuilder_ != null) { + workstationBuilder_.dispose(); + workstationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Workstation to update.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.Workstation workstation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.workstations.v1beta.Workstation.Builder getWorkstationBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getWorkstationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Workstation to update.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.Workstation workstation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.workstations.v1beta.WorkstationOrBuilder getWorkstationOrBuilder() { + if (workstationBuilder_ != null) { + return workstationBuilder_.getMessageOrBuilder(); + } else { + return workstation_ == null + ? com.google.cloud.workstations.v1beta.Workstation.getDefaultInstance() + : workstation_; + } + } + /** + * + * + *
+     * Required. Workstation to update.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.Workstation workstation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workstations.v1beta.Workstation, + com.google.cloud.workstations.v1beta.Workstation.Builder, + com.google.cloud.workstations.v1beta.WorkstationOrBuilder> + getWorkstationFieldBuilder() { + if (workstationBuilder_ == null) { + workstationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workstations.v1beta.Workstation, + com.google.cloud.workstations.v1beta.Workstation.Builder, + com.google.cloud.workstations.v1beta.WorkstationOrBuilder>( + getWorkstation(), getParentForChildren(), isClean()); + workstation_ = null; + } + return workstationBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Required. Mask specifying which fields in the config should be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. Mask specifying which fields in the config should be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Mask specifying which fields in the config should be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Mask specifying which fields in the config should be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Mask specifying which fields in the config should be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Mask specifying which fields in the config should be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Mask specifying which fields in the config should be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Mask specifying which fields in the config should be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Required. Mask specifying which fields in the config should be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + private boolean validateOnly_; + /** + * + * + *
+     * If set, validate the request and preview the review, but do not actually
+     * apply it.
+     * 
+ * + * bool validate_only = 3; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * If set, validate the request and preview the review, but do not actually
+     * apply it.
+     * 
+ * + * bool validate_only = 3; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * If set, validate the request and preview the review, but do not actually
+     * apply it.
+     * 
+ * + * bool validate_only = 3; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000004); + validateOnly_ = false; + onChanged(); + return this; + } + + private boolean allowMissing_; + /** + * + * + *
+     * If set, and the config is not found, a new config will be created.
+     * In this situation, update_mask is ignored.
+     * 
+ * + * bool allow_missing = 4; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + /** + * + * + *
+     * If set, and the config is not found, a new config will be created.
+     * In this situation, update_mask is ignored.
+     * 
+ * + * bool allow_missing = 4; + * + * @param value The allowMissing to set. + * @return This builder for chaining. + */ + public Builder setAllowMissing(boolean value) { + + allowMissing_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * If set, and the config is not found, a new config will be created.
+     * In this situation, update_mask is ignored.
+     * 
+ * + * bool allow_missing = 4; + * + * @return This builder for chaining. + */ + public Builder clearAllowMissing() { + bitField0_ = (bitField0_ & ~0x00000008); + allowMissing_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workstations.v1beta.UpdateWorkstationRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workstations.v1beta.UpdateWorkstationRequest) + private static final com.google.cloud.workstations.v1beta.UpdateWorkstationRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workstations.v1beta.UpdateWorkstationRequest(); + } + + public static com.google.cloud.workstations.v1beta.UpdateWorkstationRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateWorkstationRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.UpdateWorkstationRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/UpdateWorkstationRequestOrBuilder.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/UpdateWorkstationRequestOrBuilder.java new file mode 100644 index 000000000000..61f355efa318 --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/UpdateWorkstationRequestOrBuilder.java @@ -0,0 +1,132 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +public interface UpdateWorkstationRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workstations.v1beta.UpdateWorkstationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Workstation to update.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.Workstation workstation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the workstation field is set. + */ + boolean hasWorkstation(); + /** + * + * + *
+   * Required. Workstation to update.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.Workstation workstation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The workstation. + */ + com.google.cloud.workstations.v1beta.Workstation getWorkstation(); + /** + * + * + *
+   * Required. Workstation to update.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.Workstation workstation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.workstations.v1beta.WorkstationOrBuilder getWorkstationOrBuilder(); + + /** + * + * + *
+   * Required. Mask specifying which fields in the config should be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. Mask specifying which fields in the config should be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. Mask specifying which fields in the config should be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * If set, validate the request and preview the review, but do not actually
+   * apply it.
+   * 
+ * + * bool validate_only = 3; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + /** + * + * + *
+   * If set, and the config is not found, a new config will be created.
+   * In this situation, update_mask is ignored.
+   * 
+ * + * bool allow_missing = 4; + * + * @return The allowMissing. + */ + boolean getAllowMissing(); +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/Workstation.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/Workstation.java new file mode 100644 index 000000000000..ea0e65c70655 --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/Workstation.java @@ -0,0 +1,3359 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +/** + * + * + *
+ * A single instance of a developer workstation with its own persistent storage.
+ * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.Workstation} + */ +public final class Workstation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workstations.v1beta.Workstation) + WorkstationOrBuilder { + private static final long serialVersionUID = 0L; + // Use Workstation.newBuilder() to construct. + private Workstation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Workstation() { + name_ = ""; + displayName_ = ""; + uid_ = ""; + etag_ = ""; + state_ = 0; + host_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Workstation(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_Workstation_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 5: + return internalGetAnnotations(); + case 13: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_Workstation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.Workstation.class, + com.google.cloud.workstations.v1beta.Workstation.Builder.class); + } + + /** + * + * + *
+   * Whether a workstation is running and ready to receive user requests.
+   * 
+ * + * Protobuf enum {@code google.cloud.workstations.v1beta.Workstation.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Do not use.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The workstation is not yet ready to accept requests from users but will
+     * be soon.
+     * 
+ * + * STATE_STARTING = 1; + */ + STATE_STARTING(1), + /** + * + * + *
+     * The workstation is ready to accept requests from users.
+     * 
+ * + * STATE_RUNNING = 2; + */ + STATE_RUNNING(2), + /** + * + * + *
+     * The workstation is being stopped.
+     * 
+ * + * STATE_STOPPING = 3; + */ + STATE_STOPPING(3), + /** + * + * + *
+     * The workstation is stopped and will not be able to receive requests until
+     * it is started.
+     * 
+ * + * STATE_STOPPED = 4; + */ + STATE_STOPPED(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Do not use.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The workstation is not yet ready to accept requests from users but will
+     * be soon.
+     * 
+ * + * STATE_STARTING = 1; + */ + public static final int STATE_STARTING_VALUE = 1; + /** + * + * + *
+     * The workstation is ready to accept requests from users.
+     * 
+ * + * STATE_RUNNING = 2; + */ + public static final int STATE_RUNNING_VALUE = 2; + /** + * + * + *
+     * The workstation is being stopped.
+     * 
+ * + * STATE_STOPPING = 3; + */ + public static final int STATE_STOPPING_VALUE = 3; + /** + * + * + *
+     * The workstation is stopped and will not be able to receive requests until
+     * it is started.
+     * 
+ * + * STATE_STOPPED = 4; + */ + public static final int STATE_STOPPED_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return STATE_STARTING; + case 2: + return STATE_RUNNING; + case 3: + return STATE_STOPPING; + case 4: + return STATE_STOPPED; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.Workstation.getDescriptor().getEnumTypes().get(0); + } + + private static final State[] VALUES = values(); + + public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.workstations.v1beta.Workstation.State) + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Full name of this resource.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Full name of this resource.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+   * Human-readable name for this resource.
+   * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * Human-readable name for this resource.
+   * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object uid_ = ""; + /** + * + * + *
+   * Output only. A system-assigned unique identified for this resource.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + @java.lang.Override + public java.lang.String getUid() { + java.lang.Object ref = uid_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uid_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. A system-assigned unique identified for this resource.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUidBytes() { + java.lang.Object ref = uid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RECONCILING_FIELD_NUMBER = 4; + private boolean reconciling_ = false; + /** + * + * + *
+   * Output only. Indicates whether this resource is currently being updated to
+   * match its intended state.
+   * 
+ * + * bool reconciling = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + @java.lang.Override + public boolean getReconciling() { + return reconciling_; + } + + public static final int ANNOTATIONS_FIELD_NUMBER = 5; + + private static final class AnnotationsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_Workstation_AnnotationsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + /** + * + * + *
+   * Client-specified annotations.
+   * 
+ * + * map<string, string> annotations = 5; + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + /** + * + * + *
+   * Client-specified annotations.
+   * 
+ * + * map<string, string> annotations = 5; + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + /** + * + * + *
+   * Client-specified annotations.
+   * 
+ * + * map<string, string> annotations = 5; + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Client-specified annotations.
+   * 
+ * + * map<string, string> annotations = 5; + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int LABELS_FIELD_NUMBER = 13; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_Workstation_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Client-specified labels that are applied to the resource and that are also
+   * propagated to the underlying Compute Engine resources.
+   * 
+ * + * map<string, string> labels = 13; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Client-specified labels that are applied to the resource and that are also
+   * propagated to the underlying Compute Engine resources.
+   * 
+ * + * map<string, string> labels = 13; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Client-specified labels that are applied to the resource and that are also
+   * propagated to the underlying Compute Engine resources.
+   * 
+ * + * map<string, string> labels = 13; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Client-specified labels that are applied to the resource and that are also
+   * propagated to the underlying Compute Engine resources.
+   * 
+ * + * map<string, string> labels = 13; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Time when this resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. Time when this resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. Time when this resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. Time when this resource was most recently updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. Time when this resource was most recently updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. Time when this resource was most recently updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int DELETE_TIME_FIELD_NUMBER = 8; + private com.google.protobuf.Timestamp deleteTime_; + /** + * + * + *
+   * Output only. Time when this resource was soft-deleted.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + @java.lang.Override + public boolean hasDeleteTime() { + return deleteTime_ != null; + } + /** + * + * + *
+   * Output only. Time when this resource was soft-deleted.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The deleteTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getDeleteTime() { + return deleteTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : deleteTime_; + } + /** + * + * + *
+   * Output only. Time when this resource was soft-deleted.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { + return deleteTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : deleteTime_; + } + + public static final int ETAG_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * Checksum computed by the server. May be sent on update and delete requests
+   * to ensure that the client has an up-to-date value before proceeding.
+   * 
+ * + * string etag = 9; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * Checksum computed by the server. May be sent on update and delete requests
+   * to ensure that the client has an up-to-date value before proceeding.
+   * 
+ * + * string etag = 9; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATE_FIELD_NUMBER = 10; + private int state_ = 0; + /** + * + * + *
+   * Output only. Current state of the workstation.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.Workstation.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Output only. Current state of the workstation.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.Workstation.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.Workstation.State getState() { + com.google.cloud.workstations.v1beta.Workstation.State result = + com.google.cloud.workstations.v1beta.Workstation.State.forNumber(state_); + return result == null + ? com.google.cloud.workstations.v1beta.Workstation.State.UNRECOGNIZED + : result; + } + + public static final int HOST_FIELD_NUMBER = 11; + + @SuppressWarnings("serial") + private volatile java.lang.Object host_ = ""; + /** + * + * + *
+   * Output only. Host to which clients can send HTTPS traffic that will be
+   * received by the workstation. Authorized traffic will be received to the
+   * workstation as HTTP on port 80. To send traffic to a different port,
+   * clients may prefix the host with the destination port in the format
+   * `{port}-{host}`.
+   * 
+ * + * string host = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The host. + */ + @java.lang.Override + public java.lang.String getHost() { + java.lang.Object ref = host_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + host_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Host to which clients can send HTTPS traffic that will be
+   * received by the workstation. Authorized traffic will be received to the
+   * workstation as HTTP on port 80. To send traffic to a different port,
+   * clients may prefix the host with the destination port in the format
+   * `{port}-{host}`.
+   * 
+ * + * string host = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for host. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHostBytes() { + java.lang.Object ref = host_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + host_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uid_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, uid_); + } + if (reconciling_ != false) { + output.writeBool(4, reconciling_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetAnnotations(), AnnotationsDefaultEntryHolder.defaultEntry, 5); + if (createTime_ != null) { + output.writeMessage(6, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(7, getUpdateTime()); + } + if (deleteTime_ != null) { + output.writeMessage(8, getDeleteTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, etag_); + } + if (state_ + != com.google.cloud.workstations.v1beta.Workstation.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(10, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(host_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, host_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 13); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uid_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, uid_); + } + if (reconciling_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, reconciling_); + } + for (java.util.Map.Entry entry : + internalGetAnnotations().getMap().entrySet()) { + com.google.protobuf.MapEntry annotations__ = + AnnotationsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, annotations__); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getUpdateTime()); + } + if (deleteTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getDeleteTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, etag_); + } + if (state_ + != com.google.cloud.workstations.v1beta.Workstation.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(10, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(host_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, host_); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, labels__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workstations.v1beta.Workstation)) { + return super.equals(obj); + } + com.google.cloud.workstations.v1beta.Workstation other = + (com.google.cloud.workstations.v1beta.Workstation) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getUid().equals(other.getUid())) return false; + if (getReconciling() != other.getReconciling()) return false; + if (!internalGetAnnotations().equals(other.internalGetAnnotations())) return false; + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (hasDeleteTime() != other.hasDeleteTime()) return false; + if (hasDeleteTime()) { + if (!getDeleteTime().equals(other.getDeleteTime())) return false; + } + if (!getEtag().equals(other.getEtag())) return false; + if (state_ != other.state_) return false; + if (!getHost().equals(other.getHost())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + UID_FIELD_NUMBER; + hash = (53 * hash) + getUid().hashCode(); + hash = (37 * hash) + RECONCILING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReconciling()); + if (!internalGetAnnotations().getMap().isEmpty()) { + hash = (37 * hash) + ANNOTATIONS_FIELD_NUMBER; + hash = (53 * hash) + internalGetAnnotations().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (hasDeleteTime()) { + hash = (37 * hash) + DELETE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getDeleteTime().hashCode(); + } + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + HOST_FIELD_NUMBER; + hash = (53 * hash) + getHost().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workstations.v1beta.Workstation parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.Workstation parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.Workstation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.Workstation parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.Workstation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.Workstation parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.Workstation parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.Workstation parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.Workstation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.Workstation parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.Workstation parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.Workstation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.workstations.v1beta.Workstation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A single instance of a developer workstation with its own persistent storage.
+   * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.Workstation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workstations.v1beta.Workstation) + com.google.cloud.workstations.v1beta.WorkstationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_Workstation_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 5: + return internalGetAnnotations(); + case 13: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 5: + return internalGetMutableAnnotations(); + case 13: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_Workstation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.Workstation.class, + com.google.cloud.workstations.v1beta.Workstation.Builder.class); + } + + // Construct using com.google.cloud.workstations.v1beta.Workstation.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + displayName_ = ""; + uid_ = ""; + reconciling_ = false; + internalGetMutableAnnotations().clear(); + internalGetMutableLabels().clear(); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + deleteTime_ = null; + if (deleteTimeBuilder_ != null) { + deleteTimeBuilder_.dispose(); + deleteTimeBuilder_ = null; + } + etag_ = ""; + state_ = 0; + host_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_Workstation_descriptor; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.Workstation getDefaultInstanceForType() { + return com.google.cloud.workstations.v1beta.Workstation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.Workstation build() { + com.google.cloud.workstations.v1beta.Workstation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.Workstation buildPartial() { + com.google.cloud.workstations.v1beta.Workstation result = + new com.google.cloud.workstations.v1beta.Workstation(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.workstations.v1beta.Workstation result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.uid_ = uid_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.reconciling_ = reconciling_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.annotations_ = internalGetAnnotations(); + result.annotations_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.deleteTime_ = deleteTimeBuilder_ == null ? deleteTime_ : deleteTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.host_ = host_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workstations.v1beta.Workstation) { + return mergeFrom((com.google.cloud.workstations.v1beta.Workstation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.workstations.v1beta.Workstation other) { + if (other == com.google.cloud.workstations.v1beta.Workstation.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getUid().isEmpty()) { + uid_ = other.uid_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getReconciling() != false) { + setReconciling(other.getReconciling()); + } + internalGetMutableAnnotations().mergeFrom(other.internalGetAnnotations()); + bitField0_ |= 0x00000010; + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + bitField0_ |= 0x00000020; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasDeleteTime()) { + mergeDeleteTime(other.getDeleteTime()); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000200; + onChanged(); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getHost().isEmpty()) { + host_ = other.host_; + bitField0_ |= 0x00000800; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + uid_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + reconciling_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + com.google.protobuf.MapEntry annotations__ = + input.readMessage( + AnnotationsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableAnnotations() + .getMutableMap() + .put(annotations__.getKey(), annotations__.getValue()); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 50 + case 58: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 58 + case 66: + { + input.readMessage(getDeleteTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 66 + case 74: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000200; + break; + } // case 74 + case 80: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000400; + break; + } // case 80 + case 90: + { + host_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000800; + break; + } // case 90 + case 106: + { + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLabels() + .getMutableMap() + .put(labels__.getKey(), labels__.getValue()); + bitField0_ |= 0x00000020; + break; + } // case 106 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Full name of this resource.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Full name of this resource.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Full name of this resource.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Full name of this resource.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Full name of this resource.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Human-readable name for this resource.
+     * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Human-readable name for this resource.
+     * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Human-readable name for this resource.
+     * 
+ * + * string display_name = 2; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Human-readable name for this resource.
+     * 
+ * + * string display_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Human-readable name for this resource.
+     * 
+ * + * string display_name = 2; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object uid_ = ""; + /** + * + * + *
+     * Output only. A system-assigned unique identified for this resource.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + public java.lang.String getUid() { + java.lang.Object ref = uid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. A system-assigned unique identified for this resource.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + public com.google.protobuf.ByteString getUidBytes() { + java.lang.Object ref = uid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. A system-assigned unique identified for this resource.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The uid to set. + * @return This builder for chaining. + */ + public Builder setUid(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + uid_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. A system-assigned unique identified for this resource.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearUid() { + uid_ = getDefaultInstance().getUid(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. A system-assigned unique identified for this resource.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for uid to set. + * @return This builder for chaining. + */ + public Builder setUidBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + uid_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean reconciling_; + /** + * + * + *
+     * Output only. Indicates whether this resource is currently being updated to
+     * match its intended state.
+     * 
+ * + * bool reconciling = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + @java.lang.Override + public boolean getReconciling() { + return reconciling_; + } + /** + * + * + *
+     * Output only. Indicates whether this resource is currently being updated to
+     * match its intended state.
+     * 
+ * + * bool reconciling = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The reconciling to set. + * @return This builder for chaining. + */ + public Builder setReconciling(boolean value) { + + reconciling_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Indicates whether this resource is currently being updated to
+     * match its intended state.
+     * 
+ * + * bool reconciling = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearReconciling() { + bitField0_ = (bitField0_ & ~0x00000008); + reconciling_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + private com.google.protobuf.MapField + internalGetMutableAnnotations() { + if (annotations_ == null) { + annotations_ = + com.google.protobuf.MapField.newMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + if (!annotations_.isMutable()) { + annotations_ = annotations_.copy(); + } + bitField0_ |= 0x00000010; + onChanged(); + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + /** + * + * + *
+     * Client-specified annotations.
+     * 
+ * + * map<string, string> annotations = 5; + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + /** + * + * + *
+     * Client-specified annotations.
+     * 
+ * + * map<string, string> annotations = 5; + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + /** + * + * + *
+     * Client-specified annotations.
+     * 
+ * + * map<string, string> annotations = 5; + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Client-specified annotations.
+     * 
+ * + * map<string, string> annotations = 5; + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAnnotations() { + bitField0_ = (bitField0_ & ~0x00000010); + internalGetMutableAnnotations().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Client-specified annotations.
+     * 
+ * + * map<string, string> annotations = 5; + */ + public Builder removeAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAnnotations().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableAnnotations() { + bitField0_ |= 0x00000010; + return internalGetMutableAnnotations().getMutableMap(); + } + /** + * + * + *
+     * Client-specified annotations.
+     * 
+ * + * map<string, string> annotations = 5; + */ + public Builder putAnnotations(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableAnnotations().getMutableMap().put(key, value); + bitField0_ |= 0x00000010; + return this; + } + /** + * + * + *
+     * Client-specified annotations.
+     * 
+ * + * map<string, string> annotations = 5; + */ + public Builder putAllAnnotations(java.util.Map values) { + internalGetMutableAnnotations().getMutableMap().putAll(values); + bitField0_ |= 0x00000010; + return this; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + bitField0_ |= 0x00000020; + onChanged(); + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Client-specified labels that are applied to the resource and that are also
+     * propagated to the underlying Compute Engine resources.
+     * 
+ * + * map<string, string> labels = 13; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Client-specified labels that are applied to the resource and that are also
+     * propagated to the underlying Compute Engine resources.
+     * 
+ * + * map<string, string> labels = 13; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Client-specified labels that are applied to the resource and that are also
+     * propagated to the underlying Compute Engine resources.
+     * 
+ * + * map<string, string> labels = 13; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Client-specified labels that are applied to the resource and that are also
+     * propagated to the underlying Compute Engine resources.
+     * 
+ * + * map<string, string> labels = 13; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + bitField0_ = (bitField0_ & ~0x00000020); + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Client-specified labels that are applied to the resource and that are also
+     * propagated to the underlying Compute Engine resources.
+     * 
+ * + * map<string, string> labels = 13; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + bitField0_ |= 0x00000020; + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Client-specified labels that are applied to the resource and that are also
+     * propagated to the underlying Compute Engine resources.
+     * 
+ * + * map<string, string> labels = 13; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00000020; + return this; + } + /** + * + * + *
+     * Client-specified labels that are applied to the resource and that are also
+     * propagated to the underlying Compute Engine resources.
+     * 
+ * + * map<string, string> labels = 13; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000020; + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. Time when this resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+     * Output only. Time when this resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Time when this resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when this resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when this resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when this resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000040); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when this resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Time when this resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. Time when this resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. Time when this resource was most recently updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * + * + *
+     * Output only. Time when this resource was most recently updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Time when this resource was most recently updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when this resource was most recently updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when this resource was most recently updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when this resource was most recently updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000080); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when this resource was most recently updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Time when this resource was most recently updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. Time when this resource was most recently updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private com.google.protobuf.Timestamp deleteTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + deleteTimeBuilder_; + /** + * + * + *
+     * Output only. Time when this resource was soft-deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + public boolean hasDeleteTime() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + * + * + *
+     * Output only. Time when this resource was soft-deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The deleteTime. + */ + public com.google.protobuf.Timestamp getDeleteTime() { + if (deleteTimeBuilder_ == null) { + return deleteTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : deleteTime_; + } else { + return deleteTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Time when this resource was soft-deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDeleteTime(com.google.protobuf.Timestamp value) { + if (deleteTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deleteTime_ = value; + } else { + deleteTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when this resource was soft-deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDeleteTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (deleteTimeBuilder_ == null) { + deleteTime_ = builderForValue.build(); + } else { + deleteTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when this resource was soft-deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeDeleteTime(com.google.protobuf.Timestamp value) { + if (deleteTimeBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && deleteTime_ != null + && deleteTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getDeleteTimeBuilder().mergeFrom(value); + } else { + deleteTime_ = value; + } + } else { + deleteTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when this resource was soft-deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearDeleteTime() { + bitField0_ = (bitField0_ & ~0x00000100); + deleteTime_ = null; + if (deleteTimeBuilder_ != null) { + deleteTimeBuilder_.dispose(); + deleteTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when this resource was soft-deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getDeleteTimeBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return getDeleteTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Time when this resource was soft-deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { + if (deleteTimeBuilder_ != null) { + return deleteTimeBuilder_.getMessageOrBuilder(); + } else { + return deleteTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : deleteTime_; + } + } + /** + * + * + *
+     * Output only. Time when this resource was soft-deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getDeleteTimeFieldBuilder() { + if (deleteTimeBuilder_ == null) { + deleteTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getDeleteTime(), getParentForChildren(), isClean()); + deleteTime_ = null; + } + return deleteTimeBuilder_; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * Checksum computed by the server. May be sent on update and delete requests
+     * to ensure that the client has an up-to-date value before proceeding.
+     * 
+ * + * string etag = 9; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Checksum computed by the server. May be sent on update and delete requests
+     * to ensure that the client has an up-to-date value before proceeding.
+     * 
+ * + * string etag = 9; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Checksum computed by the server. May be sent on update and delete requests
+     * to ensure that the client has an up-to-date value before proceeding.
+     * 
+ * + * string etag = 9; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Checksum computed by the server. May be sent on update and delete requests
+     * to ensure that the client has an up-to-date value before proceeding.
+     * 
+ * + * string etag = 9; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + return this; + } + /** + * + * + *
+     * Checksum computed by the server. May be sent on update and delete requests
+     * to ensure that the client has an up-to-date value before proceeding.
+     * 
+ * + * string etag = 9; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. Current state of the workstation.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.Workstation.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Output only. Current state of the workstation.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.Workstation.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + state_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Current state of the workstation.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.Workstation.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.Workstation.State getState() { + com.google.cloud.workstations.v1beta.Workstation.State result = + com.google.cloud.workstations.v1beta.Workstation.State.forNumber(state_); + return result == null + ? com.google.cloud.workstations.v1beta.Workstation.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. Current state of the workstation.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.Workstation.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.workstations.v1beta.Workstation.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000400; + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Current state of the workstation.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.Workstation.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000400); + state_ = 0; + onChanged(); + return this; + } + + private java.lang.Object host_ = ""; + /** + * + * + *
+     * Output only. Host to which clients can send HTTPS traffic that will be
+     * received by the workstation. Authorized traffic will be received to the
+     * workstation as HTTP on port 80. To send traffic to a different port,
+     * clients may prefix the host with the destination port in the format
+     * `{port}-{host}`.
+     * 
+ * + * string host = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The host. + */ + public java.lang.String getHost() { + java.lang.Object ref = host_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + host_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Host to which clients can send HTTPS traffic that will be
+     * received by the workstation. Authorized traffic will be received to the
+     * workstation as HTTP on port 80. To send traffic to a different port,
+     * clients may prefix the host with the destination port in the format
+     * `{port}-{host}`.
+     * 
+ * + * string host = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for host. + */ + public com.google.protobuf.ByteString getHostBytes() { + java.lang.Object ref = host_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + host_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Host to which clients can send HTTPS traffic that will be
+     * received by the workstation. Authorized traffic will be received to the
+     * workstation as HTTP on port 80. To send traffic to a different port,
+     * clients may prefix the host with the destination port in the format
+     * `{port}-{host}`.
+     * 
+ * + * string host = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The host to set. + * @return This builder for chaining. + */ + public Builder setHost(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + host_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Host to which clients can send HTTPS traffic that will be
+     * received by the workstation. Authorized traffic will be received to the
+     * workstation as HTTP on port 80. To send traffic to a different port,
+     * clients may prefix the host with the destination port in the format
+     * `{port}-{host}`.
+     * 
+ * + * string host = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearHost() { + host_ = getDefaultInstance().getHost(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Host to which clients can send HTTPS traffic that will be
+     * received by the workstation. Authorized traffic will be received to the
+     * workstation as HTTP on port 80. To send traffic to a different port,
+     * clients may prefix the host with the destination port in the format
+     * `{port}-{host}`.
+     * 
+ * + * string host = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for host to set. + * @return This builder for chaining. + */ + public Builder setHostBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + host_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workstations.v1beta.Workstation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workstations.v1beta.Workstation) + private static final com.google.cloud.workstations.v1beta.Workstation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workstations.v1beta.Workstation(); + } + + public static com.google.cloud.workstations.v1beta.Workstation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Workstation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.Workstation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/WorkstationCluster.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/WorkstationCluster.java new file mode 100644 index 000000000000..c30e9765e274 --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/WorkstationCluster.java @@ -0,0 +1,5524 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +/** + * + * + *
+ * A grouping of workstation configurations and the associated workstations
+ *  in that region.
+ * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.WorkstationCluster} + */ +public final class WorkstationCluster extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workstations.v1beta.WorkstationCluster) + WorkstationClusterOrBuilder { + private static final long serialVersionUID = 0L; + // Use WorkstationCluster.newBuilder() to construct. + private WorkstationCluster(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private WorkstationCluster() { + name_ = ""; + displayName_ = ""; + uid_ = ""; + etag_ = ""; + network_ = ""; + subnetwork_ = ""; + conditions_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new WorkstationCluster(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationCluster_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 5: + return internalGetAnnotations(); + case 15: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationCluster_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.WorkstationCluster.class, + com.google.cloud.workstations.v1beta.WorkstationCluster.Builder.class); + } + + public interface PrivateClusterConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Immutable. Whether Workstations endpoint is private.
+     * 
+ * + * bool enable_private_endpoint = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The enablePrivateEndpoint. + */ + boolean getEnablePrivateEndpoint(); + + /** + * + * + *
+     * Output only. Hostname for the workstation cluster. This field will be
+     * populated only when private endpoint is enabled. To access workstations
+     * in the cluster, create a new DNS zone mapping this domain name to an
+     * internal IP address and a forwarding rule mapping that address to the
+     * service attachment.
+     * 
+ * + * string cluster_hostname = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The clusterHostname. + */ + java.lang.String getClusterHostname(); + /** + * + * + *
+     * Output only. Hostname for the workstation cluster. This field will be
+     * populated only when private endpoint is enabled. To access workstations
+     * in the cluster, create a new DNS zone mapping this domain name to an
+     * internal IP address and a forwarding rule mapping that address to the
+     * service attachment.
+     * 
+ * + * string cluster_hostname = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for clusterHostname. + */ + com.google.protobuf.ByteString getClusterHostnameBytes(); + + /** + * + * + *
+     * Output only. Service attachment URI for the workstation cluster. The
+     * service attachemnt is created when private endpoint is enabled. To access
+     * workstations in the cluster, configure access to the managed service
+     * using [Private Service
+     * Connect](https://cloud.google.com/vpc/docs/configure-private-service-connect-services).
+     * 
+ * + * string service_attachment_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The serviceAttachmentUri. + */ + java.lang.String getServiceAttachmentUri(); + /** + * + * + *
+     * Output only. Service attachment URI for the workstation cluster. The
+     * service attachemnt is created when private endpoint is enabled. To access
+     * workstations in the cluster, configure access to the managed service
+     * using [Private Service
+     * Connect](https://cloud.google.com/vpc/docs/configure-private-service-connect-services).
+     * 
+ * + * string service_attachment_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for serviceAttachmentUri. + */ + com.google.protobuf.ByteString getServiceAttachmentUriBytes(); + + /** + * + * + *
+     * Additional projects that are allowed to attach to the workstation
+     * cluster's service attachment. By default, the workstation cluster's
+     * project and the VPC host project (if different) are allowed.
+     * 
+ * + * repeated string allowed_projects = 4; + * + * @return A list containing the allowedProjects. + */ + java.util.List getAllowedProjectsList(); + /** + * + * + *
+     * Additional projects that are allowed to attach to the workstation
+     * cluster's service attachment. By default, the workstation cluster's
+     * project and the VPC host project (if different) are allowed.
+     * 
+ * + * repeated string allowed_projects = 4; + * + * @return The count of allowedProjects. + */ + int getAllowedProjectsCount(); + /** + * + * + *
+     * Additional projects that are allowed to attach to the workstation
+     * cluster's service attachment. By default, the workstation cluster's
+     * project and the VPC host project (if different) are allowed.
+     * 
+ * + * repeated string allowed_projects = 4; + * + * @param index The index of the element to return. + * @return The allowedProjects at the given index. + */ + java.lang.String getAllowedProjects(int index); + /** + * + * + *
+     * Additional projects that are allowed to attach to the workstation
+     * cluster's service attachment. By default, the workstation cluster's
+     * project and the VPC host project (if different) are allowed.
+     * 
+ * + * repeated string allowed_projects = 4; + * + * @param index The index of the value to return. + * @return The bytes of the allowedProjects at the given index. + */ + com.google.protobuf.ByteString getAllowedProjectsBytes(int index); + } + /** + * + * + *
+   * Configuration options for private clusters.
+   * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig} + */ + public static final class PrivateClusterConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig) + PrivateClusterConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use PrivateClusterConfig.newBuilder() to construct. + private PrivateClusterConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PrivateClusterConfig() { + clusterHostname_ = ""; + serviceAttachmentUri_ = ""; + allowedProjects_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PrivateClusterConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationCluster_PrivateClusterConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationCluster_PrivateClusterConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig.class, + com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig.Builder + .class); + } + + public static final int ENABLE_PRIVATE_ENDPOINT_FIELD_NUMBER = 1; + private boolean enablePrivateEndpoint_ = false; + /** + * + * + *
+     * Immutable. Whether Workstations endpoint is private.
+     * 
+ * + * bool enable_private_endpoint = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The enablePrivateEndpoint. + */ + @java.lang.Override + public boolean getEnablePrivateEndpoint() { + return enablePrivateEndpoint_; + } + + public static final int CLUSTER_HOSTNAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object clusterHostname_ = ""; + /** + * + * + *
+     * Output only. Hostname for the workstation cluster. This field will be
+     * populated only when private endpoint is enabled. To access workstations
+     * in the cluster, create a new DNS zone mapping this domain name to an
+     * internal IP address and a forwarding rule mapping that address to the
+     * service attachment.
+     * 
+ * + * string cluster_hostname = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The clusterHostname. + */ + @java.lang.Override + public java.lang.String getClusterHostname() { + java.lang.Object ref = clusterHostname_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clusterHostname_ = s; + return s; + } + } + /** + * + * + *
+     * Output only. Hostname for the workstation cluster. This field will be
+     * populated only when private endpoint is enabled. To access workstations
+     * in the cluster, create a new DNS zone mapping this domain name to an
+     * internal IP address and a forwarding rule mapping that address to the
+     * service attachment.
+     * 
+ * + * string cluster_hostname = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for clusterHostname. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClusterHostnameBytes() { + java.lang.Object ref = clusterHostname_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterHostname_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_ATTACHMENT_URI_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object serviceAttachmentUri_ = ""; + /** + * + * + *
+     * Output only. Service attachment URI for the workstation cluster. The
+     * service attachemnt is created when private endpoint is enabled. To access
+     * workstations in the cluster, configure access to the managed service
+     * using [Private Service
+     * Connect](https://cloud.google.com/vpc/docs/configure-private-service-connect-services).
+     * 
+ * + * string service_attachment_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The serviceAttachmentUri. + */ + @java.lang.Override + public java.lang.String getServiceAttachmentUri() { + java.lang.Object ref = serviceAttachmentUri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAttachmentUri_ = s; + return s; + } + } + /** + * + * + *
+     * Output only. Service attachment URI for the workstation cluster. The
+     * service attachemnt is created when private endpoint is enabled. To access
+     * workstations in the cluster, configure access to the managed service
+     * using [Private Service
+     * Connect](https://cloud.google.com/vpc/docs/configure-private-service-connect-services).
+     * 
+ * + * string service_attachment_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for serviceAttachmentUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceAttachmentUriBytes() { + java.lang.Object ref = serviceAttachmentUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAttachmentUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ALLOWED_PROJECTS_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringList allowedProjects_; + /** + * + * + *
+     * Additional projects that are allowed to attach to the workstation
+     * cluster's service attachment. By default, the workstation cluster's
+     * project and the VPC host project (if different) are allowed.
+     * 
+ * + * repeated string allowed_projects = 4; + * + * @return A list containing the allowedProjects. + */ + public com.google.protobuf.ProtocolStringList getAllowedProjectsList() { + return allowedProjects_; + } + /** + * + * + *
+     * Additional projects that are allowed to attach to the workstation
+     * cluster's service attachment. By default, the workstation cluster's
+     * project and the VPC host project (if different) are allowed.
+     * 
+ * + * repeated string allowed_projects = 4; + * + * @return The count of allowedProjects. + */ + public int getAllowedProjectsCount() { + return allowedProjects_.size(); + } + /** + * + * + *
+     * Additional projects that are allowed to attach to the workstation
+     * cluster's service attachment. By default, the workstation cluster's
+     * project and the VPC host project (if different) are allowed.
+     * 
+ * + * repeated string allowed_projects = 4; + * + * @param index The index of the element to return. + * @return The allowedProjects at the given index. + */ + public java.lang.String getAllowedProjects(int index) { + return allowedProjects_.get(index); + } + /** + * + * + *
+     * Additional projects that are allowed to attach to the workstation
+     * cluster's service attachment. By default, the workstation cluster's
+     * project and the VPC host project (if different) are allowed.
+     * 
+ * + * repeated string allowed_projects = 4; + * + * @param index The index of the value to return. + * @return The bytes of the allowedProjects at the given index. + */ + public com.google.protobuf.ByteString getAllowedProjectsBytes(int index) { + return allowedProjects_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (enablePrivateEndpoint_ != false) { + output.writeBool(1, enablePrivateEndpoint_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterHostname_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, clusterHostname_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAttachmentUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, serviceAttachmentUri_); + } + for (int i = 0; i < allowedProjects_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, allowedProjects_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (enablePrivateEndpoint_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, enablePrivateEndpoint_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterHostname_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, clusterHostname_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAttachmentUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, serviceAttachmentUri_); + } + { + int dataSize = 0; + for (int i = 0; i < allowedProjects_.size(); i++) { + dataSize += computeStringSizeNoTag(allowedProjects_.getRaw(i)); + } + size += dataSize; + size += 1 * getAllowedProjectsList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig)) { + return super.equals(obj); + } + com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig other = + (com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig) obj; + + if (getEnablePrivateEndpoint() != other.getEnablePrivateEndpoint()) return false; + if (!getClusterHostname().equals(other.getClusterHostname())) return false; + if (!getServiceAttachmentUri().equals(other.getServiceAttachmentUri())) return false; + if (!getAllowedProjectsList().equals(other.getAllowedProjectsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ENABLE_PRIVATE_ENDPOINT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnablePrivateEndpoint()); + hash = (37 * hash) + CLUSTER_HOSTNAME_FIELD_NUMBER; + hash = (53 * hash) + getClusterHostname().hashCode(); + hash = (37 * hash) + SERVICE_ATTACHMENT_URI_FIELD_NUMBER; + hash = (53 * hash) + getServiceAttachmentUri().hashCode(); + if (getAllowedProjectsCount() > 0) { + hash = (37 * hash) + ALLOWED_PROJECTS_FIELD_NUMBER; + hash = (53 * hash) + getAllowedProjectsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Configuration options for private clusters.
+     * 
+ * + * Protobuf type {@code + * google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig) + com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationCluster_PrivateClusterConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationCluster_PrivateClusterConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig.class, + com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig.Builder + .class); + } + + // Construct using + // com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + enablePrivateEndpoint_ = false; + clusterHostname_ = ""; + serviceAttachmentUri_ = ""; + allowedProjects_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationCluster_PrivateClusterConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig + getDefaultInstanceForType() { + return com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig build() { + com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig + buildPartial() { + com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig result = + new com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig result) { + if (((bitField0_ & 0x00000008) != 0)) { + allowedProjects_ = allowedProjects_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.allowedProjects_ = allowedProjects_; + } + + private void buildPartial0( + com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.enablePrivateEndpoint_ = enablePrivateEndpoint_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.clusterHostname_ = clusterHostname_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.serviceAttachmentUri_ = serviceAttachmentUri_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig) { + return mergeFrom( + (com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig other) { + if (other + == com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig + .getDefaultInstance()) return this; + if (other.getEnablePrivateEndpoint() != false) { + setEnablePrivateEndpoint(other.getEnablePrivateEndpoint()); + } + if (!other.getClusterHostname().isEmpty()) { + clusterHostname_ = other.clusterHostname_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getServiceAttachmentUri().isEmpty()) { + serviceAttachmentUri_ = other.serviceAttachmentUri_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.allowedProjects_.isEmpty()) { + if (allowedProjects_.isEmpty()) { + allowedProjects_ = other.allowedProjects_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureAllowedProjectsIsMutable(); + allowedProjects_.addAll(other.allowedProjects_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + enablePrivateEndpoint_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + clusterHostname_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + serviceAttachmentUri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureAllowedProjectsIsMutable(); + allowedProjects_.add(s); + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private boolean enablePrivateEndpoint_; + /** + * + * + *
+       * Immutable. Whether Workstations endpoint is private.
+       * 
+ * + * bool enable_private_endpoint = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The enablePrivateEndpoint. + */ + @java.lang.Override + public boolean getEnablePrivateEndpoint() { + return enablePrivateEndpoint_; + } + /** + * + * + *
+       * Immutable. Whether Workstations endpoint is private.
+       * 
+ * + * bool enable_private_endpoint = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The enablePrivateEndpoint to set. + * @return This builder for chaining. + */ + public Builder setEnablePrivateEndpoint(boolean value) { + + enablePrivateEndpoint_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Immutable. Whether Workstations endpoint is private.
+       * 
+ * + * bool enable_private_endpoint = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearEnablePrivateEndpoint() { + bitField0_ = (bitField0_ & ~0x00000001); + enablePrivateEndpoint_ = false; + onChanged(); + return this; + } + + private java.lang.Object clusterHostname_ = ""; + /** + * + * + *
+       * Output only. Hostname for the workstation cluster. This field will be
+       * populated only when private endpoint is enabled. To access workstations
+       * in the cluster, create a new DNS zone mapping this domain name to an
+       * internal IP address and a forwarding rule mapping that address to the
+       * service attachment.
+       * 
+ * + * string cluster_hostname = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The clusterHostname. + */ + public java.lang.String getClusterHostname() { + java.lang.Object ref = clusterHostname_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clusterHostname_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Output only. Hostname for the workstation cluster. This field will be
+       * populated only when private endpoint is enabled. To access workstations
+       * in the cluster, create a new DNS zone mapping this domain name to an
+       * internal IP address and a forwarding rule mapping that address to the
+       * service attachment.
+       * 
+ * + * string cluster_hostname = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for clusterHostname. + */ + public com.google.protobuf.ByteString getClusterHostnameBytes() { + java.lang.Object ref = clusterHostname_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterHostname_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Output only. Hostname for the workstation cluster. This field will be
+       * populated only when private endpoint is enabled. To access workstations
+       * in the cluster, create a new DNS zone mapping this domain name to an
+       * internal IP address and a forwarding rule mapping that address to the
+       * service attachment.
+       * 
+ * + * string cluster_hostname = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The clusterHostname to set. + * @return This builder for chaining. + */ + public Builder setClusterHostname(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + clusterHostname_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Hostname for the workstation cluster. This field will be
+       * populated only when private endpoint is enabled. To access workstations
+       * in the cluster, create a new DNS zone mapping this domain name to an
+       * internal IP address and a forwarding rule mapping that address to the
+       * service attachment.
+       * 
+ * + * string cluster_hostname = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearClusterHostname() { + clusterHostname_ = getDefaultInstance().getClusterHostname(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Hostname for the workstation cluster. This field will be
+       * populated only when private endpoint is enabled. To access workstations
+       * in the cluster, create a new DNS zone mapping this domain name to an
+       * internal IP address and a forwarding rule mapping that address to the
+       * service attachment.
+       * 
+ * + * string cluster_hostname = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for clusterHostname to set. + * @return This builder for chaining. + */ + public Builder setClusterHostnameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + clusterHostname_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object serviceAttachmentUri_ = ""; + /** + * + * + *
+       * Output only. Service attachment URI for the workstation cluster. The
+       * service attachemnt is created when private endpoint is enabled. To access
+       * workstations in the cluster, configure access to the managed service
+       * using [Private Service
+       * Connect](https://cloud.google.com/vpc/docs/configure-private-service-connect-services).
+       * 
+ * + * string service_attachment_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The serviceAttachmentUri. + */ + public java.lang.String getServiceAttachmentUri() { + java.lang.Object ref = serviceAttachmentUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAttachmentUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Output only. Service attachment URI for the workstation cluster. The
+       * service attachemnt is created when private endpoint is enabled. To access
+       * workstations in the cluster, configure access to the managed service
+       * using [Private Service
+       * Connect](https://cloud.google.com/vpc/docs/configure-private-service-connect-services).
+       * 
+ * + * string service_attachment_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for serviceAttachmentUri. + */ + public com.google.protobuf.ByteString getServiceAttachmentUriBytes() { + java.lang.Object ref = serviceAttachmentUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAttachmentUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Output only. Service attachment URI for the workstation cluster. The
+       * service attachemnt is created when private endpoint is enabled. To access
+       * workstations in the cluster, configure access to the managed service
+       * using [Private Service
+       * Connect](https://cloud.google.com/vpc/docs/configure-private-service-connect-services).
+       * 
+ * + * string service_attachment_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The serviceAttachmentUri to set. + * @return This builder for chaining. + */ + public Builder setServiceAttachmentUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + serviceAttachmentUri_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Service attachment URI for the workstation cluster. The
+       * service attachemnt is created when private endpoint is enabled. To access
+       * workstations in the cluster, configure access to the managed service
+       * using [Private Service
+       * Connect](https://cloud.google.com/vpc/docs/configure-private-service-connect-services).
+       * 
+ * + * string service_attachment_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearServiceAttachmentUri() { + serviceAttachmentUri_ = getDefaultInstance().getServiceAttachmentUri(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Service attachment URI for the workstation cluster. The
+       * service attachemnt is created when private endpoint is enabled. To access
+       * workstations in the cluster, configure access to the managed service
+       * using [Private Service
+       * Connect](https://cloud.google.com/vpc/docs/configure-private-service-connect-services).
+       * 
+ * + * string service_attachment_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The bytes for serviceAttachmentUri to set. + * @return This builder for chaining. + */ + public Builder setServiceAttachmentUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + serviceAttachmentUri_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList allowedProjects_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureAllowedProjectsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + allowedProjects_ = new com.google.protobuf.LazyStringArrayList(allowedProjects_); + bitField0_ |= 0x00000008; + } + } + /** + * + * + *
+       * Additional projects that are allowed to attach to the workstation
+       * cluster's service attachment. By default, the workstation cluster's
+       * project and the VPC host project (if different) are allowed.
+       * 
+ * + * repeated string allowed_projects = 4; + * + * @return A list containing the allowedProjects. + */ + public com.google.protobuf.ProtocolStringList getAllowedProjectsList() { + return allowedProjects_.getUnmodifiableView(); + } + /** + * + * + *
+       * Additional projects that are allowed to attach to the workstation
+       * cluster's service attachment. By default, the workstation cluster's
+       * project and the VPC host project (if different) are allowed.
+       * 
+ * + * repeated string allowed_projects = 4; + * + * @return The count of allowedProjects. + */ + public int getAllowedProjectsCount() { + return allowedProjects_.size(); + } + /** + * + * + *
+       * Additional projects that are allowed to attach to the workstation
+       * cluster's service attachment. By default, the workstation cluster's
+       * project and the VPC host project (if different) are allowed.
+       * 
+ * + * repeated string allowed_projects = 4; + * + * @param index The index of the element to return. + * @return The allowedProjects at the given index. + */ + public java.lang.String getAllowedProjects(int index) { + return allowedProjects_.get(index); + } + /** + * + * + *
+       * Additional projects that are allowed to attach to the workstation
+       * cluster's service attachment. By default, the workstation cluster's
+       * project and the VPC host project (if different) are allowed.
+       * 
+ * + * repeated string allowed_projects = 4; + * + * @param index The index of the value to return. + * @return The bytes of the allowedProjects at the given index. + */ + public com.google.protobuf.ByteString getAllowedProjectsBytes(int index) { + return allowedProjects_.getByteString(index); + } + /** + * + * + *
+       * Additional projects that are allowed to attach to the workstation
+       * cluster's service attachment. By default, the workstation cluster's
+       * project and the VPC host project (if different) are allowed.
+       * 
+ * + * repeated string allowed_projects = 4; + * + * @param index The index to set the value at. + * @param value The allowedProjects to set. + * @return This builder for chaining. + */ + public Builder setAllowedProjects(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllowedProjectsIsMutable(); + allowedProjects_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Additional projects that are allowed to attach to the workstation
+       * cluster's service attachment. By default, the workstation cluster's
+       * project and the VPC host project (if different) are allowed.
+       * 
+ * + * repeated string allowed_projects = 4; + * + * @param value The allowedProjects to add. + * @return This builder for chaining. + */ + public Builder addAllowedProjects(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllowedProjectsIsMutable(); + allowedProjects_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Additional projects that are allowed to attach to the workstation
+       * cluster's service attachment. By default, the workstation cluster's
+       * project and the VPC host project (if different) are allowed.
+       * 
+ * + * repeated string allowed_projects = 4; + * + * @param values The allowedProjects to add. + * @return This builder for chaining. + */ + public Builder addAllAllowedProjects(java.lang.Iterable values) { + ensureAllowedProjectsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, allowedProjects_); + onChanged(); + return this; + } + /** + * + * + *
+       * Additional projects that are allowed to attach to the workstation
+       * cluster's service attachment. By default, the workstation cluster's
+       * project and the VPC host project (if different) are allowed.
+       * 
+ * + * repeated string allowed_projects = 4; + * + * @return This builder for chaining. + */ + public Builder clearAllowedProjects() { + allowedProjects_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+       * Additional projects that are allowed to attach to the workstation
+       * cluster's service attachment. By default, the workstation cluster's
+       * project and the VPC host project (if different) are allowed.
+       * 
+ * + * repeated string allowed_projects = 4; + * + * @param value The bytes of the allowedProjects to add. + * @return This builder for chaining. + */ + public Builder addAllowedProjectsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAllowedProjectsIsMutable(); + allowedProjects_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig) + private static final com.google.cloud.workstations.v1beta.WorkstationCluster + .PrivateClusterConfig + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig(); + } + + public static com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PrivateClusterConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Full name of this resource.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Full name of this resource.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+   * Human-readable name for this resource.
+   * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * Human-readable name for this resource.
+   * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object uid_ = ""; + /** + * + * + *
+   * Output only. A system-assigned unique identified for this resource.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + @java.lang.Override + public java.lang.String getUid() { + java.lang.Object ref = uid_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uid_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. A system-assigned unique identified for this resource.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUidBytes() { + java.lang.Object ref = uid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RECONCILING_FIELD_NUMBER = 4; + private boolean reconciling_ = false; + /** + * + * + *
+   * Output only. Indicates whether this resource is currently being updated to
+   * match its intended state.
+   * 
+ * + * bool reconciling = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + @java.lang.Override + public boolean getReconciling() { + return reconciling_; + } + + public static final int ANNOTATIONS_FIELD_NUMBER = 5; + + private static final class AnnotationsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationCluster_AnnotationsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + /** + * + * + *
+   * Client-specified annotations.
+   * 
+ * + * map<string, string> annotations = 5; + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + /** + * + * + *
+   * Client-specified annotations.
+   * 
+ * + * map<string, string> annotations = 5; + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + /** + * + * + *
+   * Client-specified annotations.
+   * 
+ * + * map<string, string> annotations = 5; + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Client-specified annotations.
+   * 
+ * + * map<string, string> annotations = 5; + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int LABELS_FIELD_NUMBER = 15; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationCluster_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Client-specified labels that are applied to the resource and that are also
+   * propagated to the underlying Compute Engine resources.
+   * 
+ * + * map<string, string> labels = 15; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Client-specified labels that are applied to the resource and that are also
+   * propagated to the underlying Compute Engine resources.
+   * 
+ * + * map<string, string> labels = 15; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Client-specified labels that are applied to the resource and that are also
+   * propagated to the underlying Compute Engine resources.
+   * 
+ * + * map<string, string> labels = 15; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Client-specified labels that are applied to the resource and that are also
+   * propagated to the underlying Compute Engine resources.
+   * 
+ * + * map<string, string> labels = 15; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Time when this resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. Time when this resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. Time when this resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. Time when this resource was most recently updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. Time when this resource was most recently updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. Time when this resource was most recently updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int DELETE_TIME_FIELD_NUMBER = 8; + private com.google.protobuf.Timestamp deleteTime_; + /** + * + * + *
+   * Output only. Time when this resource was soft-deleted.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + @java.lang.Override + public boolean hasDeleteTime() { + return deleteTime_ != null; + } + /** + * + * + *
+   * Output only. Time when this resource was soft-deleted.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The deleteTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getDeleteTime() { + return deleteTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : deleteTime_; + } + /** + * + * + *
+   * Output only. Time when this resource was soft-deleted.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { + return deleteTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : deleteTime_; + } + + public static final int ETAG_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * Checksum computed by the server. May be sent on update and delete requests
+   * to ensure that the client has an up-to-date value before proceeding.
+   * 
+ * + * string etag = 9; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * Checksum computed by the server. May be sent on update and delete requests
+   * to ensure that the client has an up-to-date value before proceeding.
+   * 
+ * + * string etag = 9; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NETWORK_FIELD_NUMBER = 10; + + @SuppressWarnings("serial") + private volatile java.lang.Object network_ = ""; + /** + * + * + *
+   * Immutable. Name of the Compute Engine network in which instances associated
+   * with this cluster will be created.
+   * 
+ * + * string network = 10 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The network. + */ + @java.lang.Override + public java.lang.String getNetwork() { + java.lang.Object ref = network_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + network_ = s; + return s; + } + } + /** + * + * + *
+   * Immutable. Name of the Compute Engine network in which instances associated
+   * with this cluster will be created.
+   * 
+ * + * string network = 10 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for network. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNetworkBytes() { + java.lang.Object ref = network_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + network_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SUBNETWORK_FIELD_NUMBER = 11; + + @SuppressWarnings("serial") + private volatile java.lang.Object subnetwork_ = ""; + /** + * + * + *
+   * Immutable. Name of the Compute Engine subnetwork in which instances
+   * associated with this cluster will be created. Must be part of the
+   * subnetwork specified for this cluster.
+   * 
+ * + * string subnetwork = 11 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The subnetwork. + */ + @java.lang.Override + public java.lang.String getSubnetwork() { + java.lang.Object ref = subnetwork_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + subnetwork_ = s; + return s; + } + } + /** + * + * + *
+   * Immutable. Name of the Compute Engine subnetwork in which instances
+   * associated with this cluster will be created. Must be part of the
+   * subnetwork specified for this cluster.
+   * 
+ * + * string subnetwork = 11 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for subnetwork. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSubnetworkBytes() { + java.lang.Object ref = subnetwork_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + subnetwork_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRIVATE_CLUSTER_CONFIG_FIELD_NUMBER = 12; + private com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig + privateClusterConfig_; + /** + * + * + *
+   * Configuration for private cluster.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig private_cluster_config = 12; + * + * + * @return Whether the privateClusterConfig field is set. + */ + @java.lang.Override + public boolean hasPrivateClusterConfig() { + return privateClusterConfig_ != null; + } + /** + * + * + *
+   * Configuration for private cluster.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig private_cluster_config = 12; + * + * + * @return The privateClusterConfig. + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig + getPrivateClusterConfig() { + return privateClusterConfig_ == null + ? com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig + .getDefaultInstance() + : privateClusterConfig_; + } + /** + * + * + *
+   * Configuration for private cluster.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig private_cluster_config = 12; + * + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfigOrBuilder + getPrivateClusterConfigOrBuilder() { + return privateClusterConfig_ == null + ? com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig + .getDefaultInstance() + : privateClusterConfig_; + } + + public static final int DEGRADED_FIELD_NUMBER = 13; + private boolean degraded_ = false; + /** + * + * + *
+   * Output only. Whether this resource is in degraded mode, in which case it
+   * may require user action to restore full functionality. Details can be found
+   * in the `conditions` field.
+   * 
+ * + * bool degraded = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The degraded. + */ + @java.lang.Override + public boolean getDegraded() { + return degraded_; + } + + public static final int CONDITIONS_FIELD_NUMBER = 14; + + @SuppressWarnings("serial") + private java.util.List conditions_; + /** + * + * + *
+   * Output only. Status conditions describing the current resource state.
+   * 
+ * + * repeated .google.rpc.Status conditions = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getConditionsList() { + return conditions_; + } + /** + * + * + *
+   * Output only. Status conditions describing the current resource state.
+   * 
+ * + * repeated .google.rpc.Status conditions = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getConditionsOrBuilderList() { + return conditions_; + } + /** + * + * + *
+   * Output only. Status conditions describing the current resource state.
+   * 
+ * + * repeated .google.rpc.Status conditions = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getConditionsCount() { + return conditions_.size(); + } + /** + * + * + *
+   * Output only. Status conditions describing the current resource state.
+   * 
+ * + * repeated .google.rpc.Status conditions = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.rpc.Status getConditions(int index) { + return conditions_.get(index); + } + /** + * + * + *
+   * Output only. Status conditions describing the current resource state.
+   * 
+ * + * repeated .google.rpc.Status conditions = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getConditionsOrBuilder(int index) { + return conditions_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uid_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, uid_); + } + if (reconciling_ != false) { + output.writeBool(4, reconciling_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetAnnotations(), AnnotationsDefaultEntryHolder.defaultEntry, 5); + if (createTime_ != null) { + output.writeMessage(6, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(7, getUpdateTime()); + } + if (deleteTime_ != null) { + output.writeMessage(8, getDeleteTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, etag_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(network_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, network_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subnetwork_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, subnetwork_); + } + if (privateClusterConfig_ != null) { + output.writeMessage(12, getPrivateClusterConfig()); + } + if (degraded_ != false) { + output.writeBool(13, degraded_); + } + for (int i = 0; i < conditions_.size(); i++) { + output.writeMessage(14, conditions_.get(i)); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 15); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uid_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, uid_); + } + if (reconciling_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, reconciling_); + } + for (java.util.Map.Entry entry : + internalGetAnnotations().getMap().entrySet()) { + com.google.protobuf.MapEntry annotations__ = + AnnotationsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, annotations__); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getUpdateTime()); + } + if (deleteTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getDeleteTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, etag_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(network_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, network_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subnetwork_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, subnetwork_); + } + if (privateClusterConfig_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(12, getPrivateClusterConfig()); + } + if (degraded_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(13, degraded_); + } + for (int i = 0; i < conditions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, conditions_.get(i)); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(15, labels__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workstations.v1beta.WorkstationCluster)) { + return super.equals(obj); + } + com.google.cloud.workstations.v1beta.WorkstationCluster other = + (com.google.cloud.workstations.v1beta.WorkstationCluster) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getUid().equals(other.getUid())) return false; + if (getReconciling() != other.getReconciling()) return false; + if (!internalGetAnnotations().equals(other.internalGetAnnotations())) return false; + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (hasDeleteTime() != other.hasDeleteTime()) return false; + if (hasDeleteTime()) { + if (!getDeleteTime().equals(other.getDeleteTime())) return false; + } + if (!getEtag().equals(other.getEtag())) return false; + if (!getNetwork().equals(other.getNetwork())) return false; + if (!getSubnetwork().equals(other.getSubnetwork())) return false; + if (hasPrivateClusterConfig() != other.hasPrivateClusterConfig()) return false; + if (hasPrivateClusterConfig()) { + if (!getPrivateClusterConfig().equals(other.getPrivateClusterConfig())) return false; + } + if (getDegraded() != other.getDegraded()) return false; + if (!getConditionsList().equals(other.getConditionsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + UID_FIELD_NUMBER; + hash = (53 * hash) + getUid().hashCode(); + hash = (37 * hash) + RECONCILING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReconciling()); + if (!internalGetAnnotations().getMap().isEmpty()) { + hash = (37 * hash) + ANNOTATIONS_FIELD_NUMBER; + hash = (53 * hash) + internalGetAnnotations().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (hasDeleteTime()) { + hash = (37 * hash) + DELETE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getDeleteTime().hashCode(); + } + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (37 * hash) + NETWORK_FIELD_NUMBER; + hash = (53 * hash) + getNetwork().hashCode(); + hash = (37 * hash) + SUBNETWORK_FIELD_NUMBER; + hash = (53 * hash) + getSubnetwork().hashCode(); + if (hasPrivateClusterConfig()) { + hash = (37 * hash) + PRIVATE_CLUSTER_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getPrivateClusterConfig().hashCode(); + } + hash = (37 * hash) + DEGRADED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDegraded()); + if (getConditionsCount() > 0) { + hash = (37 * hash) + CONDITIONS_FIELD_NUMBER; + hash = (53 * hash) + getConditionsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workstations.v1beta.WorkstationCluster parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.WorkstationCluster parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationCluster parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.WorkstationCluster parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationCluster parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.WorkstationCluster parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationCluster parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.WorkstationCluster parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationCluster parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.WorkstationCluster parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationCluster parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.WorkstationCluster parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workstations.v1beta.WorkstationCluster prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A grouping of workstation configurations and the associated workstations
+   *  in that region.
+   * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.WorkstationCluster} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workstations.v1beta.WorkstationCluster) + com.google.cloud.workstations.v1beta.WorkstationClusterOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationCluster_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 5: + return internalGetAnnotations(); + case 15: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 5: + return internalGetMutableAnnotations(); + case 15: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationCluster_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.WorkstationCluster.class, + com.google.cloud.workstations.v1beta.WorkstationCluster.Builder.class); + } + + // Construct using com.google.cloud.workstations.v1beta.WorkstationCluster.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + displayName_ = ""; + uid_ = ""; + reconciling_ = false; + internalGetMutableAnnotations().clear(); + internalGetMutableLabels().clear(); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + deleteTime_ = null; + if (deleteTimeBuilder_ != null) { + deleteTimeBuilder_.dispose(); + deleteTimeBuilder_ = null; + } + etag_ = ""; + network_ = ""; + subnetwork_ = ""; + privateClusterConfig_ = null; + if (privateClusterConfigBuilder_ != null) { + privateClusterConfigBuilder_.dispose(); + privateClusterConfigBuilder_ = null; + } + degraded_ = false; + if (conditionsBuilder_ == null) { + conditions_ = java.util.Collections.emptyList(); + } else { + conditions_ = null; + conditionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00004000); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationCluster_descriptor; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationCluster getDefaultInstanceForType() { + return com.google.cloud.workstations.v1beta.WorkstationCluster.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationCluster build() { + com.google.cloud.workstations.v1beta.WorkstationCluster result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationCluster buildPartial() { + com.google.cloud.workstations.v1beta.WorkstationCluster result = + new com.google.cloud.workstations.v1beta.WorkstationCluster(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.workstations.v1beta.WorkstationCluster result) { + if (conditionsBuilder_ == null) { + if (((bitField0_ & 0x00004000) != 0)) { + conditions_ = java.util.Collections.unmodifiableList(conditions_); + bitField0_ = (bitField0_ & ~0x00004000); + } + result.conditions_ = conditions_; + } else { + result.conditions_ = conditionsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.workstations.v1beta.WorkstationCluster result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.uid_ = uid_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.reconciling_ = reconciling_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.annotations_ = internalGetAnnotations(); + result.annotations_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.deleteTime_ = deleteTimeBuilder_ == null ? deleteTime_ : deleteTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.network_ = network_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.subnetwork_ = subnetwork_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.privateClusterConfig_ = + privateClusterConfigBuilder_ == null + ? privateClusterConfig_ + : privateClusterConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.degraded_ = degraded_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workstations.v1beta.WorkstationCluster) { + return mergeFrom((com.google.cloud.workstations.v1beta.WorkstationCluster) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.workstations.v1beta.WorkstationCluster other) { + if (other == com.google.cloud.workstations.v1beta.WorkstationCluster.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getUid().isEmpty()) { + uid_ = other.uid_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getReconciling() != false) { + setReconciling(other.getReconciling()); + } + internalGetMutableAnnotations().mergeFrom(other.internalGetAnnotations()); + bitField0_ |= 0x00000010; + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + bitField0_ |= 0x00000020; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasDeleteTime()) { + mergeDeleteTime(other.getDeleteTime()); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000200; + onChanged(); + } + if (!other.getNetwork().isEmpty()) { + network_ = other.network_; + bitField0_ |= 0x00000400; + onChanged(); + } + if (!other.getSubnetwork().isEmpty()) { + subnetwork_ = other.subnetwork_; + bitField0_ |= 0x00000800; + onChanged(); + } + if (other.hasPrivateClusterConfig()) { + mergePrivateClusterConfig(other.getPrivateClusterConfig()); + } + if (other.getDegraded() != false) { + setDegraded(other.getDegraded()); + } + if (conditionsBuilder_ == null) { + if (!other.conditions_.isEmpty()) { + if (conditions_.isEmpty()) { + conditions_ = other.conditions_; + bitField0_ = (bitField0_ & ~0x00004000); + } else { + ensureConditionsIsMutable(); + conditions_.addAll(other.conditions_); + } + onChanged(); + } + } else { + if (!other.conditions_.isEmpty()) { + if (conditionsBuilder_.isEmpty()) { + conditionsBuilder_.dispose(); + conditionsBuilder_ = null; + conditions_ = other.conditions_; + bitField0_ = (bitField0_ & ~0x00004000); + conditionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getConditionsFieldBuilder() + : null; + } else { + conditionsBuilder_.addAllMessages(other.conditions_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + uid_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + reconciling_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + com.google.protobuf.MapEntry annotations__ = + input.readMessage( + AnnotationsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableAnnotations() + .getMutableMap() + .put(annotations__.getKey(), annotations__.getValue()); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 50 + case 58: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 58 + case 66: + { + input.readMessage(getDeleteTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 66 + case 74: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000200; + break; + } // case 74 + case 82: + { + network_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000400; + break; + } // case 82 + case 90: + { + subnetwork_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000800; + break; + } // case 90 + case 98: + { + input.readMessage( + getPrivateClusterConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00001000; + break; + } // case 98 + case 104: + { + degraded_ = input.readBool(); + bitField0_ |= 0x00002000; + break; + } // case 104 + case 114: + { + com.google.rpc.Status m = + input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); + if (conditionsBuilder_ == null) { + ensureConditionsIsMutable(); + conditions_.add(m); + } else { + conditionsBuilder_.addMessage(m); + } + break; + } // case 114 + case 122: + { + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLabels() + .getMutableMap() + .put(labels__.getKey(), labels__.getValue()); + bitField0_ |= 0x00000020; + break; + } // case 122 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Full name of this resource.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Full name of this resource.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Full name of this resource.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Full name of this resource.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Full name of this resource.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Human-readable name for this resource.
+     * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Human-readable name for this resource.
+     * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Human-readable name for this resource.
+     * 
+ * + * string display_name = 2; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Human-readable name for this resource.
+     * 
+ * + * string display_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Human-readable name for this resource.
+     * 
+ * + * string display_name = 2; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object uid_ = ""; + /** + * + * + *
+     * Output only. A system-assigned unique identified for this resource.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + public java.lang.String getUid() { + java.lang.Object ref = uid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. A system-assigned unique identified for this resource.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + public com.google.protobuf.ByteString getUidBytes() { + java.lang.Object ref = uid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. A system-assigned unique identified for this resource.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The uid to set. + * @return This builder for chaining. + */ + public Builder setUid(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + uid_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. A system-assigned unique identified for this resource.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearUid() { + uid_ = getDefaultInstance().getUid(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. A system-assigned unique identified for this resource.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for uid to set. + * @return This builder for chaining. + */ + public Builder setUidBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + uid_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean reconciling_; + /** + * + * + *
+     * Output only. Indicates whether this resource is currently being updated to
+     * match its intended state.
+     * 
+ * + * bool reconciling = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + @java.lang.Override + public boolean getReconciling() { + return reconciling_; + } + /** + * + * + *
+     * Output only. Indicates whether this resource is currently being updated to
+     * match its intended state.
+     * 
+ * + * bool reconciling = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The reconciling to set. + * @return This builder for chaining. + */ + public Builder setReconciling(boolean value) { + + reconciling_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Indicates whether this resource is currently being updated to
+     * match its intended state.
+     * 
+ * + * bool reconciling = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearReconciling() { + bitField0_ = (bitField0_ & ~0x00000008); + reconciling_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + private com.google.protobuf.MapField + internalGetMutableAnnotations() { + if (annotations_ == null) { + annotations_ = + com.google.protobuf.MapField.newMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + if (!annotations_.isMutable()) { + annotations_ = annotations_.copy(); + } + bitField0_ |= 0x00000010; + onChanged(); + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + /** + * + * + *
+     * Client-specified annotations.
+     * 
+ * + * map<string, string> annotations = 5; + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + /** + * + * + *
+     * Client-specified annotations.
+     * 
+ * + * map<string, string> annotations = 5; + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + /** + * + * + *
+     * Client-specified annotations.
+     * 
+ * + * map<string, string> annotations = 5; + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Client-specified annotations.
+     * 
+ * + * map<string, string> annotations = 5; + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAnnotations() { + bitField0_ = (bitField0_ & ~0x00000010); + internalGetMutableAnnotations().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Client-specified annotations.
+     * 
+ * + * map<string, string> annotations = 5; + */ + public Builder removeAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAnnotations().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableAnnotations() { + bitField0_ |= 0x00000010; + return internalGetMutableAnnotations().getMutableMap(); + } + /** + * + * + *
+     * Client-specified annotations.
+     * 
+ * + * map<string, string> annotations = 5; + */ + public Builder putAnnotations(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableAnnotations().getMutableMap().put(key, value); + bitField0_ |= 0x00000010; + return this; + } + /** + * + * + *
+     * Client-specified annotations.
+     * 
+ * + * map<string, string> annotations = 5; + */ + public Builder putAllAnnotations(java.util.Map values) { + internalGetMutableAnnotations().getMutableMap().putAll(values); + bitField0_ |= 0x00000010; + return this; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + bitField0_ |= 0x00000020; + onChanged(); + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Client-specified labels that are applied to the resource and that are also
+     * propagated to the underlying Compute Engine resources.
+     * 
+ * + * map<string, string> labels = 15; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Client-specified labels that are applied to the resource and that are also
+     * propagated to the underlying Compute Engine resources.
+     * 
+ * + * map<string, string> labels = 15; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Client-specified labels that are applied to the resource and that are also
+     * propagated to the underlying Compute Engine resources.
+     * 
+ * + * map<string, string> labels = 15; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Client-specified labels that are applied to the resource and that are also
+     * propagated to the underlying Compute Engine resources.
+     * 
+ * + * map<string, string> labels = 15; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + bitField0_ = (bitField0_ & ~0x00000020); + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Client-specified labels that are applied to the resource and that are also
+     * propagated to the underlying Compute Engine resources.
+     * 
+ * + * map<string, string> labels = 15; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + bitField0_ |= 0x00000020; + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Client-specified labels that are applied to the resource and that are also
+     * propagated to the underlying Compute Engine resources.
+     * 
+ * + * map<string, string> labels = 15; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00000020; + return this; + } + /** + * + * + *
+     * Client-specified labels that are applied to the resource and that are also
+     * propagated to the underlying Compute Engine resources.
+     * 
+ * + * map<string, string> labels = 15; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000020; + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. Time when this resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+     * Output only. Time when this resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Time when this resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when this resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when this resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when this resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000040); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when this resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Time when this resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. Time when this resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. Time when this resource was most recently updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * + * + *
+     * Output only. Time when this resource was most recently updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Time when this resource was most recently updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when this resource was most recently updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when this resource was most recently updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when this resource was most recently updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000080); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when this resource was most recently updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Time when this resource was most recently updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. Time when this resource was most recently updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private com.google.protobuf.Timestamp deleteTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + deleteTimeBuilder_; + /** + * + * + *
+     * Output only. Time when this resource was soft-deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + public boolean hasDeleteTime() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + * + * + *
+     * Output only. Time when this resource was soft-deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The deleteTime. + */ + public com.google.protobuf.Timestamp getDeleteTime() { + if (deleteTimeBuilder_ == null) { + return deleteTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : deleteTime_; + } else { + return deleteTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Time when this resource was soft-deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDeleteTime(com.google.protobuf.Timestamp value) { + if (deleteTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deleteTime_ = value; + } else { + deleteTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when this resource was soft-deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDeleteTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (deleteTimeBuilder_ == null) { + deleteTime_ = builderForValue.build(); + } else { + deleteTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when this resource was soft-deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeDeleteTime(com.google.protobuf.Timestamp value) { + if (deleteTimeBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && deleteTime_ != null + && deleteTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getDeleteTimeBuilder().mergeFrom(value); + } else { + deleteTime_ = value; + } + } else { + deleteTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when this resource was soft-deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearDeleteTime() { + bitField0_ = (bitField0_ & ~0x00000100); + deleteTime_ = null; + if (deleteTimeBuilder_ != null) { + deleteTimeBuilder_.dispose(); + deleteTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when this resource was soft-deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getDeleteTimeBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return getDeleteTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Time when this resource was soft-deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { + if (deleteTimeBuilder_ != null) { + return deleteTimeBuilder_.getMessageOrBuilder(); + } else { + return deleteTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : deleteTime_; + } + } + /** + * + * + *
+     * Output only. Time when this resource was soft-deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getDeleteTimeFieldBuilder() { + if (deleteTimeBuilder_ == null) { + deleteTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getDeleteTime(), getParentForChildren(), isClean()); + deleteTime_ = null; + } + return deleteTimeBuilder_; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * Checksum computed by the server. May be sent on update and delete requests
+     * to ensure that the client has an up-to-date value before proceeding.
+     * 
+ * + * string etag = 9; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Checksum computed by the server. May be sent on update and delete requests
+     * to ensure that the client has an up-to-date value before proceeding.
+     * 
+ * + * string etag = 9; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Checksum computed by the server. May be sent on update and delete requests
+     * to ensure that the client has an up-to-date value before proceeding.
+     * 
+ * + * string etag = 9; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Checksum computed by the server. May be sent on update and delete requests
+     * to ensure that the client has an up-to-date value before proceeding.
+     * 
+ * + * string etag = 9; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + return this; + } + /** + * + * + *
+     * Checksum computed by the server. May be sent on update and delete requests
+     * to ensure that the client has an up-to-date value before proceeding.
+     * 
+ * + * string etag = 9; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + private java.lang.Object network_ = ""; + /** + * + * + *
+     * Immutable. Name of the Compute Engine network in which instances associated
+     * with this cluster will be created.
+     * 
+ * + * string network = 10 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The network. + */ + public java.lang.String getNetwork() { + java.lang.Object ref = network_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + network_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Immutable. Name of the Compute Engine network in which instances associated
+     * with this cluster will be created.
+     * 
+ * + * string network = 10 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for network. + */ + public com.google.protobuf.ByteString getNetworkBytes() { + java.lang.Object ref = network_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + network_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Immutable. Name of the Compute Engine network in which instances associated
+     * with this cluster will be created.
+     * 
+ * + * string network = 10 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The network to set. + * @return This builder for chaining. + */ + public Builder setNetwork(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + network_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. Name of the Compute Engine network in which instances associated
+     * with this cluster will be created.
+     * 
+ * + * string network = 10 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearNetwork() { + network_ = getDefaultInstance().getNetwork(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. Name of the Compute Engine network in which instances associated
+     * with this cluster will be created.
+     * 
+ * + * string network = 10 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The bytes for network to set. + * @return This builder for chaining. + */ + public Builder setNetworkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + network_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + private java.lang.Object subnetwork_ = ""; + /** + * + * + *
+     * Immutable. Name of the Compute Engine subnetwork in which instances
+     * associated with this cluster will be created. Must be part of the
+     * subnetwork specified for this cluster.
+     * 
+ * + * string subnetwork = 11 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The subnetwork. + */ + public java.lang.String getSubnetwork() { + java.lang.Object ref = subnetwork_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + subnetwork_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Immutable. Name of the Compute Engine subnetwork in which instances
+     * associated with this cluster will be created. Must be part of the
+     * subnetwork specified for this cluster.
+     * 
+ * + * string subnetwork = 11 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for subnetwork. + */ + public com.google.protobuf.ByteString getSubnetworkBytes() { + java.lang.Object ref = subnetwork_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + subnetwork_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Immutable. Name of the Compute Engine subnetwork in which instances
+     * associated with this cluster will be created. Must be part of the
+     * subnetwork specified for this cluster.
+     * 
+ * + * string subnetwork = 11 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The subnetwork to set. + * @return This builder for chaining. + */ + public Builder setSubnetwork(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + subnetwork_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. Name of the Compute Engine subnetwork in which instances
+     * associated with this cluster will be created. Must be part of the
+     * subnetwork specified for this cluster.
+     * 
+ * + * string subnetwork = 11 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearSubnetwork() { + subnetwork_ = getDefaultInstance().getSubnetwork(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. Name of the Compute Engine subnetwork in which instances
+     * associated with this cluster will be created. Must be part of the
+     * subnetwork specified for this cluster.
+     * 
+ * + * string subnetwork = 11 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The bytes for subnetwork to set. + * @return This builder for chaining. + */ + public Builder setSubnetworkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + subnetwork_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + private com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig + privateClusterConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig, + com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig.Builder, + com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfigOrBuilder> + privateClusterConfigBuilder_; + /** + * + * + *
+     * Configuration for private cluster.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig private_cluster_config = 12; + * + * + * @return Whether the privateClusterConfig field is set. + */ + public boolean hasPrivateClusterConfig() { + return ((bitField0_ & 0x00001000) != 0); + } + /** + * + * + *
+     * Configuration for private cluster.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig private_cluster_config = 12; + * + * + * @return The privateClusterConfig. + */ + public com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig + getPrivateClusterConfig() { + if (privateClusterConfigBuilder_ == null) { + return privateClusterConfig_ == null + ? com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig + .getDefaultInstance() + : privateClusterConfig_; + } else { + return privateClusterConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Configuration for private cluster.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig private_cluster_config = 12; + * + */ + public Builder setPrivateClusterConfig( + com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig value) { + if (privateClusterConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + privateClusterConfig_ = value; + } else { + privateClusterConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * Configuration for private cluster.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig private_cluster_config = 12; + * + */ + public Builder setPrivateClusterConfig( + com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig.Builder + builderForValue) { + if (privateClusterConfigBuilder_ == null) { + privateClusterConfig_ = builderForValue.build(); + } else { + privateClusterConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * Configuration for private cluster.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig private_cluster_config = 12; + * + */ + public Builder mergePrivateClusterConfig( + com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig value) { + if (privateClusterConfigBuilder_ == null) { + if (((bitField0_ & 0x00001000) != 0) + && privateClusterConfig_ != null + && privateClusterConfig_ + != com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig + .getDefaultInstance()) { + getPrivateClusterConfigBuilder().mergeFrom(value); + } else { + privateClusterConfig_ = value; + } + } else { + privateClusterConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * Configuration for private cluster.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig private_cluster_config = 12; + * + */ + public Builder clearPrivateClusterConfig() { + bitField0_ = (bitField0_ & ~0x00001000); + privateClusterConfig_ = null; + if (privateClusterConfigBuilder_ != null) { + privateClusterConfigBuilder_.dispose(); + privateClusterConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Configuration for private cluster.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig private_cluster_config = 12; + * + */ + public com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig.Builder + getPrivateClusterConfigBuilder() { + bitField0_ |= 0x00001000; + onChanged(); + return getPrivateClusterConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Configuration for private cluster.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig private_cluster_config = 12; + * + */ + public com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfigOrBuilder + getPrivateClusterConfigOrBuilder() { + if (privateClusterConfigBuilder_ != null) { + return privateClusterConfigBuilder_.getMessageOrBuilder(); + } else { + return privateClusterConfig_ == null + ? com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig + .getDefaultInstance() + : privateClusterConfig_; + } + } + /** + * + * + *
+     * Configuration for private cluster.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig private_cluster_config = 12; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig, + com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig.Builder, + com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfigOrBuilder> + getPrivateClusterConfigFieldBuilder() { + if (privateClusterConfigBuilder_ == null) { + privateClusterConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig, + com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig + .Builder, + com.google.cloud.workstations.v1beta.WorkstationCluster + .PrivateClusterConfigOrBuilder>( + getPrivateClusterConfig(), getParentForChildren(), isClean()); + privateClusterConfig_ = null; + } + return privateClusterConfigBuilder_; + } + + private boolean degraded_; + /** + * + * + *
+     * Output only. Whether this resource is in degraded mode, in which case it
+     * may require user action to restore full functionality. Details can be found
+     * in the `conditions` field.
+     * 
+ * + * bool degraded = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The degraded. + */ + @java.lang.Override + public boolean getDegraded() { + return degraded_; + } + /** + * + * + *
+     * Output only. Whether this resource is in degraded mode, in which case it
+     * may require user action to restore full functionality. Details can be found
+     * in the `conditions` field.
+     * 
+ * + * bool degraded = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The degraded to set. + * @return This builder for chaining. + */ + public Builder setDegraded(boolean value) { + + degraded_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Whether this resource is in degraded mode, in which case it
+     * may require user action to restore full functionality. Details can be found
+     * in the `conditions` field.
+     * 
+ * + * bool degraded = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDegraded() { + bitField0_ = (bitField0_ & ~0x00002000); + degraded_ = false; + onChanged(); + return this; + } + + private java.util.List conditions_ = java.util.Collections.emptyList(); + + private void ensureConditionsIsMutable() { + if (!((bitField0_ & 0x00004000) != 0)) { + conditions_ = new java.util.ArrayList(conditions_); + bitField0_ |= 0x00004000; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + conditionsBuilder_; + + /** + * + * + *
+     * Output only. Status conditions describing the current resource state.
+     * 
+ * + * + * repeated .google.rpc.Status conditions = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getConditionsList() { + if (conditionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(conditions_); + } else { + return conditionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. Status conditions describing the current resource state.
+     * 
+ * + * + * repeated .google.rpc.Status conditions = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getConditionsCount() { + if (conditionsBuilder_ == null) { + return conditions_.size(); + } else { + return conditionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. Status conditions describing the current resource state.
+     * 
+ * + * + * repeated .google.rpc.Status conditions = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.rpc.Status getConditions(int index) { + if (conditionsBuilder_ == null) { + return conditions_.get(index); + } else { + return conditionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. Status conditions describing the current resource state.
+     * 
+ * + * + * repeated .google.rpc.Status conditions = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setConditions(int index, com.google.rpc.Status value) { + if (conditionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConditionsIsMutable(); + conditions_.set(index, value); + onChanged(); + } else { + conditionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Status conditions describing the current resource state.
+     * 
+ * + * + * repeated .google.rpc.Status conditions = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setConditions(int index, com.google.rpc.Status.Builder builderForValue) { + if (conditionsBuilder_ == null) { + ensureConditionsIsMutable(); + conditions_.set(index, builderForValue.build()); + onChanged(); + } else { + conditionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Status conditions describing the current resource state.
+     * 
+ * + * + * repeated .google.rpc.Status conditions = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addConditions(com.google.rpc.Status value) { + if (conditionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConditionsIsMutable(); + conditions_.add(value); + onChanged(); + } else { + conditionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. Status conditions describing the current resource state.
+     * 
+ * + * + * repeated .google.rpc.Status conditions = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addConditions(int index, com.google.rpc.Status value) { + if (conditionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConditionsIsMutable(); + conditions_.add(index, value); + onChanged(); + } else { + conditionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Status conditions describing the current resource state.
+     * 
+ * + * + * repeated .google.rpc.Status conditions = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addConditions(com.google.rpc.Status.Builder builderForValue) { + if (conditionsBuilder_ == null) { + ensureConditionsIsMutable(); + conditions_.add(builderForValue.build()); + onChanged(); + } else { + conditionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Status conditions describing the current resource state.
+     * 
+ * + * + * repeated .google.rpc.Status conditions = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addConditions(int index, com.google.rpc.Status.Builder builderForValue) { + if (conditionsBuilder_ == null) { + ensureConditionsIsMutable(); + conditions_.add(index, builderForValue.build()); + onChanged(); + } else { + conditionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Status conditions describing the current resource state.
+     * 
+ * + * + * repeated .google.rpc.Status conditions = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllConditions(java.lang.Iterable values) { + if (conditionsBuilder_ == null) { + ensureConditionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, conditions_); + onChanged(); + } else { + conditionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. Status conditions describing the current resource state.
+     * 
+ * + * + * repeated .google.rpc.Status conditions = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearConditions() { + if (conditionsBuilder_ == null) { + conditions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00004000); + onChanged(); + } else { + conditionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. Status conditions describing the current resource state.
+     * 
+ * + * + * repeated .google.rpc.Status conditions = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeConditions(int index) { + if (conditionsBuilder_ == null) { + ensureConditionsIsMutable(); + conditions_.remove(index); + onChanged(); + } else { + conditionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. Status conditions describing the current resource state.
+     * 
+ * + * + * repeated .google.rpc.Status conditions = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.rpc.Status.Builder getConditionsBuilder(int index) { + return getConditionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. Status conditions describing the current resource state.
+     * 
+ * + * + * repeated .google.rpc.Status conditions = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.rpc.StatusOrBuilder getConditionsOrBuilder(int index) { + if (conditionsBuilder_ == null) { + return conditions_.get(index); + } else { + return conditionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. Status conditions describing the current resource state.
+     * 
+ * + * + * repeated .google.rpc.Status conditions = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getConditionsOrBuilderList() { + if (conditionsBuilder_ != null) { + return conditionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(conditions_); + } + } + /** + * + * + *
+     * Output only. Status conditions describing the current resource state.
+     * 
+ * + * + * repeated .google.rpc.Status conditions = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.rpc.Status.Builder addConditionsBuilder() { + return getConditionsFieldBuilder().addBuilder(com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Status conditions describing the current resource state.
+     * 
+ * + * + * repeated .google.rpc.Status conditions = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.rpc.Status.Builder addConditionsBuilder(int index) { + return getConditionsFieldBuilder() + .addBuilder(index, com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Status conditions describing the current resource state.
+     * 
+ * + * + * repeated .google.rpc.Status conditions = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getConditionsBuilderList() { + return getConditionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getConditionsFieldBuilder() { + if (conditionsBuilder_ == null) { + conditionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>( + conditions_, ((bitField0_ & 0x00004000) != 0), getParentForChildren(), isClean()); + conditions_ = null; + } + return conditionsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workstations.v1beta.WorkstationCluster) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workstations.v1beta.WorkstationCluster) + private static final com.google.cloud.workstations.v1beta.WorkstationCluster DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workstations.v1beta.WorkstationCluster(); + } + + public static com.google.cloud.workstations.v1beta.WorkstationCluster getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WorkstationCluster parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationCluster getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/WorkstationClusterName.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/WorkstationClusterName.java new file mode 100644 index 000000000000..5afcc1f9a17e --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/WorkstationClusterName.java @@ -0,0 +1,231 @@ +/* + * Copyright 2022 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.workstations.v1beta; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class WorkstationClusterName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_WORKSTATION_CLUSTER = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String workstationCluster; + + @Deprecated + protected WorkstationClusterName() { + project = null; + location = null; + workstationCluster = null; + } + + private WorkstationClusterName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + workstationCluster = Preconditions.checkNotNull(builder.getWorkstationCluster()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getWorkstationCluster() { + return workstationCluster; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static WorkstationClusterName of( + String project, String location, String workstationCluster) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setWorkstationCluster(workstationCluster) + .build(); + } + + public static String format(String project, String location, String workstationCluster) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setWorkstationCluster(workstationCluster) + .build() + .toString(); + } + + public static WorkstationClusterName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_WORKSTATION_CLUSTER.validatedMatch( + formattedString, "WorkstationClusterName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), matchMap.get("location"), matchMap.get("workstation_cluster")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (WorkstationClusterName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_WORKSTATION_CLUSTER.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (workstationCluster != null) { + fieldMapBuilder.put("workstation_cluster", workstationCluster); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_WORKSTATION_CLUSTER.instantiate( + "project", project, "location", location, "workstation_cluster", workstationCluster); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + WorkstationClusterName that = ((WorkstationClusterName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.workstationCluster, that.workstationCluster); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(workstationCluster); + return h; + } + + /** + * Builder for projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}. + */ + public static class Builder { + private String project; + private String location; + private String workstationCluster; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getWorkstationCluster() { + return workstationCluster; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setWorkstationCluster(String workstationCluster) { + this.workstationCluster = workstationCluster; + return this; + } + + private Builder(WorkstationClusterName workstationClusterName) { + this.project = workstationClusterName.project; + this.location = workstationClusterName.location; + this.workstationCluster = workstationClusterName.workstationCluster; + } + + public WorkstationClusterName build() { + return new WorkstationClusterName(this); + } + } +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/WorkstationClusterOrBuilder.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/WorkstationClusterOrBuilder.java new file mode 100644 index 000000000000..9fa83ac75c4a --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/WorkstationClusterOrBuilder.java @@ -0,0 +1,546 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +public interface WorkstationClusterOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workstations.v1beta.WorkstationCluster) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Full name of this resource.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Full name of this resource.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Human-readable name for this resource.
+   * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Human-readable name for this resource.
+   * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Output only. A system-assigned unique identified for this resource.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + java.lang.String getUid(); + /** + * + * + *
+   * Output only. A system-assigned unique identified for this resource.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + com.google.protobuf.ByteString getUidBytes(); + + /** + * + * + *
+   * Output only. Indicates whether this resource is currently being updated to
+   * match its intended state.
+   * 
+ * + * bool reconciling = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + boolean getReconciling(); + + /** + * + * + *
+   * Client-specified annotations.
+   * 
+ * + * map<string, string> annotations = 5; + */ + int getAnnotationsCount(); + /** + * + * + *
+   * Client-specified annotations.
+   * 
+ * + * map<string, string> annotations = 5; + */ + boolean containsAnnotations(java.lang.String key); + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getAnnotations(); + /** + * + * + *
+   * Client-specified annotations.
+   * 
+ * + * map<string, string> annotations = 5; + */ + java.util.Map getAnnotationsMap(); + /** + * + * + *
+   * Client-specified annotations.
+   * 
+ * + * map<string, string> annotations = 5; + */ + /* nullable */ + java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Client-specified annotations.
+   * 
+ * + * map<string, string> annotations = 5; + */ + java.lang.String getAnnotationsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Client-specified labels that are applied to the resource and that are also
+   * propagated to the underlying Compute Engine resources.
+   * 
+ * + * map<string, string> labels = 15; + */ + int getLabelsCount(); + /** + * + * + *
+   * Client-specified labels that are applied to the resource and that are also
+   * propagated to the underlying Compute Engine resources.
+   * 
+ * + * map<string, string> labels = 15; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Client-specified labels that are applied to the resource and that are also
+   * propagated to the underlying Compute Engine resources.
+   * 
+ * + * map<string, string> labels = 15; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Client-specified labels that are applied to the resource and that are also
+   * propagated to the underlying Compute Engine resources.
+   * 
+ * + * map<string, string> labels = 15; + */ + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Client-specified labels that are applied to the resource and that are also
+   * propagated to the underlying Compute Engine resources.
+   * 
+ * + * map<string, string> labels = 15; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. Time when this resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Time when this resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Time when this resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Time when this resource was most recently updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. Time when this resource was most recently updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. Time when this resource was most recently updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Time when this resource was soft-deleted.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + boolean hasDeleteTime(); + /** + * + * + *
+   * Output only. Time when this resource was soft-deleted.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The deleteTime. + */ + com.google.protobuf.Timestamp getDeleteTime(); + /** + * + * + *
+   * Output only. Time when this resource was soft-deleted.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder(); + + /** + * + * + *
+   * Checksum computed by the server. May be sent on update and delete requests
+   * to ensure that the client has an up-to-date value before proceeding.
+   * 
+ * + * string etag = 9; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * Checksum computed by the server. May be sent on update and delete requests
+   * to ensure that the client has an up-to-date value before proceeding.
+   * 
+ * + * string etag = 9; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * Immutable. Name of the Compute Engine network in which instances associated
+   * with this cluster will be created.
+   * 
+ * + * string network = 10 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The network. + */ + java.lang.String getNetwork(); + /** + * + * + *
+   * Immutable. Name of the Compute Engine network in which instances associated
+   * with this cluster will be created.
+   * 
+ * + * string network = 10 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for network. + */ + com.google.protobuf.ByteString getNetworkBytes(); + + /** + * + * + *
+   * Immutable. Name of the Compute Engine subnetwork in which instances
+   * associated with this cluster will be created. Must be part of the
+   * subnetwork specified for this cluster.
+   * 
+ * + * string subnetwork = 11 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The subnetwork. + */ + java.lang.String getSubnetwork(); + /** + * + * + *
+   * Immutable. Name of the Compute Engine subnetwork in which instances
+   * associated with this cluster will be created. Must be part of the
+   * subnetwork specified for this cluster.
+   * 
+ * + * string subnetwork = 11 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for subnetwork. + */ + com.google.protobuf.ByteString getSubnetworkBytes(); + + /** + * + * + *
+   * Configuration for private cluster.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig private_cluster_config = 12; + * + * + * @return Whether the privateClusterConfig field is set. + */ + boolean hasPrivateClusterConfig(); + /** + * + * + *
+   * Configuration for private cluster.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig private_cluster_config = 12; + * + * + * @return The privateClusterConfig. + */ + com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig + getPrivateClusterConfig(); + /** + * + * + *
+   * Configuration for private cluster.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig private_cluster_config = 12; + * + */ + com.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfigOrBuilder + getPrivateClusterConfigOrBuilder(); + + /** + * + * + *
+   * Output only. Whether this resource is in degraded mode, in which case it
+   * may require user action to restore full functionality. Details can be found
+   * in the `conditions` field.
+   * 
+ * + * bool degraded = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The degraded. + */ + boolean getDegraded(); + + /** + * + * + *
+   * Output only. Status conditions describing the current resource state.
+   * 
+ * + * repeated .google.rpc.Status conditions = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getConditionsList(); + /** + * + * + *
+   * Output only. Status conditions describing the current resource state.
+   * 
+ * + * repeated .google.rpc.Status conditions = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.rpc.Status getConditions(int index); + /** + * + * + *
+   * Output only. Status conditions describing the current resource state.
+   * 
+ * + * repeated .google.rpc.Status conditions = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getConditionsCount(); + /** + * + * + *
+   * Output only. Status conditions describing the current resource state.
+   * 
+ * + * repeated .google.rpc.Status conditions = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getConditionsOrBuilderList(); + /** + * + * + *
+   * Output only. Status conditions describing the current resource state.
+   * 
+ * + * repeated .google.rpc.Status conditions = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.rpc.StatusOrBuilder getConditionsOrBuilder(int index); +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/WorkstationConfig.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/WorkstationConfig.java new file mode 100644 index 000000000000..79c15b7c3dfb --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/WorkstationConfig.java @@ -0,0 +1,16060 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +/** + * + * + *
+ * A set of configuration options describing how a workstation will be run.
+ * Workstation configurations are intended to be shared across multiple
+ * workstations.
+ * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.WorkstationConfig} + */ +public final class WorkstationConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workstations.v1beta.WorkstationConfig) + WorkstationConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use WorkstationConfig.newBuilder() to construct. + private WorkstationConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private WorkstationConfig() { + name_ = ""; + displayName_ = ""; + uid_ = ""; + etag_ = ""; + persistentDirectories_ = java.util.Collections.emptyList(); + conditions_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new WorkstationConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 5: + return internalGetAnnotations(); + case 18: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.WorkstationConfig.class, + com.google.cloud.workstations.v1beta.WorkstationConfig.Builder.class); + } + + public interface HostOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workstations.v1beta.WorkstationConfig.Host) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Specifies a Compute Engine instance as the host.
+     * 
+ * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance gce_instance = 1; + * + * + * @return Whether the gceInstance field is set. + */ + boolean hasGceInstance(); + /** + * + * + *
+     * Specifies a Compute Engine instance as the host.
+     * 
+ * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance gce_instance = 1; + * + * + * @return The gceInstance. + */ + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance getGceInstance(); + /** + * + * + *
+     * Specifies a Compute Engine instance as the host.
+     * 
+ * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance gce_instance = 1; + * + */ + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstanceOrBuilder + getGceInstanceOrBuilder(); + + public com.google.cloud.workstations.v1beta.WorkstationConfig.Host.ConfigCase getConfigCase(); + } + /** + * + * + *
+   * Runtime host for a workstation.
+   * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.WorkstationConfig.Host} + */ + public static final class Host extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workstations.v1beta.WorkstationConfig.Host) + HostOrBuilder { + private static final long serialVersionUID = 0L; + // Use Host.newBuilder() to construct. + private Host(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Host() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Host(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.class, + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.Builder.class); + } + + public interface GceInstanceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * The name of a Compute Engine machine type.
+       * 
+ * + * string machine_type = 1; + * + * @return The machineType. + */ + java.lang.String getMachineType(); + /** + * + * + *
+       * The name of a Compute Engine machine type.
+       * 
+ * + * string machine_type = 1; + * + * @return The bytes for machineType. + */ + com.google.protobuf.ByteString getMachineTypeBytes(); + + /** + * + * + *
+       * Email address of the service account that will be used on VM instances
+       * used to support this config. This service account must have permission
+       * to pull the specified container image. If not set, VMs will run without
+       * a service account, in which case the image must be publicly accessible.
+       * 
+ * + * string service_account = 2; + * + * @return The serviceAccount. + */ + java.lang.String getServiceAccount(); + /** + * + * + *
+       * Email address of the service account that will be used on VM instances
+       * used to support this config. This service account must have permission
+       * to pull the specified container image. If not set, VMs will run without
+       * a service account, in which case the image must be publicly accessible.
+       * 
+ * + * string service_account = 2; + * + * @return The bytes for serviceAccount. + */ + com.google.protobuf.ByteString getServiceAccountBytes(); + + /** + * + * + *
+       * Network tags to add to the Compute Engine machines backing the
+       * Workstations.
+       * 
+ * + * repeated string tags = 4; + * + * @return A list containing the tags. + */ + java.util.List getTagsList(); + /** + * + * + *
+       * Network tags to add to the Compute Engine machines backing the
+       * Workstations.
+       * 
+ * + * repeated string tags = 4; + * + * @return The count of tags. + */ + int getTagsCount(); + /** + * + * + *
+       * Network tags to add to the Compute Engine machines backing the
+       * Workstations.
+       * 
+ * + * repeated string tags = 4; + * + * @param index The index of the element to return. + * @return The tags at the given index. + */ + java.lang.String getTags(int index); + /** + * + * + *
+       * Network tags to add to the Compute Engine machines backing the
+       * Workstations.
+       * 
+ * + * repeated string tags = 4; + * + * @param index The index of the value to return. + * @return The bytes of the tags at the given index. + */ + com.google.protobuf.ByteString getTagsBytes(int index); + + /** + * + * + *
+       * Number of instances to pool for faster workstation starup.
+       * 
+ * + * int32 pool_size = 5; + * + * @return The poolSize. + */ + int getPoolSize(); + + /** + * + * + *
+       * Whether instances have no public IP address.
+       * 
+ * + * bool disable_public_ip_addresses = 6; + * + * @return The disablePublicIpAddresses. + */ + boolean getDisablePublicIpAddresses(); + + /** + * + * + *
+       * A set of Compute Engine Shielded instance options.
+       * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig shielded_instance_config = 8; + * + * + * @return Whether the shieldedInstanceConfig field is set. + */ + boolean hasShieldedInstanceConfig(); + /** + * + * + *
+       * A set of Compute Engine Shielded instance options.
+       * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig shielded_instance_config = 8; + * + * + * @return The shieldedInstanceConfig. + */ + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig + getShieldedInstanceConfig(); + /** + * + * + *
+       * A set of Compute Engine Shielded instance options.
+       * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig shielded_instance_config = 8; + * + */ + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfigOrBuilder + getShieldedInstanceConfigOrBuilder(); + + /** + * + * + *
+       * A set of Compute Engine Confidential VM instance options.
+       * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig confidential_instance_config = 10; + * + * + * @return Whether the confidentialInstanceConfig field is set. + */ + boolean hasConfidentialInstanceConfig(); + /** + * + * + *
+       * A set of Compute Engine Confidential VM instance options.
+       * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig confidential_instance_config = 10; + * + * + * @return The confidentialInstanceConfig. + */ + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig + getConfidentialInstanceConfig(); + /** + * + * + *
+       * A set of Compute Engine Confidential VM instance options.
+       * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig confidential_instance_config = 10; + * + */ + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfigOrBuilder + getConfidentialInstanceConfigOrBuilder(); + + /** + * + * + *
+       * Size of the boot disk in GB.
+       * 
+ * + * int32 boot_disk_size_gb = 9; + * + * @return The bootDiskSizeGb. + */ + int getBootDiskSizeGb(); + } + /** + * + * + *
+     * A runtime using a Compute Engine instance.
+     * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance} + */ + public static final class GceInstance extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance) + GceInstanceOrBuilder { + private static final long serialVersionUID = 0L; + // Use GceInstance.newBuilder() to construct. + private GceInstance(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GceInstance() { + machineType_ = ""; + serviceAccount_ = ""; + tags_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GceInstance(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_GceInstance_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_GceInstance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.class, + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.Builder + .class); + } + + public interface GceShieldedInstanceConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+         * Whether the instance has Secure Boot enabled.
+         * 
+ * + * bool enable_secure_boot = 1; + * + * @return The enableSecureBoot. + */ + boolean getEnableSecureBoot(); + + /** + * + * + *
+         * Whether the instance has the vTPM enabled.
+         * 
+ * + * bool enable_vtpm = 2; + * + * @return The enableVtpm. + */ + boolean getEnableVtpm(); + + /** + * + * + *
+         * Whether the instance has integrity monitoring enabled.
+         * 
+ * + * bool enable_integrity_monitoring = 3; + * + * @return The enableIntegrityMonitoring. + */ + boolean getEnableIntegrityMonitoring(); + } + /** + * + * + *
+       * A set of Compute Engine Shielded instance options.
+       * 
+ * + * Protobuf type {@code + * google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig} + */ + public static final class GceShieldedInstanceConfig + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig) + GceShieldedInstanceConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use GceShieldedInstanceConfig.newBuilder() to construct. + private GceShieldedInstanceConfig( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GceShieldedInstanceConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GceShieldedInstanceConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_GceInstance_GceShieldedInstanceConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_GceInstance_GceShieldedInstanceConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig.class, + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig.Builder.class); + } + + public static final int ENABLE_SECURE_BOOT_FIELD_NUMBER = 1; + private boolean enableSecureBoot_ = false; + /** + * + * + *
+         * Whether the instance has Secure Boot enabled.
+         * 
+ * + * bool enable_secure_boot = 1; + * + * @return The enableSecureBoot. + */ + @java.lang.Override + public boolean getEnableSecureBoot() { + return enableSecureBoot_; + } + + public static final int ENABLE_VTPM_FIELD_NUMBER = 2; + private boolean enableVtpm_ = false; + /** + * + * + *
+         * Whether the instance has the vTPM enabled.
+         * 
+ * + * bool enable_vtpm = 2; + * + * @return The enableVtpm. + */ + @java.lang.Override + public boolean getEnableVtpm() { + return enableVtpm_; + } + + public static final int ENABLE_INTEGRITY_MONITORING_FIELD_NUMBER = 3; + private boolean enableIntegrityMonitoring_ = false; + /** + * + * + *
+         * Whether the instance has integrity monitoring enabled.
+         * 
+ * + * bool enable_integrity_monitoring = 3; + * + * @return The enableIntegrityMonitoring. + */ + @java.lang.Override + public boolean getEnableIntegrityMonitoring() { + return enableIntegrityMonitoring_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (enableSecureBoot_ != false) { + output.writeBool(1, enableSecureBoot_); + } + if (enableVtpm_ != false) { + output.writeBool(2, enableVtpm_); + } + if (enableIntegrityMonitoring_ != false) { + output.writeBool(3, enableIntegrityMonitoring_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (enableSecureBoot_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, enableSecureBoot_); + } + if (enableVtpm_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, enableVtpm_); + } + if (enableIntegrityMonitoring_ != false) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize( + 3, enableIntegrityMonitoring_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig)) { + return super.equals(obj); + } + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig + other = + (com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig) + obj; + + if (getEnableSecureBoot() != other.getEnableSecureBoot()) return false; + if (getEnableVtpm() != other.getEnableVtpm()) return false; + if (getEnableIntegrityMonitoring() != other.getEnableIntegrityMonitoring()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ENABLE_SECURE_BOOT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableSecureBoot()); + hash = (37 * hash) + ENABLE_VTPM_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableVtpm()); + hash = (37 * hash) + ENABLE_INTEGRITY_MONITORING_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashBoolean(getEnableIntegrityMonitoring()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig + parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+         * A set of Compute Engine Shielded instance options.
+         * 
+ * + * Protobuf type {@code + * google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig) + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_GceInstance_GceShieldedInstanceConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_GceInstance_GceShieldedInstanceConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig.class, + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig.Builder.class); + } + + // Construct using + // com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + enableSecureBoot_ = false; + enableVtpm_ = false; + enableIntegrityMonitoring_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_GceInstance_GceShieldedInstanceConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig + getDefaultInstanceForType() { + return com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig + build() { + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig + buildPartial() { + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig + result = + new com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig + result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.enableSecureBoot_ = enableSecureBoot_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.enableVtpm_ = enableVtpm_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.enableIntegrityMonitoring_ = enableIntegrityMonitoring_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig) { + return mergeFrom( + (com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig + other) { + if (other + == com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig.getDefaultInstance()) return this; + if (other.getEnableSecureBoot() != false) { + setEnableSecureBoot(other.getEnableSecureBoot()); + } + if (other.getEnableVtpm() != false) { + setEnableVtpm(other.getEnableVtpm()); + } + if (other.getEnableIntegrityMonitoring() != false) { + setEnableIntegrityMonitoring(other.getEnableIntegrityMonitoring()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + enableSecureBoot_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + enableVtpm_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + enableIntegrityMonitoring_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private boolean enableSecureBoot_; + /** + * + * + *
+           * Whether the instance has Secure Boot enabled.
+           * 
+ * + * bool enable_secure_boot = 1; + * + * @return The enableSecureBoot. + */ + @java.lang.Override + public boolean getEnableSecureBoot() { + return enableSecureBoot_; + } + /** + * + * + *
+           * Whether the instance has Secure Boot enabled.
+           * 
+ * + * bool enable_secure_boot = 1; + * + * @param value The enableSecureBoot to set. + * @return This builder for chaining. + */ + public Builder setEnableSecureBoot(boolean value) { + + enableSecureBoot_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+           * Whether the instance has Secure Boot enabled.
+           * 
+ * + * bool enable_secure_boot = 1; + * + * @return This builder for chaining. + */ + public Builder clearEnableSecureBoot() { + bitField0_ = (bitField0_ & ~0x00000001); + enableSecureBoot_ = false; + onChanged(); + return this; + } + + private boolean enableVtpm_; + /** + * + * + *
+           * Whether the instance has the vTPM enabled.
+           * 
+ * + * bool enable_vtpm = 2; + * + * @return The enableVtpm. + */ + @java.lang.Override + public boolean getEnableVtpm() { + return enableVtpm_; + } + /** + * + * + *
+           * Whether the instance has the vTPM enabled.
+           * 
+ * + * bool enable_vtpm = 2; + * + * @param value The enableVtpm to set. + * @return This builder for chaining. + */ + public Builder setEnableVtpm(boolean value) { + + enableVtpm_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+           * Whether the instance has the vTPM enabled.
+           * 
+ * + * bool enable_vtpm = 2; + * + * @return This builder for chaining. + */ + public Builder clearEnableVtpm() { + bitField0_ = (bitField0_ & ~0x00000002); + enableVtpm_ = false; + onChanged(); + return this; + } + + private boolean enableIntegrityMonitoring_; + /** + * + * + *
+           * Whether the instance has integrity monitoring enabled.
+           * 
+ * + * bool enable_integrity_monitoring = 3; + * + * @return The enableIntegrityMonitoring. + */ + @java.lang.Override + public boolean getEnableIntegrityMonitoring() { + return enableIntegrityMonitoring_; + } + /** + * + * + *
+           * Whether the instance has integrity monitoring enabled.
+           * 
+ * + * bool enable_integrity_monitoring = 3; + * + * @param value The enableIntegrityMonitoring to set. + * @return This builder for chaining. + */ + public Builder setEnableIntegrityMonitoring(boolean value) { + + enableIntegrityMonitoring_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+           * Whether the instance has integrity monitoring enabled.
+           * 
+ * + * bool enable_integrity_monitoring = 3; + * + * @return This builder for chaining. + */ + public Builder clearEnableIntegrityMonitoring() { + bitField0_ = (bitField0_ & ~0x00000004); + enableIntegrityMonitoring_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig) + private static final com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig(); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GceShieldedInstanceConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface GceConfidentialInstanceConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+         * Whether the instance has confidential compute enabled.
+         * 
+ * + * bool enable_confidential_compute = 1; + * + * @return The enableConfidentialCompute. + */ + boolean getEnableConfidentialCompute(); + } + /** + * + * + *
+       * A set of Compute Engine Confidential VM instance options.
+       * 
+ * + * Protobuf type {@code + * google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig} + */ + public static final class GceConfidentialInstanceConfig + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig) + GceConfidentialInstanceConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use GceConfidentialInstanceConfig.newBuilder() to construct. + private GceConfidentialInstanceConfig( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GceConfidentialInstanceConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GceConfidentialInstanceConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_GceInstance_GceConfidentialInstanceConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_GceInstance_GceConfidentialInstanceConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig.class, + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig.Builder.class); + } + + public static final int ENABLE_CONFIDENTIAL_COMPUTE_FIELD_NUMBER = 1; + private boolean enableConfidentialCompute_ = false; + /** + * + * + *
+         * Whether the instance has confidential compute enabled.
+         * 
+ * + * bool enable_confidential_compute = 1; + * + * @return The enableConfidentialCompute. + */ + @java.lang.Override + public boolean getEnableConfidentialCompute() { + return enableConfidentialCompute_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (enableConfidentialCompute_ != false) { + output.writeBool(1, enableConfidentialCompute_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (enableConfidentialCompute_ != false) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize( + 1, enableConfidentialCompute_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig)) { + return super.equals(obj); + } + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig + other = + (com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig) + obj; + + if (getEnableConfidentialCompute() != other.getEnableConfidentialCompute()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ENABLE_CONFIDENTIAL_COMPUTE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashBoolean(getEnableConfidentialCompute()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig + parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+         * A set of Compute Engine Confidential VM instance options.
+         * 
+ * + * Protobuf type {@code + * google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig) + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_GceInstance_GceConfidentialInstanceConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_GceInstance_GceConfidentialInstanceConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig.class, + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig.Builder.class); + } + + // Construct using + // com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + enableConfidentialCompute_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_GceInstance_GceConfidentialInstanceConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig + getDefaultInstanceForType() { + return com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig + build() { + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig + buildPartial() { + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig + result = + new com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig + result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.enableConfidentialCompute_ = enableConfidentialCompute_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig) { + return mergeFrom( + (com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig + other) { + if (other + == com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig.getDefaultInstance()) return this; + if (other.getEnableConfidentialCompute() != false) { + setEnableConfidentialCompute(other.getEnableConfidentialCompute()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + enableConfidentialCompute_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private boolean enableConfidentialCompute_; + /** + * + * + *
+           * Whether the instance has confidential compute enabled.
+           * 
+ * + * bool enable_confidential_compute = 1; + * + * @return The enableConfidentialCompute. + */ + @java.lang.Override + public boolean getEnableConfidentialCompute() { + return enableConfidentialCompute_; + } + /** + * + * + *
+           * Whether the instance has confidential compute enabled.
+           * 
+ * + * bool enable_confidential_compute = 1; + * + * @param value The enableConfidentialCompute to set. + * @return This builder for chaining. + */ + public Builder setEnableConfidentialCompute(boolean value) { + + enableConfidentialCompute_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+           * Whether the instance has confidential compute enabled.
+           * 
+ * + * bool enable_confidential_compute = 1; + * + * @return This builder for chaining. + */ + public Builder clearEnableConfidentialCompute() { + bitField0_ = (bitField0_ & ~0x00000001); + enableConfidentialCompute_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig) + private static final com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig(); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GceConfidentialInstanceConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int MACHINE_TYPE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object machineType_ = ""; + /** + * + * + *
+       * The name of a Compute Engine machine type.
+       * 
+ * + * string machine_type = 1; + * + * @return The machineType. + */ + @java.lang.Override + public java.lang.String getMachineType() { + java.lang.Object ref = machineType_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + machineType_ = s; + return s; + } + } + /** + * + * + *
+       * The name of a Compute Engine machine type.
+       * 
+ * + * string machine_type = 1; + * + * @return The bytes for machineType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMachineTypeBytes() { + java.lang.Object ref = machineType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + machineType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_ACCOUNT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object serviceAccount_ = ""; + /** + * + * + *
+       * Email address of the service account that will be used on VM instances
+       * used to support this config. This service account must have permission
+       * to pull the specified container image. If not set, VMs will run without
+       * a service account, in which case the image must be publicly accessible.
+       * 
+ * + * string service_account = 2; + * + * @return The serviceAccount. + */ + @java.lang.Override + public java.lang.String getServiceAccount() { + java.lang.Object ref = serviceAccount_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAccount_ = s; + return s; + } + } + /** + * + * + *
+       * Email address of the service account that will be used on VM instances
+       * used to support this config. This service account must have permission
+       * to pull the specified container image. If not set, VMs will run without
+       * a service account, in which case the image must be publicly accessible.
+       * 
+ * + * string service_account = 2; + * + * @return The bytes for serviceAccount. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceAccountBytes() { + java.lang.Object ref = serviceAccount_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAccount_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TAGS_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringList tags_; + /** + * + * + *
+       * Network tags to add to the Compute Engine machines backing the
+       * Workstations.
+       * 
+ * + * repeated string tags = 4; + * + * @return A list containing the tags. + */ + public com.google.protobuf.ProtocolStringList getTagsList() { + return tags_; + } + /** + * + * + *
+       * Network tags to add to the Compute Engine machines backing the
+       * Workstations.
+       * 
+ * + * repeated string tags = 4; + * + * @return The count of tags. + */ + public int getTagsCount() { + return tags_.size(); + } + /** + * + * + *
+       * Network tags to add to the Compute Engine machines backing the
+       * Workstations.
+       * 
+ * + * repeated string tags = 4; + * + * @param index The index of the element to return. + * @return The tags at the given index. + */ + public java.lang.String getTags(int index) { + return tags_.get(index); + } + /** + * + * + *
+       * Network tags to add to the Compute Engine machines backing the
+       * Workstations.
+       * 
+ * + * repeated string tags = 4; + * + * @param index The index of the value to return. + * @return The bytes of the tags at the given index. + */ + public com.google.protobuf.ByteString getTagsBytes(int index) { + return tags_.getByteString(index); + } + + public static final int POOL_SIZE_FIELD_NUMBER = 5; + private int poolSize_ = 0; + /** + * + * + *
+       * Number of instances to pool for faster workstation starup.
+       * 
+ * + * int32 pool_size = 5; + * + * @return The poolSize. + */ + @java.lang.Override + public int getPoolSize() { + return poolSize_; + } + + public static final int DISABLE_PUBLIC_IP_ADDRESSES_FIELD_NUMBER = 6; + private boolean disablePublicIpAddresses_ = false; + /** + * + * + *
+       * Whether instances have no public IP address.
+       * 
+ * + * bool disable_public_ip_addresses = 6; + * + * @return The disablePublicIpAddresses. + */ + @java.lang.Override + public boolean getDisablePublicIpAddresses() { + return disablePublicIpAddresses_; + } + + public static final int SHIELDED_INSTANCE_CONFIG_FIELD_NUMBER = 8; + private com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig + shieldedInstanceConfig_; + /** + * + * + *
+       * A set of Compute Engine Shielded instance options.
+       * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig shielded_instance_config = 8; + * + * + * @return Whether the shieldedInstanceConfig field is set. + */ + @java.lang.Override + public boolean hasShieldedInstanceConfig() { + return shieldedInstanceConfig_ != null; + } + /** + * + * + *
+       * A set of Compute Engine Shielded instance options.
+       * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig shielded_instance_config = 8; + * + * + * @return The shieldedInstanceConfig. + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig + getShieldedInstanceConfig() { + return shieldedInstanceConfig_ == null + ? com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig.getDefaultInstance() + : shieldedInstanceConfig_; + } + /** + * + * + *
+       * A set of Compute Engine Shielded instance options.
+       * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig shielded_instance_config = 8; + * + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfigOrBuilder + getShieldedInstanceConfigOrBuilder() { + return shieldedInstanceConfig_ == null + ? com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig.getDefaultInstance() + : shieldedInstanceConfig_; + } + + public static final int CONFIDENTIAL_INSTANCE_CONFIG_FIELD_NUMBER = 10; + private com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig + confidentialInstanceConfig_; + /** + * + * + *
+       * A set of Compute Engine Confidential VM instance options.
+       * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig confidential_instance_config = 10; + * + * + * @return Whether the confidentialInstanceConfig field is set. + */ + @java.lang.Override + public boolean hasConfidentialInstanceConfig() { + return confidentialInstanceConfig_ != null; + } + /** + * + * + *
+       * A set of Compute Engine Confidential VM instance options.
+       * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig confidential_instance_config = 10; + * + * + * @return The confidentialInstanceConfig. + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig + getConfidentialInstanceConfig() { + return confidentialInstanceConfig_ == null + ? com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig.getDefaultInstance() + : confidentialInstanceConfig_; + } + /** + * + * + *
+       * A set of Compute Engine Confidential VM instance options.
+       * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig confidential_instance_config = 10; + * + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfigOrBuilder + getConfidentialInstanceConfigOrBuilder() { + return confidentialInstanceConfig_ == null + ? com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig.getDefaultInstance() + : confidentialInstanceConfig_; + } + + public static final int BOOT_DISK_SIZE_GB_FIELD_NUMBER = 9; + private int bootDiskSizeGb_ = 0; + /** + * + * + *
+       * Size of the boot disk in GB.
+       * 
+ * + * int32 boot_disk_size_gb = 9; + * + * @return The bootDiskSizeGb. + */ + @java.lang.Override + public int getBootDiskSizeGb() { + return bootDiskSizeGb_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(machineType_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, machineType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccount_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, serviceAccount_); + } + for (int i = 0; i < tags_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, tags_.getRaw(i)); + } + if (poolSize_ != 0) { + output.writeInt32(5, poolSize_); + } + if (disablePublicIpAddresses_ != false) { + output.writeBool(6, disablePublicIpAddresses_); + } + if (shieldedInstanceConfig_ != null) { + output.writeMessage(8, getShieldedInstanceConfig()); + } + if (bootDiskSizeGb_ != 0) { + output.writeInt32(9, bootDiskSizeGb_); + } + if (confidentialInstanceConfig_ != null) { + output.writeMessage(10, getConfidentialInstanceConfig()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(machineType_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, machineType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccount_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, serviceAccount_); + } + { + int dataSize = 0; + for (int i = 0; i < tags_.size(); i++) { + dataSize += computeStringSizeNoTag(tags_.getRaw(i)); + } + size += dataSize; + size += 1 * getTagsList().size(); + } + if (poolSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, poolSize_); + } + if (disablePublicIpAddresses_ != false) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize(6, disablePublicIpAddresses_); + } + if (shieldedInstanceConfig_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, getShieldedInstanceConfig()); + } + if (bootDiskSizeGb_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(9, bootDiskSizeGb_); + } + if (confidentialInstanceConfig_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 10, getConfidentialInstanceConfig()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance)) { + return super.equals(obj); + } + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance other = + (com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance) obj; + + if (!getMachineType().equals(other.getMachineType())) return false; + if (!getServiceAccount().equals(other.getServiceAccount())) return false; + if (!getTagsList().equals(other.getTagsList())) return false; + if (getPoolSize() != other.getPoolSize()) return false; + if (getDisablePublicIpAddresses() != other.getDisablePublicIpAddresses()) return false; + if (hasShieldedInstanceConfig() != other.hasShieldedInstanceConfig()) return false; + if (hasShieldedInstanceConfig()) { + if (!getShieldedInstanceConfig().equals(other.getShieldedInstanceConfig())) return false; + } + if (hasConfidentialInstanceConfig() != other.hasConfidentialInstanceConfig()) return false; + if (hasConfidentialInstanceConfig()) { + if (!getConfidentialInstanceConfig().equals(other.getConfidentialInstanceConfig())) + return false; + } + if (getBootDiskSizeGb() != other.getBootDiskSizeGb()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MACHINE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getMachineType().hashCode(); + hash = (37 * hash) + SERVICE_ACCOUNT_FIELD_NUMBER; + hash = (53 * hash) + getServiceAccount().hashCode(); + if (getTagsCount() > 0) { + hash = (37 * hash) + TAGS_FIELD_NUMBER; + hash = (53 * hash) + getTagsList().hashCode(); + } + hash = (37 * hash) + POOL_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPoolSize(); + hash = (37 * hash) + DISABLE_PUBLIC_IP_ADDRESSES_FIELD_NUMBER; + hash = + (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDisablePublicIpAddresses()); + if (hasShieldedInstanceConfig()) { + hash = (37 * hash) + SHIELDED_INSTANCE_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getShieldedInstanceConfig().hashCode(); + } + if (hasConfidentialInstanceConfig()) { + hash = (37 * hash) + CONFIDENTIAL_INSTANCE_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getConfidentialInstanceConfig().hashCode(); + } + hash = (37 * hash) + BOOT_DISK_SIZE_GB_FIELD_NUMBER; + hash = (53 * hash) + getBootDiskSizeGb(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+       * A runtime using a Compute Engine instance.
+       * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance) + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstanceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_GceInstance_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_GceInstance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.class, + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.Builder + .class); + } + + // Construct using + // com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + machineType_ = ""; + serviceAccount_ = ""; + tags_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + poolSize_ = 0; + disablePublicIpAddresses_ = false; + shieldedInstanceConfig_ = null; + if (shieldedInstanceConfigBuilder_ != null) { + shieldedInstanceConfigBuilder_.dispose(); + shieldedInstanceConfigBuilder_ = null; + } + confidentialInstanceConfig_ = null; + if (confidentialInstanceConfigBuilder_ != null) { + confidentialInstanceConfigBuilder_.dispose(); + confidentialInstanceConfigBuilder_ = null; + } + bootDiskSizeGb_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_GceInstance_descriptor; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + getDefaultInstanceForType() { + return com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance build() { + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + buildPartial() { + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance result = + new com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance result) { + if (((bitField0_ & 0x00000004) != 0)) { + tags_ = tags_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.tags_ = tags_; + } + + private void buildPartial0( + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.machineType_ = machineType_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.serviceAccount_ = serviceAccount_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.poolSize_ = poolSize_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.disablePublicIpAddresses_ = disablePublicIpAddresses_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.shieldedInstanceConfig_ = + shieldedInstanceConfigBuilder_ == null + ? shieldedInstanceConfig_ + : shieldedInstanceConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.confidentialInstanceConfig_ = + confidentialInstanceConfigBuilder_ == null + ? confidentialInstanceConfig_ + : confidentialInstanceConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.bootDiskSizeGb_ = bootDiskSizeGb_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance) { + return mergeFrom( + (com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance other) { + if (other + == com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .getDefaultInstance()) return this; + if (!other.getMachineType().isEmpty()) { + machineType_ = other.machineType_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getServiceAccount().isEmpty()) { + serviceAccount_ = other.serviceAccount_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.tags_.isEmpty()) { + if (tags_.isEmpty()) { + tags_ = other.tags_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureTagsIsMutable(); + tags_.addAll(other.tags_); + } + onChanged(); + } + if (other.getPoolSize() != 0) { + setPoolSize(other.getPoolSize()); + } + if (other.getDisablePublicIpAddresses() != false) { + setDisablePublicIpAddresses(other.getDisablePublicIpAddresses()); + } + if (other.hasShieldedInstanceConfig()) { + mergeShieldedInstanceConfig(other.getShieldedInstanceConfig()); + } + if (other.hasConfidentialInstanceConfig()) { + mergeConfidentialInstanceConfig(other.getConfidentialInstanceConfig()); + } + if (other.getBootDiskSizeGb() != 0) { + setBootDiskSizeGb(other.getBootDiskSizeGb()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + machineType_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + serviceAccount_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureTagsIsMutable(); + tags_.add(s); + break; + } // case 34 + case 40: + { + poolSize_ = input.readInt32(); + bitField0_ |= 0x00000008; + break; + } // case 40 + case 48: + { + disablePublicIpAddresses_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 48 + case 66: + { + input.readMessage( + getShieldedInstanceConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 66 + case 72: + { + bootDiskSizeGb_ = input.readInt32(); + bitField0_ |= 0x00000080; + break; + } // case 72 + case 82: + { + input.readMessage( + getConfidentialInstanceConfigFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 82 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object machineType_ = ""; + /** + * + * + *
+         * The name of a Compute Engine machine type.
+         * 
+ * + * string machine_type = 1; + * + * @return The machineType. + */ + public java.lang.String getMachineType() { + java.lang.Object ref = machineType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + machineType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * The name of a Compute Engine machine type.
+         * 
+ * + * string machine_type = 1; + * + * @return The bytes for machineType. + */ + public com.google.protobuf.ByteString getMachineTypeBytes() { + java.lang.Object ref = machineType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + machineType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * The name of a Compute Engine machine type.
+         * 
+ * + * string machine_type = 1; + * + * @param value The machineType to set. + * @return This builder for chaining. + */ + public Builder setMachineType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + machineType_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * The name of a Compute Engine machine type.
+         * 
+ * + * string machine_type = 1; + * + * @return This builder for chaining. + */ + public Builder clearMachineType() { + machineType_ = getDefaultInstance().getMachineType(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+         * The name of a Compute Engine machine type.
+         * 
+ * + * string machine_type = 1; + * + * @param value The bytes for machineType to set. + * @return This builder for chaining. + */ + public Builder setMachineTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + machineType_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object serviceAccount_ = ""; + /** + * + * + *
+         * Email address of the service account that will be used on VM instances
+         * used to support this config. This service account must have permission
+         * to pull the specified container image. If not set, VMs will run without
+         * a service account, in which case the image must be publicly accessible.
+         * 
+ * + * string service_account = 2; + * + * @return The serviceAccount. + */ + public java.lang.String getServiceAccount() { + java.lang.Object ref = serviceAccount_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAccount_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * Email address of the service account that will be used on VM instances
+         * used to support this config. This service account must have permission
+         * to pull the specified container image. If not set, VMs will run without
+         * a service account, in which case the image must be publicly accessible.
+         * 
+ * + * string service_account = 2; + * + * @return The bytes for serviceAccount. + */ + public com.google.protobuf.ByteString getServiceAccountBytes() { + java.lang.Object ref = serviceAccount_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAccount_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * Email address of the service account that will be used on VM instances
+         * used to support this config. This service account must have permission
+         * to pull the specified container image. If not set, VMs will run without
+         * a service account, in which case the image must be publicly accessible.
+         * 
+ * + * string service_account = 2; + * + * @param value The serviceAccount to set. + * @return This builder for chaining. + */ + public Builder setServiceAccount(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + serviceAccount_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+         * Email address of the service account that will be used on VM instances
+         * used to support this config. This service account must have permission
+         * to pull the specified container image. If not set, VMs will run without
+         * a service account, in which case the image must be publicly accessible.
+         * 
+ * + * string service_account = 2; + * + * @return This builder for chaining. + */ + public Builder clearServiceAccount() { + serviceAccount_ = getDefaultInstance().getServiceAccount(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+         * Email address of the service account that will be used on VM instances
+         * used to support this config. This service account must have permission
+         * to pull the specified container image. If not set, VMs will run without
+         * a service account, in which case the image must be publicly accessible.
+         * 
+ * + * string service_account = 2; + * + * @param value The bytes for serviceAccount to set. + * @return This builder for chaining. + */ + public Builder setServiceAccountBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + serviceAccount_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList tags_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureTagsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + tags_ = new com.google.protobuf.LazyStringArrayList(tags_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+         * Network tags to add to the Compute Engine machines backing the
+         * Workstations.
+         * 
+ * + * repeated string tags = 4; + * + * @return A list containing the tags. + */ + public com.google.protobuf.ProtocolStringList getTagsList() { + return tags_.getUnmodifiableView(); + } + /** + * + * + *
+         * Network tags to add to the Compute Engine machines backing the
+         * Workstations.
+         * 
+ * + * repeated string tags = 4; + * + * @return The count of tags. + */ + public int getTagsCount() { + return tags_.size(); + } + /** + * + * + *
+         * Network tags to add to the Compute Engine machines backing the
+         * Workstations.
+         * 
+ * + * repeated string tags = 4; + * + * @param index The index of the element to return. + * @return The tags at the given index. + */ + public java.lang.String getTags(int index) { + return tags_.get(index); + } + /** + * + * + *
+         * Network tags to add to the Compute Engine machines backing the
+         * Workstations.
+         * 
+ * + * repeated string tags = 4; + * + * @param index The index of the value to return. + * @return The bytes of the tags at the given index. + */ + public com.google.protobuf.ByteString getTagsBytes(int index) { + return tags_.getByteString(index); + } + /** + * + * + *
+         * Network tags to add to the Compute Engine machines backing the
+         * Workstations.
+         * 
+ * + * repeated string tags = 4; + * + * @param index The index to set the value at. + * @param value The tags to set. + * @return This builder for chaining. + */ + public Builder setTags(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTagsIsMutable(); + tags_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+         * Network tags to add to the Compute Engine machines backing the
+         * Workstations.
+         * 
+ * + * repeated string tags = 4; + * + * @param value The tags to add. + * @return This builder for chaining. + */ + public Builder addTags(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTagsIsMutable(); + tags_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+         * Network tags to add to the Compute Engine machines backing the
+         * Workstations.
+         * 
+ * + * repeated string tags = 4; + * + * @param values The tags to add. + * @return This builder for chaining. + */ + public Builder addAllTags(java.lang.Iterable values) { + ensureTagsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, tags_); + onChanged(); + return this; + } + /** + * + * + *
+         * Network tags to add to the Compute Engine machines backing the
+         * Workstations.
+         * 
+ * + * repeated string tags = 4; + * + * @return This builder for chaining. + */ + public Builder clearTags() { + tags_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+         * Network tags to add to the Compute Engine machines backing the
+         * Workstations.
+         * 
+ * + * repeated string tags = 4; + * + * @param value The bytes of the tags to add. + * @return This builder for chaining. + */ + public Builder addTagsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureTagsIsMutable(); + tags_.add(value); + onChanged(); + return this; + } + + private int poolSize_; + /** + * + * + *
+         * Number of instances to pool for faster workstation starup.
+         * 
+ * + * int32 pool_size = 5; + * + * @return The poolSize. + */ + @java.lang.Override + public int getPoolSize() { + return poolSize_; + } + /** + * + * + *
+         * Number of instances to pool for faster workstation starup.
+         * 
+ * + * int32 pool_size = 5; + * + * @param value The poolSize to set. + * @return This builder for chaining. + */ + public Builder setPoolSize(int value) { + + poolSize_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+         * Number of instances to pool for faster workstation starup.
+         * 
+ * + * int32 pool_size = 5; + * + * @return This builder for chaining. + */ + public Builder clearPoolSize() { + bitField0_ = (bitField0_ & ~0x00000008); + poolSize_ = 0; + onChanged(); + return this; + } + + private boolean disablePublicIpAddresses_; + /** + * + * + *
+         * Whether instances have no public IP address.
+         * 
+ * + * bool disable_public_ip_addresses = 6; + * + * @return The disablePublicIpAddresses. + */ + @java.lang.Override + public boolean getDisablePublicIpAddresses() { + return disablePublicIpAddresses_; + } + /** + * + * + *
+         * Whether instances have no public IP address.
+         * 
+ * + * bool disable_public_ip_addresses = 6; + * + * @param value The disablePublicIpAddresses to set. + * @return This builder for chaining. + */ + public Builder setDisablePublicIpAddresses(boolean value) { + + disablePublicIpAddresses_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+         * Whether instances have no public IP address.
+         * 
+ * + * bool disable_public_ip_addresses = 6; + * + * @return This builder for chaining. + */ + public Builder clearDisablePublicIpAddresses() { + bitField0_ = (bitField0_ & ~0x00000010); + disablePublicIpAddresses_ = false; + onChanged(); + return this; + } + + private com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig + shieldedInstanceConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig, + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig.Builder, + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfigOrBuilder> + shieldedInstanceConfigBuilder_; + /** + * + * + *
+         * A set of Compute Engine Shielded instance options.
+         * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig shielded_instance_config = 8; + * + * + * @return Whether the shieldedInstanceConfig field is set. + */ + public boolean hasShieldedInstanceConfig() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+         * A set of Compute Engine Shielded instance options.
+         * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig shielded_instance_config = 8; + * + * + * @return The shieldedInstanceConfig. + */ + public com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig + getShieldedInstanceConfig() { + if (shieldedInstanceConfigBuilder_ == null) { + return shieldedInstanceConfig_ == null + ? com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig.getDefaultInstance() + : shieldedInstanceConfig_; + } else { + return shieldedInstanceConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+         * A set of Compute Engine Shielded instance options.
+         * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig shielded_instance_config = 8; + * + */ + public Builder setShieldedInstanceConfig( + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig + value) { + if (shieldedInstanceConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + shieldedInstanceConfig_ = value; + } else { + shieldedInstanceConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+         * A set of Compute Engine Shielded instance options.
+         * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig shielded_instance_config = 8; + * + */ + public Builder setShieldedInstanceConfig( + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig.Builder + builderForValue) { + if (shieldedInstanceConfigBuilder_ == null) { + shieldedInstanceConfig_ = builderForValue.build(); + } else { + shieldedInstanceConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+         * A set of Compute Engine Shielded instance options.
+         * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig shielded_instance_config = 8; + * + */ + public Builder mergeShieldedInstanceConfig( + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig + value) { + if (shieldedInstanceConfigBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && shieldedInstanceConfig_ != null + && shieldedInstanceConfig_ + != com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig.getDefaultInstance()) { + getShieldedInstanceConfigBuilder().mergeFrom(value); + } else { + shieldedInstanceConfig_ = value; + } + } else { + shieldedInstanceConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+         * A set of Compute Engine Shielded instance options.
+         * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig shielded_instance_config = 8; + * + */ + public Builder clearShieldedInstanceConfig() { + bitField0_ = (bitField0_ & ~0x00000020); + shieldedInstanceConfig_ = null; + if (shieldedInstanceConfigBuilder_ != null) { + shieldedInstanceConfigBuilder_.dispose(); + shieldedInstanceConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+         * A set of Compute Engine Shielded instance options.
+         * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig shielded_instance_config = 8; + * + */ + public com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig.Builder + getShieldedInstanceConfigBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getShieldedInstanceConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+         * A set of Compute Engine Shielded instance options.
+         * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig shielded_instance_config = 8; + * + */ + public com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfigOrBuilder + getShieldedInstanceConfigOrBuilder() { + if (shieldedInstanceConfigBuilder_ != null) { + return shieldedInstanceConfigBuilder_.getMessageOrBuilder(); + } else { + return shieldedInstanceConfig_ == null + ? com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig.getDefaultInstance() + : shieldedInstanceConfig_; + } + } + /** + * + * + *
+         * A set of Compute Engine Shielded instance options.
+         * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig shielded_instance_config = 8; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig, + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig.Builder, + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfigOrBuilder> + getShieldedInstanceConfigFieldBuilder() { + if (shieldedInstanceConfigBuilder_ == null) { + shieldedInstanceConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig, + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfig.Builder, + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceShieldedInstanceConfigOrBuilder>( + getShieldedInstanceConfig(), getParentForChildren(), isClean()); + shieldedInstanceConfig_ = null; + } + return shieldedInstanceConfigBuilder_; + } + + private com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig + confidentialInstanceConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig, + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig.Builder, + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfigOrBuilder> + confidentialInstanceConfigBuilder_; + /** + * + * + *
+         * A set of Compute Engine Confidential VM instance options.
+         * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig confidential_instance_config = 10; + * + * + * @return Whether the confidentialInstanceConfig field is set. + */ + public boolean hasConfidentialInstanceConfig() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+         * A set of Compute Engine Confidential VM instance options.
+         * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig confidential_instance_config = 10; + * + * + * @return The confidentialInstanceConfig. + */ + public com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig + getConfidentialInstanceConfig() { + if (confidentialInstanceConfigBuilder_ == null) { + return confidentialInstanceConfig_ == null + ? com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig.getDefaultInstance() + : confidentialInstanceConfig_; + } else { + return confidentialInstanceConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+         * A set of Compute Engine Confidential VM instance options.
+         * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig confidential_instance_config = 10; + * + */ + public Builder setConfidentialInstanceConfig( + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig + value) { + if (confidentialInstanceConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + confidentialInstanceConfig_ = value; + } else { + confidentialInstanceConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+         * A set of Compute Engine Confidential VM instance options.
+         * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig confidential_instance_config = 10; + * + */ + public Builder setConfidentialInstanceConfig( + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig.Builder + builderForValue) { + if (confidentialInstanceConfigBuilder_ == null) { + confidentialInstanceConfig_ = builderForValue.build(); + } else { + confidentialInstanceConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+         * A set of Compute Engine Confidential VM instance options.
+         * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig confidential_instance_config = 10; + * + */ + public Builder mergeConfidentialInstanceConfig( + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig + value) { + if (confidentialInstanceConfigBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && confidentialInstanceConfig_ != null + && confidentialInstanceConfig_ + != com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig.getDefaultInstance()) { + getConfidentialInstanceConfigBuilder().mergeFrom(value); + } else { + confidentialInstanceConfig_ = value; + } + } else { + confidentialInstanceConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+         * A set of Compute Engine Confidential VM instance options.
+         * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig confidential_instance_config = 10; + * + */ + public Builder clearConfidentialInstanceConfig() { + bitField0_ = (bitField0_ & ~0x00000040); + confidentialInstanceConfig_ = null; + if (confidentialInstanceConfigBuilder_ != null) { + confidentialInstanceConfigBuilder_.dispose(); + confidentialInstanceConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+         * A set of Compute Engine Confidential VM instance options.
+         * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig confidential_instance_config = 10; + * + */ + public com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig.Builder + getConfidentialInstanceConfigBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getConfidentialInstanceConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+         * A set of Compute Engine Confidential VM instance options.
+         * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig confidential_instance_config = 10; + * + */ + public com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfigOrBuilder + getConfidentialInstanceConfigOrBuilder() { + if (confidentialInstanceConfigBuilder_ != null) { + return confidentialInstanceConfigBuilder_.getMessageOrBuilder(); + } else { + return confidentialInstanceConfig_ == null + ? com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig.getDefaultInstance() + : confidentialInstanceConfig_; + } + } + /** + * + * + *
+         * A set of Compute Engine Confidential VM instance options.
+         * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig confidential_instance_config = 10; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig, + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig.Builder, + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfigOrBuilder> + getConfidentialInstanceConfigFieldBuilder() { + if (confidentialInstanceConfigBuilder_ == null) { + confidentialInstanceConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig, + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfig.Builder, + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .GceConfidentialInstanceConfigOrBuilder>( + getConfidentialInstanceConfig(), getParentForChildren(), isClean()); + confidentialInstanceConfig_ = null; + } + return confidentialInstanceConfigBuilder_; + } + + private int bootDiskSizeGb_; + /** + * + * + *
+         * Size of the boot disk in GB.
+         * 
+ * + * int32 boot_disk_size_gb = 9; + * + * @return The bootDiskSizeGb. + */ + @java.lang.Override + public int getBootDiskSizeGb() { + return bootDiskSizeGb_; + } + /** + * + * + *
+         * Size of the boot disk in GB.
+         * 
+ * + * int32 boot_disk_size_gb = 9; + * + * @param value The bootDiskSizeGb to set. + * @return This builder for chaining. + */ + public Builder setBootDiskSizeGb(int value) { + + bootDiskSizeGb_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+         * Size of the boot disk in GB.
+         * 
+ * + * int32 boot_disk_size_gb = 9; + * + * @return This builder for chaining. + */ + public Builder clearBootDiskSizeGb() { + bitField0_ = (bitField0_ & ~0x00000080); + bootDiskSizeGb_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance) + private static final com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance(); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GceInstance parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int configCase_ = 0; + private java.lang.Object config_; + + public enum ConfigCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + GCE_INSTANCE(1), + CONFIG_NOT_SET(0); + private final int value; + + private ConfigCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ConfigCase valueOf(int value) { + return forNumber(value); + } + + public static ConfigCase forNumber(int value) { + switch (value) { + case 1: + return GCE_INSTANCE; + case 0: + return CONFIG_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ConfigCase getConfigCase() { + return ConfigCase.forNumber(configCase_); + } + + public static final int GCE_INSTANCE_FIELD_NUMBER = 1; + /** + * + * + *
+     * Specifies a Compute Engine instance as the host.
+     * 
+ * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance gce_instance = 1; + * + * + * @return Whether the gceInstance field is set. + */ + @java.lang.Override + public boolean hasGceInstance() { + return configCase_ == 1; + } + /** + * + * + *
+     * Specifies a Compute Engine instance as the host.
+     * 
+ * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance gce_instance = 1; + * + * + * @return The gceInstance. + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + getGceInstance() { + if (configCase_ == 1) { + return (com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance) config_; + } + return com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .getDefaultInstance(); + } + /** + * + * + *
+     * Specifies a Compute Engine instance as the host.
+     * 
+ * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance gce_instance = 1; + * + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstanceOrBuilder + getGceInstanceOrBuilder() { + if (configCase_ == 1) { + return (com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance) config_; + } + return com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (configCase_ == 1) { + output.writeMessage( + 1, (com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance) config_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (configCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, + (com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance) config_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workstations.v1beta.WorkstationConfig.Host)) { + return super.equals(obj); + } + com.google.cloud.workstations.v1beta.WorkstationConfig.Host other = + (com.google.cloud.workstations.v1beta.WorkstationConfig.Host) obj; + + if (!getConfigCase().equals(other.getConfigCase())) return false; + switch (configCase_) { + case 1: + if (!getGceInstance().equals(other.getGceInstance())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (configCase_) { + case 1: + hash = (37 * hash) + GCE_INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getGceInstance().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workstations.v1beta.WorkstationConfig.Host prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Runtime host for a workstation.
+     * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.WorkstationConfig.Host} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workstations.v1beta.WorkstationConfig.Host) + com.google.cloud.workstations.v1beta.WorkstationConfig.HostOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.class, + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.Builder.class); + } + + // Construct using com.google.cloud.workstations.v1beta.WorkstationConfig.Host.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (gceInstanceBuilder_ != null) { + gceInstanceBuilder_.clear(); + } + configCase_ = 0; + config_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_descriptor; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.Host + getDefaultInstanceForType() { + return com.google.cloud.workstations.v1beta.WorkstationConfig.Host.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.Host build() { + com.google.cloud.workstations.v1beta.WorkstationConfig.Host result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.Host buildPartial() { + com.google.cloud.workstations.v1beta.WorkstationConfig.Host result = + new com.google.cloud.workstations.v1beta.WorkstationConfig.Host(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.workstations.v1beta.WorkstationConfig.Host result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs( + com.google.cloud.workstations.v1beta.WorkstationConfig.Host result) { + result.configCase_ = configCase_; + result.config_ = this.config_; + if (configCase_ == 1 && gceInstanceBuilder_ != null) { + result.config_ = gceInstanceBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workstations.v1beta.WorkstationConfig.Host) { + return mergeFrom((com.google.cloud.workstations.v1beta.WorkstationConfig.Host) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.workstations.v1beta.WorkstationConfig.Host other) { + if (other + == com.google.cloud.workstations.v1beta.WorkstationConfig.Host.getDefaultInstance()) + return this; + switch (other.getConfigCase()) { + case GCE_INSTANCE: + { + mergeGceInstance(other.getGceInstance()); + break; + } + case CONFIG_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getGceInstanceFieldBuilder().getBuilder(), extensionRegistry); + configCase_ = 1; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int configCase_ = 0; + private java.lang.Object config_; + + public ConfigCase getConfigCase() { + return ConfigCase.forNumber(configCase_); + } + + public Builder clearConfig() { + configCase_ = 0; + config_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance, + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.Builder, + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstanceOrBuilder> + gceInstanceBuilder_; + /** + * + * + *
+       * Specifies a Compute Engine instance as the host.
+       * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance gce_instance = 1; + * + * + * @return Whether the gceInstance field is set. + */ + @java.lang.Override + public boolean hasGceInstance() { + return configCase_ == 1; + } + /** + * + * + *
+       * Specifies a Compute Engine instance as the host.
+       * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance gce_instance = 1; + * + * + * @return The gceInstance. + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + getGceInstance() { + if (gceInstanceBuilder_ == null) { + if (configCase_ == 1) { + return (com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance) + config_; + } + return com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .getDefaultInstance(); + } else { + if (configCase_ == 1) { + return gceInstanceBuilder_.getMessage(); + } + return com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .getDefaultInstance(); + } + } + /** + * + * + *
+       * Specifies a Compute Engine instance as the host.
+       * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance gce_instance = 1; + * + */ + public Builder setGceInstance( + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance value) { + if (gceInstanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + config_ = value; + onChanged(); + } else { + gceInstanceBuilder_.setMessage(value); + } + configCase_ = 1; + return this; + } + /** + * + * + *
+       * Specifies a Compute Engine instance as the host.
+       * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance gce_instance = 1; + * + */ + public Builder setGceInstance( + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.Builder + builderForValue) { + if (gceInstanceBuilder_ == null) { + config_ = builderForValue.build(); + onChanged(); + } else { + gceInstanceBuilder_.setMessage(builderForValue.build()); + } + configCase_ = 1; + return this; + } + /** + * + * + *
+       * Specifies a Compute Engine instance as the host.
+       * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance gce_instance = 1; + * + */ + public Builder mergeGceInstance( + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance value) { + if (gceInstanceBuilder_ == null) { + if (configCase_ == 1 + && config_ + != com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .getDefaultInstance()) { + config_ = + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.newBuilder( + (com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance) + config_) + .mergeFrom(value) + .buildPartial(); + } else { + config_ = value; + } + onChanged(); + } else { + if (configCase_ == 1) { + gceInstanceBuilder_.mergeFrom(value); + } else { + gceInstanceBuilder_.setMessage(value); + } + } + configCase_ = 1; + return this; + } + /** + * + * + *
+       * Specifies a Compute Engine instance as the host.
+       * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance gce_instance = 1; + * + */ + public Builder clearGceInstance() { + if (gceInstanceBuilder_ == null) { + if (configCase_ == 1) { + configCase_ = 0; + config_ = null; + onChanged(); + } + } else { + if (configCase_ == 1) { + configCase_ = 0; + config_ = null; + } + gceInstanceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Specifies a Compute Engine instance as the host.
+       * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance gce_instance = 1; + * + */ + public com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.Builder + getGceInstanceBuilder() { + return getGceInstanceFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Specifies a Compute Engine instance as the host.
+       * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance gce_instance = 1; + * + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstanceOrBuilder + getGceInstanceOrBuilder() { + if ((configCase_ == 1) && (gceInstanceBuilder_ != null)) { + return gceInstanceBuilder_.getMessageOrBuilder(); + } else { + if (configCase_ == 1) { + return (com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance) + config_; + } + return com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .getDefaultInstance(); + } + } + /** + * + * + *
+       * Specifies a Compute Engine instance as the host.
+       * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance gce_instance = 1; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance, + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.Builder, + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstanceOrBuilder> + getGceInstanceFieldBuilder() { + if (gceInstanceBuilder_ == null) { + if (!(configCase_ == 1)) { + config_ = + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance + .getDefaultInstance(); + } + gceInstanceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance, + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.Builder, + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstanceOrBuilder>( + (com.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance) config_, + getParentForChildren(), + isClean()); + config_ = null; + } + configCase_ = 1; + onChanged(); + return gceInstanceBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workstations.v1beta.WorkstationConfig.Host) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workstations.v1beta.WorkstationConfig.Host) + private static final com.google.cloud.workstations.v1beta.WorkstationConfig.Host + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workstations.v1beta.WorkstationConfig.Host(); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Host getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Host parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.Host getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface PersistentDirectoryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Location of this directory in the running workstation.
+     * 
+ * + * string mount_path = 1; + * + * @return The mountPath. + */ + java.lang.String getMountPath(); + /** + * + * + *
+     * Location of this directory in the running workstation.
+     * 
+ * + * string mount_path = 1; + * + * @return The bytes for mountPath. + */ + com.google.protobuf.ByteString getMountPathBytes(); + + /** + * + * + *
+     * A PersistentDirectory backed by a Compute Engine persistent disk.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk gce_pd = 2; + * + * + * @return Whether the gcePd field is set. + */ + boolean hasGcePd(); + /** + * + * + *
+     * A PersistentDirectory backed by a Compute Engine persistent disk.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk gce_pd = 2; + * + * + * @return The gcePd. + */ + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk + getGcePd(); + /** + * + * + *
+     * A PersistentDirectory backed by a Compute Engine persistent disk.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk gce_pd = 2; + * + */ + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDiskOrBuilder + getGcePdOrBuilder(); + + public com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .DirectoryTypeCase + getDirectoryTypeCase(); + } + /** + * + * + *
+   * A directory to persist across workstation sessions.
+   * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory} + */ + public static final class PersistentDirectory extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory) + PersistentDirectoryOrBuilder { + private static final long serialVersionUID = 0L; + // Use PersistentDirectory.newBuilder() to construct. + private PersistentDirectory(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PersistentDirectory() { + mountPath_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PersistentDirectory(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_PersistentDirectory_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_PersistentDirectory_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.class, + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.Builder + .class); + } + + public interface GceRegionalPersistentDiskOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Size of the disk in GB. Must be empty if source_snapshot is set.
+       * 
+ * + * int32 size_gb = 1; + * + * @return The sizeGb. + */ + int getSizeGb(); + + /** + * + * + *
+       * Type of file system that the disk should be formatted with. The
+       * workstation image must support this file system type. Must be empty
+       * if source_snapshot is set.
+       * 
+ * + * string fs_type = 2; + * + * @return The fsType. + */ + java.lang.String getFsType(); + /** + * + * + *
+       * Type of file system that the disk should be formatted with. The
+       * workstation image must support this file system type. Must be empty
+       * if source_snapshot is set.
+       * 
+ * + * string fs_type = 2; + * + * @return The bytes for fsType. + */ + com.google.protobuf.ByteString getFsTypeBytes(); + + /** + * + * + *
+       * Type of the disk to use.
+       * 
+ * + * string disk_type = 3; + * + * @return The diskType. + */ + java.lang.String getDiskType(); + /** + * + * + *
+       * Type of the disk to use.
+       * 
+ * + * string disk_type = 3; + * + * @return The bytes for diskType. + */ + com.google.protobuf.ByteString getDiskTypeBytes(); + + /** + * + * + *
+       * Name of the snapshot to use as the source for the disk. If set,
+       * size_gb and fs_type must be empty.
+       * 
+ * + * string source_snapshot = 5; + * + * @return The sourceSnapshot. + */ + java.lang.String getSourceSnapshot(); + /** + * + * + *
+       * Name of the snapshot to use as the source for the disk. If set,
+       * size_gb and fs_type must be empty.
+       * 
+ * + * string source_snapshot = 5; + * + * @return The bytes for sourceSnapshot. + */ + com.google.protobuf.ByteString getSourceSnapshotBytes(); + + /** + * + * + *
+       * What should happen to the disk after the workstation is deleted.
+       * Defaults to DELETE.
+       * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.ReclaimPolicy reclaim_policy = 4; + * + * + * @return The enum numeric value on the wire for reclaimPolicy. + */ + int getReclaimPolicyValue(); + /** + * + * + *
+       * What should happen to the disk after the workstation is deleted.
+       * Defaults to DELETE.
+       * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.ReclaimPolicy reclaim_policy = 4; + * + * + * @return The reclaimPolicy. + */ + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk.ReclaimPolicy + getReclaimPolicy(); + } + /** + * + * + *
+     * A PersistentDirectory backed by a Compute Engine regional persistent
+     * disk.
+     * 
+ * + * Protobuf type {@code + * google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk} + */ + public static final class GceRegionalPersistentDisk + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk) + GceRegionalPersistentDiskOrBuilder { + private static final long serialVersionUID = 0L; + // Use GceRegionalPersistentDisk.newBuilder() to construct. + private GceRegionalPersistentDisk(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GceRegionalPersistentDisk() { + fsType_ = ""; + diskType_ = ""; + sourceSnapshot_ = ""; + reclaimPolicy_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GceRegionalPersistentDisk(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_PersistentDirectory_GceRegionalPersistentDisk_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_PersistentDirectory_GceRegionalPersistentDisk_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk.class, + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk.Builder.class); + } + + /** + * + * + *
+       * Value representing what should happen to the disk after the workstation
+       * is deleted.
+       * 
+ * + * Protobuf enum {@code + * google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.ReclaimPolicy} + */ + public enum ReclaimPolicy implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+         * Do not use.
+         * 
+ * + * RECLAIM_POLICY_UNSPECIFIED = 0; + */ + RECLAIM_POLICY_UNSPECIFIED(0), + /** + * + * + *
+         * The persistent disk will be deleted with the workstation.
+         * 
+ * + * DELETE = 1; + */ + DELETE(1), + /** + * + * + *
+         * The persistent disk will be remain after the workstation is deleted,
+         * and the administrator must manually delete the disk.
+         * 
+ * + * RETAIN = 2; + */ + RETAIN(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+         * Do not use.
+         * 
+ * + * RECLAIM_POLICY_UNSPECIFIED = 0; + */ + public static final int RECLAIM_POLICY_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+         * The persistent disk will be deleted with the workstation.
+         * 
+ * + * DELETE = 1; + */ + public static final int DELETE_VALUE = 1; + /** + * + * + *
+         * The persistent disk will be remain after the workstation is deleted,
+         * and the administrator must manually delete the disk.
+         * 
+ * + * RETAIN = 2; + */ + public static final int RETAIN_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ReclaimPolicy valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ReclaimPolicy forNumber(int value) { + switch (value) { + case 0: + return RECLAIM_POLICY_UNSPECIFIED; + case 1: + return DELETE; + case 2: + return RETAIN; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ReclaimPolicy findValueByNumber(int number) { + return ReclaimPolicy.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final ReclaimPolicy[] VALUES = values(); + + public static ReclaimPolicy valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ReclaimPolicy(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.ReclaimPolicy) + } + + public static final int SIZE_GB_FIELD_NUMBER = 1; + private int sizeGb_ = 0; + /** + * + * + *
+       * Size of the disk in GB. Must be empty if source_snapshot is set.
+       * 
+ * + * int32 size_gb = 1; + * + * @return The sizeGb. + */ + @java.lang.Override + public int getSizeGb() { + return sizeGb_; + } + + public static final int FS_TYPE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object fsType_ = ""; + /** + * + * + *
+       * Type of file system that the disk should be formatted with. The
+       * workstation image must support this file system type. Must be empty
+       * if source_snapshot is set.
+       * 
+ * + * string fs_type = 2; + * + * @return The fsType. + */ + @java.lang.Override + public java.lang.String getFsType() { + java.lang.Object ref = fsType_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fsType_ = s; + return s; + } + } + /** + * + * + *
+       * Type of file system that the disk should be formatted with. The
+       * workstation image must support this file system type. Must be empty
+       * if source_snapshot is set.
+       * 
+ * + * string fs_type = 2; + * + * @return The bytes for fsType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFsTypeBytes() { + java.lang.Object ref = fsType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fsType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISK_TYPE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object diskType_ = ""; + /** + * + * + *
+       * Type of the disk to use.
+       * 
+ * + * string disk_type = 3; + * + * @return The diskType. + */ + @java.lang.Override + public java.lang.String getDiskType() { + java.lang.Object ref = diskType_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + diskType_ = s; + return s; + } + } + /** + * + * + *
+       * Type of the disk to use.
+       * 
+ * + * string disk_type = 3; + * + * @return The bytes for diskType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDiskTypeBytes() { + java.lang.Object ref = diskType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + diskType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SOURCE_SNAPSHOT_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object sourceSnapshot_ = ""; + /** + * + * + *
+       * Name of the snapshot to use as the source for the disk. If set,
+       * size_gb and fs_type must be empty.
+       * 
+ * + * string source_snapshot = 5; + * + * @return The sourceSnapshot. + */ + @java.lang.Override + public java.lang.String getSourceSnapshot() { + java.lang.Object ref = sourceSnapshot_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sourceSnapshot_ = s; + return s; + } + } + /** + * + * + *
+       * Name of the snapshot to use as the source for the disk. If set,
+       * size_gb and fs_type must be empty.
+       * 
+ * + * string source_snapshot = 5; + * + * @return The bytes for sourceSnapshot. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSourceSnapshotBytes() { + java.lang.Object ref = sourceSnapshot_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceSnapshot_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RECLAIM_POLICY_FIELD_NUMBER = 4; + private int reclaimPolicy_ = 0; + /** + * + * + *
+       * What should happen to the disk after the workstation is deleted.
+       * Defaults to DELETE.
+       * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.ReclaimPolicy reclaim_policy = 4; + * + * + * @return The enum numeric value on the wire for reclaimPolicy. + */ + @java.lang.Override + public int getReclaimPolicyValue() { + return reclaimPolicy_; + } + /** + * + * + *
+       * What should happen to the disk after the workstation is deleted.
+       * Defaults to DELETE.
+       * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.ReclaimPolicy reclaim_policy = 4; + * + * + * @return The reclaimPolicy. + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk.ReclaimPolicy + getReclaimPolicy() { + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk.ReclaimPolicy + result = + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk.ReclaimPolicy.forNumber(reclaimPolicy_); + return result == null + ? com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk.ReclaimPolicy.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (sizeGb_ != 0) { + output.writeInt32(1, sizeGb_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(fsType_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, fsType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(diskType_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, diskType_); + } + if (reclaimPolicy_ + != com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk.ReclaimPolicy.RECLAIM_POLICY_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, reclaimPolicy_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sourceSnapshot_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, sourceSnapshot_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (sizeGb_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, sizeGb_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(fsType_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, fsType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(diskType_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, diskType_); + } + if (reclaimPolicy_ + != com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk.ReclaimPolicy.RECLAIM_POLICY_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, reclaimPolicy_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sourceSnapshot_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, sourceSnapshot_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk)) { + return super.equals(obj); + } + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk + other = + (com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk) + obj; + + if (getSizeGb() != other.getSizeGb()) return false; + if (!getFsType().equals(other.getFsType())) return false; + if (!getDiskType().equals(other.getDiskType())) return false; + if (!getSourceSnapshot().equals(other.getSourceSnapshot())) return false; + if (reclaimPolicy_ != other.reclaimPolicy_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SIZE_GB_FIELD_NUMBER; + hash = (53 * hash) + getSizeGb(); + hash = (37 * hash) + FS_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getFsType().hashCode(); + hash = (37 * hash) + DISK_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getDiskType().hashCode(); + hash = (37 * hash) + SOURCE_SNAPSHOT_FIELD_NUMBER; + hash = (53 * hash) + getSourceSnapshot().hashCode(); + hash = (37 * hash) + RECLAIM_POLICY_FIELD_NUMBER; + hash = (53 * hash) + reclaimPolicy_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+       * A PersistentDirectory backed by a Compute Engine regional persistent
+       * disk.
+       * 
+ * + * Protobuf type {@code + * google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk) + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDiskOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_PersistentDirectory_GceRegionalPersistentDisk_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_PersistentDirectory_GceRegionalPersistentDisk_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk.class, + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk.Builder.class); + } + + // Construct using + // com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + sizeGb_ = 0; + fsType_ = ""; + diskType_ = ""; + sourceSnapshot_ = ""; + reclaimPolicy_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_PersistentDirectory_GceRegionalPersistentDisk_descriptor; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk + getDefaultInstanceForType() { + return com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk + build() { + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk + buildPartial() { + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk + result = + new com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk + result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.sizeGb_ = sizeGb_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.fsType_ = fsType_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.diskType_ = diskType_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.sourceSnapshot_ = sourceSnapshot_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.reclaimPolicy_ = reclaimPolicy_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk) { + return mergeFrom( + (com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk + other) { + if (other + == com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk.getDefaultInstance()) return this; + if (other.getSizeGb() != 0) { + setSizeGb(other.getSizeGb()); + } + if (!other.getFsType().isEmpty()) { + fsType_ = other.fsType_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getDiskType().isEmpty()) { + diskType_ = other.diskType_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getSourceSnapshot().isEmpty()) { + sourceSnapshot_ = other.sourceSnapshot_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.reclaimPolicy_ != 0) { + setReclaimPolicyValue(other.getReclaimPolicyValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + sizeGb_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + fsType_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + diskType_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + reclaimPolicy_ = input.readEnum(); + bitField0_ |= 0x00000010; + break; + } // case 32 + case 42: + { + sourceSnapshot_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int sizeGb_; + /** + * + * + *
+         * Size of the disk in GB. Must be empty if source_snapshot is set.
+         * 
+ * + * int32 size_gb = 1; + * + * @return The sizeGb. + */ + @java.lang.Override + public int getSizeGb() { + return sizeGb_; + } + /** + * + * + *
+         * Size of the disk in GB. Must be empty if source_snapshot is set.
+         * 
+ * + * int32 size_gb = 1; + * + * @param value The sizeGb to set. + * @return This builder for chaining. + */ + public Builder setSizeGb(int value) { + + sizeGb_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * Size of the disk in GB. Must be empty if source_snapshot is set.
+         * 
+ * + * int32 size_gb = 1; + * + * @return This builder for chaining. + */ + public Builder clearSizeGb() { + bitField0_ = (bitField0_ & ~0x00000001); + sizeGb_ = 0; + onChanged(); + return this; + } + + private java.lang.Object fsType_ = ""; + /** + * + * + *
+         * Type of file system that the disk should be formatted with. The
+         * workstation image must support this file system type. Must be empty
+         * if source_snapshot is set.
+         * 
+ * + * string fs_type = 2; + * + * @return The fsType. + */ + public java.lang.String getFsType() { + java.lang.Object ref = fsType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fsType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * Type of file system that the disk should be formatted with. The
+         * workstation image must support this file system type. Must be empty
+         * if source_snapshot is set.
+         * 
+ * + * string fs_type = 2; + * + * @return The bytes for fsType. + */ + public com.google.protobuf.ByteString getFsTypeBytes() { + java.lang.Object ref = fsType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fsType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * Type of file system that the disk should be formatted with. The
+         * workstation image must support this file system type. Must be empty
+         * if source_snapshot is set.
+         * 
+ * + * string fs_type = 2; + * + * @param value The fsType to set. + * @return This builder for chaining. + */ + public Builder setFsType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + fsType_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+         * Type of file system that the disk should be formatted with. The
+         * workstation image must support this file system type. Must be empty
+         * if source_snapshot is set.
+         * 
+ * + * string fs_type = 2; + * + * @return This builder for chaining. + */ + public Builder clearFsType() { + fsType_ = getDefaultInstance().getFsType(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+         * Type of file system that the disk should be formatted with. The
+         * workstation image must support this file system type. Must be empty
+         * if source_snapshot is set.
+         * 
+ * + * string fs_type = 2; + * + * @param value The bytes for fsType to set. + * @return This builder for chaining. + */ + public Builder setFsTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + fsType_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object diskType_ = ""; + /** + * + * + *
+         * Type of the disk to use.
+         * 
+ * + * string disk_type = 3; + * + * @return The diskType. + */ + public java.lang.String getDiskType() { + java.lang.Object ref = diskType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + diskType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * Type of the disk to use.
+         * 
+ * + * string disk_type = 3; + * + * @return The bytes for diskType. + */ + public com.google.protobuf.ByteString getDiskTypeBytes() { + java.lang.Object ref = diskType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + diskType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * Type of the disk to use.
+         * 
+ * + * string disk_type = 3; + * + * @param value The diskType to set. + * @return This builder for chaining. + */ + public Builder setDiskType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + diskType_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+         * Type of the disk to use.
+         * 
+ * + * string disk_type = 3; + * + * @return This builder for chaining. + */ + public Builder clearDiskType() { + diskType_ = getDefaultInstance().getDiskType(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+         * Type of the disk to use.
+         * 
+ * + * string disk_type = 3; + * + * @param value The bytes for diskType to set. + * @return This builder for chaining. + */ + public Builder setDiskTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + diskType_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object sourceSnapshot_ = ""; + /** + * + * + *
+         * Name of the snapshot to use as the source for the disk. If set,
+         * size_gb and fs_type must be empty.
+         * 
+ * + * string source_snapshot = 5; + * + * @return The sourceSnapshot. + */ + public java.lang.String getSourceSnapshot() { + java.lang.Object ref = sourceSnapshot_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sourceSnapshot_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * Name of the snapshot to use as the source for the disk. If set,
+         * size_gb and fs_type must be empty.
+         * 
+ * + * string source_snapshot = 5; + * + * @return The bytes for sourceSnapshot. + */ + public com.google.protobuf.ByteString getSourceSnapshotBytes() { + java.lang.Object ref = sourceSnapshot_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceSnapshot_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * Name of the snapshot to use as the source for the disk. If set,
+         * size_gb and fs_type must be empty.
+         * 
+ * + * string source_snapshot = 5; + * + * @param value The sourceSnapshot to set. + * @return This builder for chaining. + */ + public Builder setSourceSnapshot(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sourceSnapshot_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+         * Name of the snapshot to use as the source for the disk. If set,
+         * size_gb and fs_type must be empty.
+         * 
+ * + * string source_snapshot = 5; + * + * @return This builder for chaining. + */ + public Builder clearSourceSnapshot() { + sourceSnapshot_ = getDefaultInstance().getSourceSnapshot(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+         * Name of the snapshot to use as the source for the disk. If set,
+         * size_gb and fs_type must be empty.
+         * 
+ * + * string source_snapshot = 5; + * + * @param value The bytes for sourceSnapshot to set. + * @return This builder for chaining. + */ + public Builder setSourceSnapshotBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sourceSnapshot_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private int reclaimPolicy_ = 0; + /** + * + * + *
+         * What should happen to the disk after the workstation is deleted.
+         * Defaults to DELETE.
+         * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.ReclaimPolicy reclaim_policy = 4; + * + * + * @return The enum numeric value on the wire for reclaimPolicy. + */ + @java.lang.Override + public int getReclaimPolicyValue() { + return reclaimPolicy_; + } + /** + * + * + *
+         * What should happen to the disk after the workstation is deleted.
+         * Defaults to DELETE.
+         * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.ReclaimPolicy reclaim_policy = 4; + * + * + * @param value The enum numeric value on the wire for reclaimPolicy to set. + * @return This builder for chaining. + */ + public Builder setReclaimPolicyValue(int value) { + reclaimPolicy_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+         * What should happen to the disk after the workstation is deleted.
+         * Defaults to DELETE.
+         * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.ReclaimPolicy reclaim_policy = 4; + * + * + * @return The reclaimPolicy. + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk.ReclaimPolicy + getReclaimPolicy() { + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk.ReclaimPolicy + result = + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk.ReclaimPolicy.forNumber(reclaimPolicy_); + return result == null + ? com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk.ReclaimPolicy.UNRECOGNIZED + : result; + } + /** + * + * + *
+         * What should happen to the disk after the workstation is deleted.
+         * Defaults to DELETE.
+         * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.ReclaimPolicy reclaim_policy = 4; + * + * + * @param value The reclaimPolicy to set. + * @return This builder for chaining. + */ + public Builder setReclaimPolicy( + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk.ReclaimPolicy + value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + reclaimPolicy_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+         * What should happen to the disk after the workstation is deleted.
+         * Defaults to DELETE.
+         * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.ReclaimPolicy reclaim_policy = 4; + * + * + * @return This builder for chaining. + */ + public Builder clearReclaimPolicy() { + bitField0_ = (bitField0_ & ~0x00000010); + reclaimPolicy_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk) + private static final com.google.cloud.workstations.v1beta.WorkstationConfig + .PersistentDirectory.GceRegionalPersistentDisk + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk(); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GceRegionalPersistentDisk parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int directoryTypeCase_ = 0; + private java.lang.Object directoryType_; + + public enum DirectoryTypeCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + GCE_PD(2), + DIRECTORYTYPE_NOT_SET(0); + private final int value; + + private DirectoryTypeCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static DirectoryTypeCase valueOf(int value) { + return forNumber(value); + } + + public static DirectoryTypeCase forNumber(int value) { + switch (value) { + case 2: + return GCE_PD; + case 0: + return DIRECTORYTYPE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public DirectoryTypeCase getDirectoryTypeCase() { + return DirectoryTypeCase.forNumber(directoryTypeCase_); + } + + public static final int MOUNT_PATH_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object mountPath_ = ""; + /** + * + * + *
+     * Location of this directory in the running workstation.
+     * 
+ * + * string mount_path = 1; + * + * @return The mountPath. + */ + @java.lang.Override + public java.lang.String getMountPath() { + java.lang.Object ref = mountPath_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mountPath_ = s; + return s; + } + } + /** + * + * + *
+     * Location of this directory in the running workstation.
+     * 
+ * + * string mount_path = 1; + * + * @return The bytes for mountPath. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMountPathBytes() { + java.lang.Object ref = mountPath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + mountPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GCE_PD_FIELD_NUMBER = 2; + /** + * + * + *
+     * A PersistentDirectory backed by a Compute Engine persistent disk.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk gce_pd = 2; + * + * + * @return Whether the gcePd field is set. + */ + @java.lang.Override + public boolean hasGcePd() { + return directoryTypeCase_ == 2; + } + /** + * + * + *
+     * A PersistentDirectory backed by a Compute Engine persistent disk.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk gce_pd = 2; + * + * + * @return The gcePd. + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk + getGcePd() { + if (directoryTypeCase_ == 2) { + return (com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk) + directoryType_; + } + return com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk.getDefaultInstance(); + } + /** + * + * + *
+     * A PersistentDirectory backed by a Compute Engine persistent disk.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk gce_pd = 2; + * + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDiskOrBuilder + getGcePdOrBuilder() { + if (directoryTypeCase_ == 2) { + return (com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk) + directoryType_; + } + return com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mountPath_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, mountPath_); + } + if (directoryTypeCase_ == 2) { + output.writeMessage( + 2, + (com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk) + directoryType_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mountPath_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, mountPath_); + } + if (directoryTypeCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, + (com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk) + directoryType_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory)) { + return super.equals(obj); + } + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory other = + (com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory) obj; + + if (!getMountPath().equals(other.getMountPath())) return false; + if (!getDirectoryTypeCase().equals(other.getDirectoryTypeCase())) return false; + switch (directoryTypeCase_) { + case 2: + if (!getGcePd().equals(other.getGcePd())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MOUNT_PATH_FIELD_NUMBER; + hash = (53 * hash) + getMountPath().hashCode(); + switch (directoryTypeCase_) { + case 2: + hash = (37 * hash) + GCE_PD_FIELD_NUMBER; + hash = (53 * hash) + getGcePd().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * A directory to persist across workstation sessions.
+     * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory) + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectoryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_PersistentDirectory_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_PersistentDirectory_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.class, + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.Builder + .class); + } + + // Construct using + // com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + mountPath_ = ""; + if (gcePdBuilder_ != null) { + gcePdBuilder_.clear(); + } + directoryTypeCase_ = 0; + directoryType_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_PersistentDirectory_descriptor; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + getDefaultInstanceForType() { + return com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory build() { + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + buildPartial() { + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory result = + new com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.mountPath_ = mountPath_; + } + } + + private void buildPartialOneofs( + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory result) { + result.directoryTypeCase_ = directoryTypeCase_; + result.directoryType_ = this.directoryType_; + if (directoryTypeCase_ == 2 && gcePdBuilder_ != null) { + result.directoryType_ = gcePdBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory) { + return mergeFrom( + (com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory other) { + if (other + == com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .getDefaultInstance()) return this; + if (!other.getMountPath().isEmpty()) { + mountPath_ = other.mountPath_; + bitField0_ |= 0x00000001; + onChanged(); + } + switch (other.getDirectoryTypeCase()) { + case GCE_PD: + { + mergeGcePd(other.getGcePd()); + break; + } + case DIRECTORYTYPE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + mountPath_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getGcePdFieldBuilder().getBuilder(), extensionRegistry); + directoryTypeCase_ = 2; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int directoryTypeCase_ = 0; + private java.lang.Object directoryType_; + + public DirectoryTypeCase getDirectoryTypeCase() { + return DirectoryTypeCase.forNumber(directoryTypeCase_); + } + + public Builder clearDirectoryType() { + directoryTypeCase_ = 0; + directoryType_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object mountPath_ = ""; + /** + * + * + *
+       * Location of this directory in the running workstation.
+       * 
+ * + * string mount_path = 1; + * + * @return The mountPath. + */ + public java.lang.String getMountPath() { + java.lang.Object ref = mountPath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mountPath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Location of this directory in the running workstation.
+       * 
+ * + * string mount_path = 1; + * + * @return The bytes for mountPath. + */ + public com.google.protobuf.ByteString getMountPathBytes() { + java.lang.Object ref = mountPath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + mountPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Location of this directory in the running workstation.
+       * 
+ * + * string mount_path = 1; + * + * @param value The mountPath to set. + * @return This builder for chaining. + */ + public Builder setMountPath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + mountPath_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Location of this directory in the running workstation.
+       * 
+ * + * string mount_path = 1; + * + * @return This builder for chaining. + */ + public Builder clearMountPath() { + mountPath_ = getDefaultInstance().getMountPath(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * Location of this directory in the running workstation.
+       * 
+ * + * string mount_path = 1; + * + * @param value The bytes for mountPath to set. + * @return This builder for chaining. + */ + public Builder setMountPathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + mountPath_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk, + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk.Builder, + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDiskOrBuilder> + gcePdBuilder_; + /** + * + * + *
+       * A PersistentDirectory backed by a Compute Engine persistent disk.
+       * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk gce_pd = 2; + * + * + * @return Whether the gcePd field is set. + */ + @java.lang.Override + public boolean hasGcePd() { + return directoryTypeCase_ == 2; + } + /** + * + * + *
+       * A PersistentDirectory backed by a Compute Engine persistent disk.
+       * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk gce_pd = 2; + * + * + * @return The gcePd. + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk + getGcePd() { + if (gcePdBuilder_ == null) { + if (directoryTypeCase_ == 2) { + return (com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk) + directoryType_; + } + return com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk.getDefaultInstance(); + } else { + if (directoryTypeCase_ == 2) { + return gcePdBuilder_.getMessage(); + } + return com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk.getDefaultInstance(); + } + } + /** + * + * + *
+       * A PersistentDirectory backed by a Compute Engine persistent disk.
+       * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk gce_pd = 2; + * + */ + public Builder setGcePd( + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk + value) { + if (gcePdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + directoryType_ = value; + onChanged(); + } else { + gcePdBuilder_.setMessage(value); + } + directoryTypeCase_ = 2; + return this; + } + /** + * + * + *
+       * A PersistentDirectory backed by a Compute Engine persistent disk.
+       * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk gce_pd = 2; + * + */ + public Builder setGcePd( + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk.Builder + builderForValue) { + if (gcePdBuilder_ == null) { + directoryType_ = builderForValue.build(); + onChanged(); + } else { + gcePdBuilder_.setMessage(builderForValue.build()); + } + directoryTypeCase_ = 2; + return this; + } + /** + * + * + *
+       * A PersistentDirectory backed by a Compute Engine persistent disk.
+       * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk gce_pd = 2; + * + */ + public Builder mergeGcePd( + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk + value) { + if (gcePdBuilder_ == null) { + if (directoryTypeCase_ == 2 + && directoryType_ + != com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk.getDefaultInstance()) { + directoryType_ = + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk.newBuilder( + (com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk) + directoryType_) + .mergeFrom(value) + .buildPartial(); + } else { + directoryType_ = value; + } + onChanged(); + } else { + if (directoryTypeCase_ == 2) { + gcePdBuilder_.mergeFrom(value); + } else { + gcePdBuilder_.setMessage(value); + } + } + directoryTypeCase_ = 2; + return this; + } + /** + * + * + *
+       * A PersistentDirectory backed by a Compute Engine persistent disk.
+       * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk gce_pd = 2; + * + */ + public Builder clearGcePd() { + if (gcePdBuilder_ == null) { + if (directoryTypeCase_ == 2) { + directoryTypeCase_ = 0; + directoryType_ = null; + onChanged(); + } + } else { + if (directoryTypeCase_ == 2) { + directoryTypeCase_ = 0; + directoryType_ = null; + } + gcePdBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * A PersistentDirectory backed by a Compute Engine persistent disk.
+       * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk gce_pd = 2; + * + */ + public com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk.Builder + getGcePdBuilder() { + return getGcePdFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * A PersistentDirectory backed by a Compute Engine persistent disk.
+       * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk gce_pd = 2; + * + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDiskOrBuilder + getGcePdOrBuilder() { + if ((directoryTypeCase_ == 2) && (gcePdBuilder_ != null)) { + return gcePdBuilder_.getMessageOrBuilder(); + } else { + if (directoryTypeCase_ == 2) { + return (com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk) + directoryType_; + } + return com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk.getDefaultInstance(); + } + } + /** + * + * + *
+       * A PersistentDirectory backed by a Compute Engine persistent disk.
+       * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk gce_pd = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk, + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk.Builder, + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDiskOrBuilder> + getGcePdFieldBuilder() { + if (gcePdBuilder_ == null) { + if (!(directoryTypeCase_ == 2)) { + directoryType_ = + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk.getDefaultInstance(); + } + gcePdBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk, + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk.Builder, + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDiskOrBuilder>( + (com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .GceRegionalPersistentDisk) + directoryType_, + getParentForChildren(), + isClean()); + directoryType_ = null; + } + directoryTypeCase_ = 2; + onChanged(); + return gcePdBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory) + private static final com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory(); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PersistentDirectory parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ContainerOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workstations.v1beta.WorkstationConfig.Container) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Docker image defining the container. This image must be accessible by the
+     * config's service account.
+     * 
+ * + * string image = 1; + * + * @return The image. + */ + java.lang.String getImage(); + /** + * + * + *
+     * Docker image defining the container. This image must be accessible by the
+     * config's service account.
+     * 
+ * + * string image = 1; + * + * @return The bytes for image. + */ + com.google.protobuf.ByteString getImageBytes(); + + /** + * + * + *
+     * If set, overrides the default ENTRYPOINT specified by the image.
+     * 
+ * + * repeated string command = 2; + * + * @return A list containing the command. + */ + java.util.List getCommandList(); + /** + * + * + *
+     * If set, overrides the default ENTRYPOINT specified by the image.
+     * 
+ * + * repeated string command = 2; + * + * @return The count of command. + */ + int getCommandCount(); + /** + * + * + *
+     * If set, overrides the default ENTRYPOINT specified by the image.
+     * 
+ * + * repeated string command = 2; + * + * @param index The index of the element to return. + * @return The command at the given index. + */ + java.lang.String getCommand(int index); + /** + * + * + *
+     * If set, overrides the default ENTRYPOINT specified by the image.
+     * 
+ * + * repeated string command = 2; + * + * @param index The index of the value to return. + * @return The bytes of the command at the given index. + */ + com.google.protobuf.ByteString getCommandBytes(int index); + + /** + * + * + *
+     * Arguments passed to the entrypoint.
+     * 
+ * + * repeated string args = 3; + * + * @return A list containing the args. + */ + java.util.List getArgsList(); + /** + * + * + *
+     * Arguments passed to the entrypoint.
+     * 
+ * + * repeated string args = 3; + * + * @return The count of args. + */ + int getArgsCount(); + /** + * + * + *
+     * Arguments passed to the entrypoint.
+     * 
+ * + * repeated string args = 3; + * + * @param index The index of the element to return. + * @return The args at the given index. + */ + java.lang.String getArgs(int index); + /** + * + * + *
+     * Arguments passed to the entrypoint.
+     * 
+ * + * repeated string args = 3; + * + * @param index The index of the value to return. + * @return The bytes of the args at the given index. + */ + com.google.protobuf.ByteString getArgsBytes(int index); + + /** + * + * + *
+     * Environment variables passed to the container.
+     * 
+ * + * map<string, string> env = 4; + */ + int getEnvCount(); + /** + * + * + *
+     * Environment variables passed to the container.
+     * 
+ * + * map<string, string> env = 4; + */ + boolean containsEnv(java.lang.String key); + /** Use {@link #getEnvMap()} instead. */ + @java.lang.Deprecated + java.util.Map getEnv(); + /** + * + * + *
+     * Environment variables passed to the container.
+     * 
+ * + * map<string, string> env = 4; + */ + java.util.Map getEnvMap(); + /** + * + * + *
+     * Environment variables passed to the container.
+     * 
+ * + * map<string, string> env = 4; + */ + /* nullable */ + java.lang.String getEnvOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+     * Environment variables passed to the container.
+     * 
+ * + * map<string, string> env = 4; + */ + java.lang.String getEnvOrThrow(java.lang.String key); + + /** + * + * + *
+     * If set, overrides the default DIR specified by the image.
+     * 
+ * + * string working_dir = 5; + * + * @return The workingDir. + */ + java.lang.String getWorkingDir(); + /** + * + * + *
+     * If set, overrides the default DIR specified by the image.
+     * 
+ * + * string working_dir = 5; + * + * @return The bytes for workingDir. + */ + com.google.protobuf.ByteString getWorkingDirBytes(); + + /** + * + * + *
+     * If set, overrides the USER specified in the image with the given uid.
+     * 
+ * + * int32 run_as_user = 6; + * + * @return The runAsUser. + */ + int getRunAsUser(); + } + /** + * + * + *
+   * A Docker container.
+   * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.WorkstationConfig.Container} + */ + public static final class Container extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workstations.v1beta.WorkstationConfig.Container) + ContainerOrBuilder { + private static final long serialVersionUID = 0L; + // Use Container.newBuilder() to construct. + private Container(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Container() { + image_ = ""; + command_ = com.google.protobuf.LazyStringArrayList.EMPTY; + args_ = com.google.protobuf.LazyStringArrayList.EMPTY; + workingDir_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Container(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Container_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetEnv(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Container_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.WorkstationConfig.Container.class, + com.google.cloud.workstations.v1beta.WorkstationConfig.Container.Builder.class); + } + + public static final int IMAGE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object image_ = ""; + /** + * + * + *
+     * Docker image defining the container. This image must be accessible by the
+     * config's service account.
+     * 
+ * + * string image = 1; + * + * @return The image. + */ + @java.lang.Override + public java.lang.String getImage() { + java.lang.Object ref = image_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + image_ = s; + return s; + } + } + /** + * + * + *
+     * Docker image defining the container. This image must be accessible by the
+     * config's service account.
+     * 
+ * + * string image = 1; + * + * @return The bytes for image. + */ + @java.lang.Override + public com.google.protobuf.ByteString getImageBytes() { + java.lang.Object ref = image_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + image_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int COMMAND_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringList command_; + /** + * + * + *
+     * If set, overrides the default ENTRYPOINT specified by the image.
+     * 
+ * + * repeated string command = 2; + * + * @return A list containing the command. + */ + public com.google.protobuf.ProtocolStringList getCommandList() { + return command_; + } + /** + * + * + *
+     * If set, overrides the default ENTRYPOINT specified by the image.
+     * 
+ * + * repeated string command = 2; + * + * @return The count of command. + */ + public int getCommandCount() { + return command_.size(); + } + /** + * + * + *
+     * If set, overrides the default ENTRYPOINT specified by the image.
+     * 
+ * + * repeated string command = 2; + * + * @param index The index of the element to return. + * @return The command at the given index. + */ + public java.lang.String getCommand(int index) { + return command_.get(index); + } + /** + * + * + *
+     * If set, overrides the default ENTRYPOINT specified by the image.
+     * 
+ * + * repeated string command = 2; + * + * @param index The index of the value to return. + * @return The bytes of the command at the given index. + */ + public com.google.protobuf.ByteString getCommandBytes(int index) { + return command_.getByteString(index); + } + + public static final int ARGS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringList args_; + /** + * + * + *
+     * Arguments passed to the entrypoint.
+     * 
+ * + * repeated string args = 3; + * + * @return A list containing the args. + */ + public com.google.protobuf.ProtocolStringList getArgsList() { + return args_; + } + /** + * + * + *
+     * Arguments passed to the entrypoint.
+     * 
+ * + * repeated string args = 3; + * + * @return The count of args. + */ + public int getArgsCount() { + return args_.size(); + } + /** + * + * + *
+     * Arguments passed to the entrypoint.
+     * 
+ * + * repeated string args = 3; + * + * @param index The index of the element to return. + * @return The args at the given index. + */ + public java.lang.String getArgs(int index) { + return args_.get(index); + } + /** + * + * + *
+     * Arguments passed to the entrypoint.
+     * 
+ * + * repeated string args = 3; + * + * @param index The index of the value to return. + * @return The bytes of the args at the given index. + */ + public com.google.protobuf.ByteString getArgsBytes(int index) { + return args_.getByteString(index); + } + + public static final int ENV_FIELD_NUMBER = 4; + + private static final class EnvDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Container_EnvEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField env_; + + private com.google.protobuf.MapField internalGetEnv() { + if (env_ == null) { + return com.google.protobuf.MapField.emptyMapField(EnvDefaultEntryHolder.defaultEntry); + } + return env_; + } + + public int getEnvCount() { + return internalGetEnv().getMap().size(); + } + /** + * + * + *
+     * Environment variables passed to the container.
+     * 
+ * + * map<string, string> env = 4; + */ + @java.lang.Override + public boolean containsEnv(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetEnv().getMap().containsKey(key); + } + /** Use {@link #getEnvMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getEnv() { + return getEnvMap(); + } + /** + * + * + *
+     * Environment variables passed to the container.
+     * 
+ * + * map<string, string> env = 4; + */ + @java.lang.Override + public java.util.Map getEnvMap() { + return internalGetEnv().getMap(); + } + /** + * + * + *
+     * Environment variables passed to the container.
+     * 
+ * + * map<string, string> env = 4; + */ + @java.lang.Override + public /* nullable */ java.lang.String getEnvOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetEnv().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Environment variables passed to the container.
+     * 
+ * + * map<string, string> env = 4; + */ + @java.lang.Override + public java.lang.String getEnvOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetEnv().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int WORKING_DIR_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object workingDir_ = ""; + /** + * + * + *
+     * If set, overrides the default DIR specified by the image.
+     * 
+ * + * string working_dir = 5; + * + * @return The workingDir. + */ + @java.lang.Override + public java.lang.String getWorkingDir() { + java.lang.Object ref = workingDir_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + workingDir_ = s; + return s; + } + } + /** + * + * + *
+     * If set, overrides the default DIR specified by the image.
+     * 
+ * + * string working_dir = 5; + * + * @return The bytes for workingDir. + */ + @java.lang.Override + public com.google.protobuf.ByteString getWorkingDirBytes() { + java.lang.Object ref = workingDir_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + workingDir_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RUN_AS_USER_FIELD_NUMBER = 6; + private int runAsUser_ = 0; + /** + * + * + *
+     * If set, overrides the USER specified in the image with the given uid.
+     * 
+ * + * int32 run_as_user = 6; + * + * @return The runAsUser. + */ + @java.lang.Override + public int getRunAsUser() { + return runAsUser_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(image_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, image_); + } + for (int i = 0; i < command_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, command_.getRaw(i)); + } + for (int i = 0; i < args_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, args_.getRaw(i)); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetEnv(), EnvDefaultEntryHolder.defaultEntry, 4); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(workingDir_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, workingDir_); + } + if (runAsUser_ != 0) { + output.writeInt32(6, runAsUser_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(image_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, image_); + } + { + int dataSize = 0; + for (int i = 0; i < command_.size(); i++) { + dataSize += computeStringSizeNoTag(command_.getRaw(i)); + } + size += dataSize; + size += 1 * getCommandList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < args_.size(); i++) { + dataSize += computeStringSizeNoTag(args_.getRaw(i)); + } + size += dataSize; + size += 1 * getArgsList().size(); + } + for (java.util.Map.Entry entry : + internalGetEnv().getMap().entrySet()) { + com.google.protobuf.MapEntry env__ = + EnvDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, env__); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(workingDir_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, workingDir_); + } + if (runAsUser_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(6, runAsUser_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workstations.v1beta.WorkstationConfig.Container)) { + return super.equals(obj); + } + com.google.cloud.workstations.v1beta.WorkstationConfig.Container other = + (com.google.cloud.workstations.v1beta.WorkstationConfig.Container) obj; + + if (!getImage().equals(other.getImage())) return false; + if (!getCommandList().equals(other.getCommandList())) return false; + if (!getArgsList().equals(other.getArgsList())) return false; + if (!internalGetEnv().equals(other.internalGetEnv())) return false; + if (!getWorkingDir().equals(other.getWorkingDir())) return false; + if (getRunAsUser() != other.getRunAsUser()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + IMAGE_FIELD_NUMBER; + hash = (53 * hash) + getImage().hashCode(); + if (getCommandCount() > 0) { + hash = (37 * hash) + COMMAND_FIELD_NUMBER; + hash = (53 * hash) + getCommandList().hashCode(); + } + if (getArgsCount() > 0) { + hash = (37 * hash) + ARGS_FIELD_NUMBER; + hash = (53 * hash) + getArgsList().hashCode(); + } + if (!internalGetEnv().getMap().isEmpty()) { + hash = (37 * hash) + ENV_FIELD_NUMBER; + hash = (53 * hash) + internalGetEnv().hashCode(); + } + hash = (37 * hash) + WORKING_DIR_FIELD_NUMBER; + hash = (53 * hash) + getWorkingDir().hashCode(); + hash = (37 * hash) + RUN_AS_USER_FIELD_NUMBER; + hash = (53 * hash) + getRunAsUser(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Container parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Container parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Container parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Container parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Container parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Container parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Container parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Container parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Container + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Container + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Container parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Container parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workstations.v1beta.WorkstationConfig.Container prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * A Docker container.
+     * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.WorkstationConfig.Container} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workstations.v1beta.WorkstationConfig.Container) + com.google.cloud.workstations.v1beta.WorkstationConfig.ContainerOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Container_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetEnv(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 4: + return internalGetMutableEnv(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Container_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.WorkstationConfig.Container.class, + com.google.cloud.workstations.v1beta.WorkstationConfig.Container.Builder.class); + } + + // Construct using + // com.google.cloud.workstations.v1beta.WorkstationConfig.Container.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + image_ = ""; + command_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + args_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + internalGetMutableEnv().clear(); + workingDir_ = ""; + runAsUser_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Container_descriptor; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.Container + getDefaultInstanceForType() { + return com.google.cloud.workstations.v1beta.WorkstationConfig.Container + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.Container build() { + com.google.cloud.workstations.v1beta.WorkstationConfig.Container result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.Container buildPartial() { + com.google.cloud.workstations.v1beta.WorkstationConfig.Container result = + new com.google.cloud.workstations.v1beta.WorkstationConfig.Container(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.workstations.v1beta.WorkstationConfig.Container result) { + if (((bitField0_ & 0x00000002) != 0)) { + command_ = command_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.command_ = command_; + if (((bitField0_ & 0x00000004) != 0)) { + args_ = args_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.args_ = args_; + } + + private void buildPartial0( + com.google.cloud.workstations.v1beta.WorkstationConfig.Container result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.image_ = image_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.env_ = internalGetEnv(); + result.env_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.workingDir_ = workingDir_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.runAsUser_ = runAsUser_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workstations.v1beta.WorkstationConfig.Container) { + return mergeFrom( + (com.google.cloud.workstations.v1beta.WorkstationConfig.Container) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.workstations.v1beta.WorkstationConfig.Container other) { + if (other + == com.google.cloud.workstations.v1beta.WorkstationConfig.Container + .getDefaultInstance()) return this; + if (!other.getImage().isEmpty()) { + image_ = other.image_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.command_.isEmpty()) { + if (command_.isEmpty()) { + command_ = other.command_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureCommandIsMutable(); + command_.addAll(other.command_); + } + onChanged(); + } + if (!other.args_.isEmpty()) { + if (args_.isEmpty()) { + args_ = other.args_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureArgsIsMutable(); + args_.addAll(other.args_); + } + onChanged(); + } + internalGetMutableEnv().mergeFrom(other.internalGetEnv()); + bitField0_ |= 0x00000008; + if (!other.getWorkingDir().isEmpty()) { + workingDir_ = other.workingDir_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.getRunAsUser() != 0) { + setRunAsUser(other.getRunAsUser()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + image_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureCommandIsMutable(); + command_.add(s); + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureArgsIsMutable(); + args_.add(s); + break; + } // case 26 + case 34: + { + com.google.protobuf.MapEntry env__ = + input.readMessage( + EnvDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableEnv().getMutableMap().put(env__.getKey(), env__.getValue()); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + workingDir_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 48: + { + runAsUser_ = input.readInt32(); + bitField0_ |= 0x00000020; + break; + } // case 48 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object image_ = ""; + /** + * + * + *
+       * Docker image defining the container. This image must be accessible by the
+       * config's service account.
+       * 
+ * + * string image = 1; + * + * @return The image. + */ + public java.lang.String getImage() { + java.lang.Object ref = image_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + image_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Docker image defining the container. This image must be accessible by the
+       * config's service account.
+       * 
+ * + * string image = 1; + * + * @return The bytes for image. + */ + public com.google.protobuf.ByteString getImageBytes() { + java.lang.Object ref = image_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + image_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Docker image defining the container. This image must be accessible by the
+       * config's service account.
+       * 
+ * + * string image = 1; + * + * @param value The image to set. + * @return This builder for chaining. + */ + public Builder setImage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + image_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Docker image defining the container. This image must be accessible by the
+       * config's service account.
+       * 
+ * + * string image = 1; + * + * @return This builder for chaining. + */ + public Builder clearImage() { + image_ = getDefaultInstance().getImage(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * Docker image defining the container. This image must be accessible by the
+       * config's service account.
+       * 
+ * + * string image = 1; + * + * @param value The bytes for image to set. + * @return This builder for chaining. + */ + public Builder setImageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + image_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList command_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureCommandIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + command_ = new com.google.protobuf.LazyStringArrayList(command_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+       * If set, overrides the default ENTRYPOINT specified by the image.
+       * 
+ * + * repeated string command = 2; + * + * @return A list containing the command. + */ + public com.google.protobuf.ProtocolStringList getCommandList() { + return command_.getUnmodifiableView(); + } + /** + * + * + *
+       * If set, overrides the default ENTRYPOINT specified by the image.
+       * 
+ * + * repeated string command = 2; + * + * @return The count of command. + */ + public int getCommandCount() { + return command_.size(); + } + /** + * + * + *
+       * If set, overrides the default ENTRYPOINT specified by the image.
+       * 
+ * + * repeated string command = 2; + * + * @param index The index of the element to return. + * @return The command at the given index. + */ + public java.lang.String getCommand(int index) { + return command_.get(index); + } + /** + * + * + *
+       * If set, overrides the default ENTRYPOINT specified by the image.
+       * 
+ * + * repeated string command = 2; + * + * @param index The index of the value to return. + * @return The bytes of the command at the given index. + */ + public com.google.protobuf.ByteString getCommandBytes(int index) { + return command_.getByteString(index); + } + /** + * + * + *
+       * If set, overrides the default ENTRYPOINT specified by the image.
+       * 
+ * + * repeated string command = 2; + * + * @param index The index to set the value at. + * @param value The command to set. + * @return This builder for chaining. + */ + public Builder setCommand(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCommandIsMutable(); + command_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * If set, overrides the default ENTRYPOINT specified by the image.
+       * 
+ * + * repeated string command = 2; + * + * @param value The command to add. + * @return This builder for chaining. + */ + public Builder addCommand(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCommandIsMutable(); + command_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * If set, overrides the default ENTRYPOINT specified by the image.
+       * 
+ * + * repeated string command = 2; + * + * @param values The command to add. + * @return This builder for chaining. + */ + public Builder addAllCommand(java.lang.Iterable values) { + ensureCommandIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, command_); + onChanged(); + return this; + } + /** + * + * + *
+       * If set, overrides the default ENTRYPOINT specified by the image.
+       * 
+ * + * repeated string command = 2; + * + * @return This builder for chaining. + */ + public Builder clearCommand() { + command_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * If set, overrides the default ENTRYPOINT specified by the image.
+       * 
+ * + * repeated string command = 2; + * + * @param value The bytes of the command to add. + * @return This builder for chaining. + */ + public Builder addCommandBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureCommandIsMutable(); + command_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList args_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureArgsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + args_ = new com.google.protobuf.LazyStringArrayList(args_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+       * Arguments passed to the entrypoint.
+       * 
+ * + * repeated string args = 3; + * + * @return A list containing the args. + */ + public com.google.protobuf.ProtocolStringList getArgsList() { + return args_.getUnmodifiableView(); + } + /** + * + * + *
+       * Arguments passed to the entrypoint.
+       * 
+ * + * repeated string args = 3; + * + * @return The count of args. + */ + public int getArgsCount() { + return args_.size(); + } + /** + * + * + *
+       * Arguments passed to the entrypoint.
+       * 
+ * + * repeated string args = 3; + * + * @param index The index of the element to return. + * @return The args at the given index. + */ + public java.lang.String getArgs(int index) { + return args_.get(index); + } + /** + * + * + *
+       * Arguments passed to the entrypoint.
+       * 
+ * + * repeated string args = 3; + * + * @param index The index of the value to return. + * @return The bytes of the args at the given index. + */ + public com.google.protobuf.ByteString getArgsBytes(int index) { + return args_.getByteString(index); + } + /** + * + * + *
+       * Arguments passed to the entrypoint.
+       * 
+ * + * repeated string args = 3; + * + * @param index The index to set the value at. + * @param value The args to set. + * @return This builder for chaining. + */ + public Builder setArgs(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureArgsIsMutable(); + args_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Arguments passed to the entrypoint.
+       * 
+ * + * repeated string args = 3; + * + * @param value The args to add. + * @return This builder for chaining. + */ + public Builder addArgs(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureArgsIsMutable(); + args_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Arguments passed to the entrypoint.
+       * 
+ * + * repeated string args = 3; + * + * @param values The args to add. + * @return This builder for chaining. + */ + public Builder addAllArgs(java.lang.Iterable values) { + ensureArgsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, args_); + onChanged(); + return this; + } + /** + * + * + *
+       * Arguments passed to the entrypoint.
+       * 
+ * + * repeated string args = 3; + * + * @return This builder for chaining. + */ + public Builder clearArgs() { + args_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+       * Arguments passed to the entrypoint.
+       * 
+ * + * repeated string args = 3; + * + * @param value The bytes of the args to add. + * @return This builder for chaining. + */ + public Builder addArgsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureArgsIsMutable(); + args_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.MapField env_; + + private com.google.protobuf.MapField internalGetEnv() { + if (env_ == null) { + return com.google.protobuf.MapField.emptyMapField(EnvDefaultEntryHolder.defaultEntry); + } + return env_; + } + + private com.google.protobuf.MapField + internalGetMutableEnv() { + if (env_ == null) { + env_ = com.google.protobuf.MapField.newMapField(EnvDefaultEntryHolder.defaultEntry); + } + if (!env_.isMutable()) { + env_ = env_.copy(); + } + bitField0_ |= 0x00000008; + onChanged(); + return env_; + } + + public int getEnvCount() { + return internalGetEnv().getMap().size(); + } + /** + * + * + *
+       * Environment variables passed to the container.
+       * 
+ * + * map<string, string> env = 4; + */ + @java.lang.Override + public boolean containsEnv(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetEnv().getMap().containsKey(key); + } + /** Use {@link #getEnvMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getEnv() { + return getEnvMap(); + } + /** + * + * + *
+       * Environment variables passed to the container.
+       * 
+ * + * map<string, string> env = 4; + */ + @java.lang.Override + public java.util.Map getEnvMap() { + return internalGetEnv().getMap(); + } + /** + * + * + *
+       * Environment variables passed to the container.
+       * 
+ * + * map<string, string> env = 4; + */ + @java.lang.Override + public /* nullable */ java.lang.String getEnvOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetEnv().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+       * Environment variables passed to the container.
+       * 
+ * + * map<string, string> env = 4; + */ + @java.lang.Override + public java.lang.String getEnvOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetEnv().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearEnv() { + bitField0_ = (bitField0_ & ~0x00000008); + internalGetMutableEnv().getMutableMap().clear(); + return this; + } + /** + * + * + *
+       * Environment variables passed to the container.
+       * 
+ * + * map<string, string> env = 4; + */ + public Builder removeEnv(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableEnv().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableEnv() { + bitField0_ |= 0x00000008; + return internalGetMutableEnv().getMutableMap(); + } + /** + * + * + *
+       * Environment variables passed to the container.
+       * 
+ * + * map<string, string> env = 4; + */ + public Builder putEnv(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableEnv().getMutableMap().put(key, value); + bitField0_ |= 0x00000008; + return this; + } + /** + * + * + *
+       * Environment variables passed to the container.
+       * 
+ * + * map<string, string> env = 4; + */ + public Builder putAllEnv(java.util.Map values) { + internalGetMutableEnv().getMutableMap().putAll(values); + bitField0_ |= 0x00000008; + return this; + } + + private java.lang.Object workingDir_ = ""; + /** + * + * + *
+       * If set, overrides the default DIR specified by the image.
+       * 
+ * + * string working_dir = 5; + * + * @return The workingDir. + */ + public java.lang.String getWorkingDir() { + java.lang.Object ref = workingDir_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + workingDir_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * If set, overrides the default DIR specified by the image.
+       * 
+ * + * string working_dir = 5; + * + * @return The bytes for workingDir. + */ + public com.google.protobuf.ByteString getWorkingDirBytes() { + java.lang.Object ref = workingDir_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + workingDir_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * If set, overrides the default DIR specified by the image.
+       * 
+ * + * string working_dir = 5; + * + * @param value The workingDir to set. + * @return This builder for chaining. + */ + public Builder setWorkingDir(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + workingDir_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+       * If set, overrides the default DIR specified by the image.
+       * 
+ * + * string working_dir = 5; + * + * @return This builder for chaining. + */ + public Builder clearWorkingDir() { + workingDir_ = getDefaultInstance().getWorkingDir(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+       * If set, overrides the default DIR specified by the image.
+       * 
+ * + * string working_dir = 5; + * + * @param value The bytes for workingDir to set. + * @return This builder for chaining. + */ + public Builder setWorkingDirBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + workingDir_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private int runAsUser_; + /** + * + * + *
+       * If set, overrides the USER specified in the image with the given uid.
+       * 
+ * + * int32 run_as_user = 6; + * + * @return The runAsUser. + */ + @java.lang.Override + public int getRunAsUser() { + return runAsUser_; + } + /** + * + * + *
+       * If set, overrides the USER specified in the image with the given uid.
+       * 
+ * + * int32 run_as_user = 6; + * + * @param value The runAsUser to set. + * @return This builder for chaining. + */ + public Builder setRunAsUser(int value) { + + runAsUser_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+       * If set, overrides the USER specified in the image with the given uid.
+       * 
+ * + * int32 run_as_user = 6; + * + * @return This builder for chaining. + */ + public Builder clearRunAsUser() { + bitField0_ = (bitField0_ & ~0x00000020); + runAsUser_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workstations.v1beta.WorkstationConfig.Container) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workstations.v1beta.WorkstationConfig.Container) + private static final com.google.cloud.workstations.v1beta.WorkstationConfig.Container + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workstations.v1beta.WorkstationConfig.Container(); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.Container + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Container parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.Container + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface CustomerEncryptionKeyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The name of the Google Cloud KMS encryption key. For example,
+     * `projects/PROJECT_ID/locations/REGION/keyRings/KEY_RING/cryptoKeys/KEY_NAME`.
+     * 
+ * + * string kms_key = 1; + * + * @return The kmsKey. + */ + java.lang.String getKmsKey(); + /** + * + * + *
+     * The name of the Google Cloud KMS encryption key. For example,
+     * `projects/PROJECT_ID/locations/REGION/keyRings/KEY_RING/cryptoKeys/KEY_NAME`.
+     * 
+ * + * string kms_key = 1; + * + * @return The bytes for kmsKey. + */ + com.google.protobuf.ByteString getKmsKeyBytes(); + + /** + * + * + *
+     * The service account to use with the specified
+     * KMS key. We recommend that you use a separate service account
+     * and follow KMS best practices. For more information, see
+     * [Separation of
+     * duties](https://cloud.google.com/kms/docs/separation-of-duties) and
+     * `gcloud kms keys add-iam-policy-binding`
+     * [`--member`](https://cloud.google.com/sdk/gcloud/reference/kms/keys/add-iam-policy-binding#--member).
+     * 
+ * + * string kms_key_service_account = 2; + * + * @return The kmsKeyServiceAccount. + */ + java.lang.String getKmsKeyServiceAccount(); + /** + * + * + *
+     * The service account to use with the specified
+     * KMS key. We recommend that you use a separate service account
+     * and follow KMS best practices. For more information, see
+     * [Separation of
+     * duties](https://cloud.google.com/kms/docs/separation-of-duties) and
+     * `gcloud kms keys add-iam-policy-binding`
+     * [`--member`](https://cloud.google.com/sdk/gcloud/reference/kms/keys/add-iam-policy-binding#--member).
+     * 
+ * + * string kms_key_service_account = 2; + * + * @return The bytes for kmsKeyServiceAccount. + */ + com.google.protobuf.ByteString getKmsKeyServiceAccountBytes(); + } + /** + * + * + *
+   * A customer-managed encryption key for the Compute Engine resources
+   * of this workstation configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey} + */ + public static final class CustomerEncryptionKey extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey) + CustomerEncryptionKeyOrBuilder { + private static final long serialVersionUID = 0L; + // Use CustomerEncryptionKey.newBuilder() to construct. + private CustomerEncryptionKey(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CustomerEncryptionKey() { + kmsKey_ = ""; + kmsKeyServiceAccount_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CustomerEncryptionKey(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_CustomerEncryptionKey_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_CustomerEncryptionKey_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey.class, + com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey.Builder + .class); + } + + public static final int KMS_KEY_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kmsKey_ = ""; + /** + * + * + *
+     * The name of the Google Cloud KMS encryption key. For example,
+     * `projects/PROJECT_ID/locations/REGION/keyRings/KEY_RING/cryptoKeys/KEY_NAME`.
+     * 
+ * + * string kms_key = 1; + * + * @return The kmsKey. + */ + @java.lang.Override + public java.lang.String getKmsKey() { + java.lang.Object ref = kmsKey_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKey_ = s; + return s; + } + } + /** + * + * + *
+     * The name of the Google Cloud KMS encryption key. For example,
+     * `projects/PROJECT_ID/locations/REGION/keyRings/KEY_RING/cryptoKeys/KEY_NAME`.
+     * 
+ * + * string kms_key = 1; + * + * @return The bytes for kmsKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKmsKeyBytes() { + java.lang.Object ref = kmsKey_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KMS_KEY_SERVICE_ACCOUNT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object kmsKeyServiceAccount_ = ""; + /** + * + * + *
+     * The service account to use with the specified
+     * KMS key. We recommend that you use a separate service account
+     * and follow KMS best practices. For more information, see
+     * [Separation of
+     * duties](https://cloud.google.com/kms/docs/separation-of-duties) and
+     * `gcloud kms keys add-iam-policy-binding`
+     * [`--member`](https://cloud.google.com/sdk/gcloud/reference/kms/keys/add-iam-policy-binding#--member).
+     * 
+ * + * string kms_key_service_account = 2; + * + * @return The kmsKeyServiceAccount. + */ + @java.lang.Override + public java.lang.String getKmsKeyServiceAccount() { + java.lang.Object ref = kmsKeyServiceAccount_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyServiceAccount_ = s; + return s; + } + } + /** + * + * + *
+     * The service account to use with the specified
+     * KMS key. We recommend that you use a separate service account
+     * and follow KMS best practices. For more information, see
+     * [Separation of
+     * duties](https://cloud.google.com/kms/docs/separation-of-duties) and
+     * `gcloud kms keys add-iam-policy-binding`
+     * [`--member`](https://cloud.google.com/sdk/gcloud/reference/kms/keys/add-iam-policy-binding#--member).
+     * 
+ * + * string kms_key_service_account = 2; + * + * @return The bytes for kmsKeyServiceAccount. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKmsKeyServiceAccountBytes() { + java.lang.Object ref = kmsKeyServiceAccount_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyServiceAccount_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKey_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, kmsKey_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKeyServiceAccount_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, kmsKeyServiceAccount_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKey_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, kmsKey_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKeyServiceAccount_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, kmsKeyServiceAccount_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey)) { + return super.equals(obj); + } + com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey other = + (com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey) obj; + + if (!getKmsKey().equals(other.getKmsKey())) return false; + if (!getKmsKeyServiceAccount().equals(other.getKmsKeyServiceAccount())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KMS_KEY_FIELD_NUMBER; + hash = (53 * hash) + getKmsKey().hashCode(); + hash = (37 * hash) + KMS_KEY_SERVICE_ACCOUNT_FIELD_NUMBER; + hash = (53 * hash) + getKmsKeyServiceAccount().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * A customer-managed encryption key for the Compute Engine resources
+     * of this workstation configuration.
+     * 
+ * + * Protobuf type {@code + * google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey) + com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKeyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_CustomerEncryptionKey_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_CustomerEncryptionKey_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey.class, + com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey.Builder + .class); + } + + // Construct using + // com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kmsKey_ = ""; + kmsKeyServiceAccount_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_CustomerEncryptionKey_descriptor; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey + getDefaultInstanceForType() { + return com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey build() { + com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey + buildPartial() { + com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey result = + new com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kmsKey_ = kmsKey_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.kmsKeyServiceAccount_ = kmsKeyServiceAccount_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey) { + return mergeFrom( + (com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey other) { + if (other + == com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey + .getDefaultInstance()) return this; + if (!other.getKmsKey().isEmpty()) { + kmsKey_ = other.kmsKey_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getKmsKeyServiceAccount().isEmpty()) { + kmsKeyServiceAccount_ = other.kmsKeyServiceAccount_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + kmsKey_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + kmsKeyServiceAccount_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kmsKey_ = ""; + /** + * + * + *
+       * The name of the Google Cloud KMS encryption key. For example,
+       * `projects/PROJECT_ID/locations/REGION/keyRings/KEY_RING/cryptoKeys/KEY_NAME`.
+       * 
+ * + * string kms_key = 1; + * + * @return The kmsKey. + */ + public java.lang.String getKmsKey() { + java.lang.Object ref = kmsKey_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKey_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The name of the Google Cloud KMS encryption key. For example,
+       * `projects/PROJECT_ID/locations/REGION/keyRings/KEY_RING/cryptoKeys/KEY_NAME`.
+       * 
+ * + * string kms_key = 1; + * + * @return The bytes for kmsKey. + */ + public com.google.protobuf.ByteString getKmsKeyBytes() { + java.lang.Object ref = kmsKey_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The name of the Google Cloud KMS encryption key. For example,
+       * `projects/PROJECT_ID/locations/REGION/keyRings/KEY_RING/cryptoKeys/KEY_NAME`.
+       * 
+ * + * string kms_key = 1; + * + * @param value The kmsKey to set. + * @return This builder for chaining. + */ + public Builder setKmsKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kmsKey_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The name of the Google Cloud KMS encryption key. For example,
+       * `projects/PROJECT_ID/locations/REGION/keyRings/KEY_RING/cryptoKeys/KEY_NAME`.
+       * 
+ * + * string kms_key = 1; + * + * @return This builder for chaining. + */ + public Builder clearKmsKey() { + kmsKey_ = getDefaultInstance().getKmsKey(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * The name of the Google Cloud KMS encryption key. For example,
+       * `projects/PROJECT_ID/locations/REGION/keyRings/KEY_RING/cryptoKeys/KEY_NAME`.
+       * 
+ * + * string kms_key = 1; + * + * @param value The bytes for kmsKey to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kmsKey_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object kmsKeyServiceAccount_ = ""; + /** + * + * + *
+       * The service account to use with the specified
+       * KMS key. We recommend that you use a separate service account
+       * and follow KMS best practices. For more information, see
+       * [Separation of
+       * duties](https://cloud.google.com/kms/docs/separation-of-duties) and
+       * `gcloud kms keys add-iam-policy-binding`
+       * [`--member`](https://cloud.google.com/sdk/gcloud/reference/kms/keys/add-iam-policy-binding#--member).
+       * 
+ * + * string kms_key_service_account = 2; + * + * @return The kmsKeyServiceAccount. + */ + public java.lang.String getKmsKeyServiceAccount() { + java.lang.Object ref = kmsKeyServiceAccount_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyServiceAccount_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The service account to use with the specified
+       * KMS key. We recommend that you use a separate service account
+       * and follow KMS best practices. For more information, see
+       * [Separation of
+       * duties](https://cloud.google.com/kms/docs/separation-of-duties) and
+       * `gcloud kms keys add-iam-policy-binding`
+       * [`--member`](https://cloud.google.com/sdk/gcloud/reference/kms/keys/add-iam-policy-binding#--member).
+       * 
+ * + * string kms_key_service_account = 2; + * + * @return The bytes for kmsKeyServiceAccount. + */ + public com.google.protobuf.ByteString getKmsKeyServiceAccountBytes() { + java.lang.Object ref = kmsKeyServiceAccount_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyServiceAccount_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The service account to use with the specified
+       * KMS key. We recommend that you use a separate service account
+       * and follow KMS best practices. For more information, see
+       * [Separation of
+       * duties](https://cloud.google.com/kms/docs/separation-of-duties) and
+       * `gcloud kms keys add-iam-policy-binding`
+       * [`--member`](https://cloud.google.com/sdk/gcloud/reference/kms/keys/add-iam-policy-binding#--member).
+       * 
+ * + * string kms_key_service_account = 2; + * + * @param value The kmsKeyServiceAccount to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyServiceAccount(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kmsKeyServiceAccount_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The service account to use with the specified
+       * KMS key. We recommend that you use a separate service account
+       * and follow KMS best practices. For more information, see
+       * [Separation of
+       * duties](https://cloud.google.com/kms/docs/separation-of-duties) and
+       * `gcloud kms keys add-iam-policy-binding`
+       * [`--member`](https://cloud.google.com/sdk/gcloud/reference/kms/keys/add-iam-policy-binding#--member).
+       * 
+ * + * string kms_key_service_account = 2; + * + * @return This builder for chaining. + */ + public Builder clearKmsKeyServiceAccount() { + kmsKeyServiceAccount_ = getDefaultInstance().getKmsKeyServiceAccount(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * The service account to use with the specified
+       * KMS key. We recommend that you use a separate service account
+       * and follow KMS best practices. For more information, see
+       * [Separation of
+       * duties](https://cloud.google.com/kms/docs/separation-of-duties) and
+       * `gcloud kms keys add-iam-policy-binding`
+       * [`--member`](https://cloud.google.com/sdk/gcloud/reference/kms/keys/add-iam-policy-binding#--member).
+       * 
+ * + * string kms_key_service_account = 2; + * + * @param value The bytes for kmsKeyServiceAccount to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyServiceAccountBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kmsKeyServiceAccount_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey) + private static final com.google.cloud.workstations.v1beta.WorkstationConfig + .CustomerEncryptionKey + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey(); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CustomerEncryptionKey parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Full name of this resource.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Full name of this resource.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+   * Human-readable name for this resource.
+   * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * Human-readable name for this resource.
+   * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object uid_ = ""; + /** + * + * + *
+   * Output only. A system-assigned unique identified for this resource.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + @java.lang.Override + public java.lang.String getUid() { + java.lang.Object ref = uid_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uid_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. A system-assigned unique identified for this resource.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUidBytes() { + java.lang.Object ref = uid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RECONCILING_FIELD_NUMBER = 4; + private boolean reconciling_ = false; + /** + * + * + *
+   * Output only. Indicates whether this resource is currently being updated to
+   * match its intended state.
+   * 
+ * + * bool reconciling = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + @java.lang.Override + public boolean getReconciling() { + return reconciling_; + } + + public static final int ANNOTATIONS_FIELD_NUMBER = 5; + + private static final class AnnotationsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_AnnotationsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + /** + * + * + *
+   * Client-specified annotations.
+   * 
+ * + * map<string, string> annotations = 5; + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + /** + * + * + *
+   * Client-specified annotations.
+   * 
+ * + * map<string, string> annotations = 5; + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + /** + * + * + *
+   * Client-specified annotations.
+   * 
+ * + * map<string, string> annotations = 5; + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Client-specified annotations.
+   * 
+ * + * map<string, string> annotations = 5; + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int LABELS_FIELD_NUMBER = 18; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Client-specified labels that are applied to the resource and that are also
+   * propagated to the underlying Compute Engine resources.
+   * 
+ * + * map<string, string> labels = 18; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Client-specified labels that are applied to the resource and that are also
+   * propagated to the underlying Compute Engine resources.
+   * 
+ * + * map<string, string> labels = 18; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Client-specified labels that are applied to the resource and that are also
+   * propagated to the underlying Compute Engine resources.
+   * 
+ * + * map<string, string> labels = 18; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Client-specified labels that are applied to the resource and that are also
+   * propagated to the underlying Compute Engine resources.
+   * 
+ * + * map<string, string> labels = 18; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Time when this resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. Time when this resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. Time when this resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. Time when this resource was most recently updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. Time when this resource was most recently updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. Time when this resource was most recently updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int DELETE_TIME_FIELD_NUMBER = 8; + private com.google.protobuf.Timestamp deleteTime_; + /** + * + * + *
+   * Output only. Time when this resource was soft-deleted.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + @java.lang.Override + public boolean hasDeleteTime() { + return deleteTime_ != null; + } + /** + * + * + *
+   * Output only. Time when this resource was soft-deleted.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The deleteTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getDeleteTime() { + return deleteTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : deleteTime_; + } + /** + * + * + *
+   * Output only. Time when this resource was soft-deleted.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { + return deleteTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : deleteTime_; + } + + public static final int ETAG_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * Checksum computed by the server. May be sent on update and delete requests
+   * to ensure that the client has an up-to-date value before proceeding.
+   * 
+ * + * string etag = 9; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * Checksum computed by the server. May be sent on update and delete requests
+   * to ensure that the client has an up-to-date value before proceeding.
+   * 
+ * + * string etag = 9; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IDLE_TIMEOUT_FIELD_NUMBER = 10; + private com.google.protobuf.Duration idleTimeout_; + /** + * + * + *
+   * How long to wait before automatically stopping an instance that hasn't
+   * received any user traffic. A value of 0 indicates that this instance
+   * should never time out due to idleness. Defaults to 20 minutes.
+   * 
+ * + * .google.protobuf.Duration idle_timeout = 10; + * + * @return Whether the idleTimeout field is set. + */ + @java.lang.Override + public boolean hasIdleTimeout() { + return idleTimeout_ != null; + } + /** + * + * + *
+   * How long to wait before automatically stopping an instance that hasn't
+   * received any user traffic. A value of 0 indicates that this instance
+   * should never time out due to idleness. Defaults to 20 minutes.
+   * 
+ * + * .google.protobuf.Duration idle_timeout = 10; + * + * @return The idleTimeout. + */ + @java.lang.Override + public com.google.protobuf.Duration getIdleTimeout() { + return idleTimeout_ == null ? com.google.protobuf.Duration.getDefaultInstance() : idleTimeout_; + } + /** + * + * + *
+   * How long to wait before automatically stopping an instance that hasn't
+   * received any user traffic. A value of 0 indicates that this instance
+   * should never time out due to idleness. Defaults to 20 minutes.
+   * 
+ * + * .google.protobuf.Duration idle_timeout = 10; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getIdleTimeoutOrBuilder() { + return idleTimeout_ == null ? com.google.protobuf.Duration.getDefaultInstance() : idleTimeout_; + } + + public static final int RUNNING_TIMEOUT_FIELD_NUMBER = 11; + private com.google.protobuf.Duration runningTimeout_; + /** + * + * + *
+   * How long to wait before automatically stopping a workstation after it
+   * started. A value of 0 indicates that workstations using this configuration
+   * should never time out. Must be greater than 0 and less than 24 hours if
+   * encryption_key is set. Defaults to 12 hours.
+   * 
+ * + * .google.protobuf.Duration running_timeout = 11; + * + * @return Whether the runningTimeout field is set. + */ + @java.lang.Override + public boolean hasRunningTimeout() { + return runningTimeout_ != null; + } + /** + * + * + *
+   * How long to wait before automatically stopping a workstation after it
+   * started. A value of 0 indicates that workstations using this configuration
+   * should never time out. Must be greater than 0 and less than 24 hours if
+   * encryption_key is set. Defaults to 12 hours.
+   * 
+ * + * .google.protobuf.Duration running_timeout = 11; + * + * @return The runningTimeout. + */ + @java.lang.Override + public com.google.protobuf.Duration getRunningTimeout() { + return runningTimeout_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : runningTimeout_; + } + /** + * + * + *
+   * How long to wait before automatically stopping a workstation after it
+   * started. A value of 0 indicates that workstations using this configuration
+   * should never time out. Must be greater than 0 and less than 24 hours if
+   * encryption_key is set. Defaults to 12 hours.
+   * 
+ * + * .google.protobuf.Duration running_timeout = 11; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getRunningTimeoutOrBuilder() { + return runningTimeout_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : runningTimeout_; + } + + public static final int HOST_FIELD_NUMBER = 12; + private com.google.cloud.workstations.v1beta.WorkstationConfig.Host host_; + /** + * + * + *
+   * Runtime host for the workstation.
+   * 
+ * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host host = 12; + * + * @return Whether the host field is set. + */ + @java.lang.Override + public boolean hasHost() { + return host_ != null; + } + /** + * + * + *
+   * Runtime host for the workstation.
+   * 
+ * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host host = 12; + * + * @return The host. + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.Host getHost() { + return host_ == null + ? com.google.cloud.workstations.v1beta.WorkstationConfig.Host.getDefaultInstance() + : host_; + } + /** + * + * + *
+   * Runtime host for the workstation.
+   * 
+ * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host host = 12; + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.HostOrBuilder getHostOrBuilder() { + return host_ == null + ? com.google.cloud.workstations.v1beta.WorkstationConfig.Host.getDefaultInstance() + : host_; + } + + public static final int PERSISTENT_DIRECTORIES_FIELD_NUMBER = 13; + + @SuppressWarnings("serial") + private java.util.List + persistentDirectories_; + /** + * + * + *
+   * Directories to persist across workstation sessions.
+   * 
+ * + * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory persistent_directories = 13; + * + */ + @java.lang.Override + public java.util.List + getPersistentDirectoriesList() { + return persistentDirectories_; + } + /** + * + * + *
+   * Directories to persist across workstation sessions.
+   * 
+ * + * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory persistent_directories = 13; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectoryOrBuilder> + getPersistentDirectoriesOrBuilderList() { + return persistentDirectories_; + } + /** + * + * + *
+   * Directories to persist across workstation sessions.
+   * 
+ * + * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory persistent_directories = 13; + * + */ + @java.lang.Override + public int getPersistentDirectoriesCount() { + return persistentDirectories_.size(); + } + /** + * + * + *
+   * Directories to persist across workstation sessions.
+   * 
+ * + * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory persistent_directories = 13; + * + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + getPersistentDirectories(int index) { + return persistentDirectories_.get(index); + } + /** + * + * + *
+   * Directories to persist across workstation sessions.
+   * 
+ * + * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory persistent_directories = 13; + * + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectoryOrBuilder + getPersistentDirectoriesOrBuilder(int index) { + return persistentDirectories_.get(index); + } + + public static final int CONTAINER_FIELD_NUMBER = 14; + private com.google.cloud.workstations.v1beta.WorkstationConfig.Container container_; + /** + * + * + *
+   * Container that will be run for each workstation using this configuration
+   * when that workstation is started.
+   * 
+ * + * .google.cloud.workstations.v1beta.WorkstationConfig.Container container = 14; + * + * @return Whether the container field is set. + */ + @java.lang.Override + public boolean hasContainer() { + return container_ != null; + } + /** + * + * + *
+   * Container that will be run for each workstation using this configuration
+   * when that workstation is started.
+   * 
+ * + * .google.cloud.workstations.v1beta.WorkstationConfig.Container container = 14; + * + * @return The container. + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.Container getContainer() { + return container_ == null + ? com.google.cloud.workstations.v1beta.WorkstationConfig.Container.getDefaultInstance() + : container_; + } + /** + * + * + *
+   * Container that will be run for each workstation using this configuration
+   * when that workstation is started.
+   * 
+ * + * .google.cloud.workstations.v1beta.WorkstationConfig.Container container = 14; + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.ContainerOrBuilder + getContainerOrBuilder() { + return container_ == null + ? com.google.cloud.workstations.v1beta.WorkstationConfig.Container.getDefaultInstance() + : container_; + } + + public static final int ENCRYPTION_KEY_FIELD_NUMBER = 17; + private com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey + encryptionKey_; + /** + * + * + *
+   * Encrypts resources of this workstation configuration using a
+   * customer-managed encryption key.
+   * If specified, the boot disk of the Compute Engine instance and the
+   * persistent disk are encrypted using this encryption key. If
+   * this field is not set, the disks are encrypted using a generated
+   * key. Customer-managed encryption keys do not protect disk metadata.
+   * If the customer-managed encryption key is rotated, when the workstation
+   * instance is stopped, the system attempts to recreate the
+   * persistent disk with the new version of the key. Be sure to keep
+   * older versions of the key until the persistent disk is recreated.
+   * Otherwise, data on the persistent disk will be lost.
+   * If the encryption key is revoked, the workstation session will
+   * automatically be stopped within 7 hours.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey encryption_key = 17; + * + * + * @return Whether the encryptionKey field is set. + */ + @java.lang.Override + public boolean hasEncryptionKey() { + return encryptionKey_ != null; + } + /** + * + * + *
+   * Encrypts resources of this workstation configuration using a
+   * customer-managed encryption key.
+   * If specified, the boot disk of the Compute Engine instance and the
+   * persistent disk are encrypted using this encryption key. If
+   * this field is not set, the disks are encrypted using a generated
+   * key. Customer-managed encryption keys do not protect disk metadata.
+   * If the customer-managed encryption key is rotated, when the workstation
+   * instance is stopped, the system attempts to recreate the
+   * persistent disk with the new version of the key. Be sure to keep
+   * older versions of the key until the persistent disk is recreated.
+   * Otherwise, data on the persistent disk will be lost.
+   * If the encryption key is revoked, the workstation session will
+   * automatically be stopped within 7 hours.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey encryption_key = 17; + * + * + * @return The encryptionKey. + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey + getEncryptionKey() { + return encryptionKey_ == null + ? com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey + .getDefaultInstance() + : encryptionKey_; + } + /** + * + * + *
+   * Encrypts resources of this workstation configuration using a
+   * customer-managed encryption key.
+   * If specified, the boot disk of the Compute Engine instance and the
+   * persistent disk are encrypted using this encryption key. If
+   * this field is not set, the disks are encrypted using a generated
+   * key. Customer-managed encryption keys do not protect disk metadata.
+   * If the customer-managed encryption key is rotated, when the workstation
+   * instance is stopped, the system attempts to recreate the
+   * persistent disk with the new version of the key. Be sure to keep
+   * older versions of the key until the persistent disk is recreated.
+   * Otherwise, data on the persistent disk will be lost.
+   * If the encryption key is revoked, the workstation session will
+   * automatically be stopped within 7 hours.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey encryption_key = 17; + * + */ + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKeyOrBuilder + getEncryptionKeyOrBuilder() { + return encryptionKey_ == null + ? com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey + .getDefaultInstance() + : encryptionKey_; + } + + public static final int DEGRADED_FIELD_NUMBER = 15; + private boolean degraded_ = false; + /** + * + * + *
+   * Output only. Whether this resource is in degraded mode, in which case it
+   * may require user action to restore full functionality. Details can be found
+   * in the `conditions` field.
+   * 
+ * + * bool degraded = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The degraded. + */ + @java.lang.Override + public boolean getDegraded() { + return degraded_; + } + + public static final int CONDITIONS_FIELD_NUMBER = 16; + + @SuppressWarnings("serial") + private java.util.List conditions_; + /** + * + * + *
+   * Output only. Status conditions describing the current resource state.
+   * 
+ * + * repeated .google.rpc.Status conditions = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getConditionsList() { + return conditions_; + } + /** + * + * + *
+   * Output only. Status conditions describing the current resource state.
+   * 
+ * + * repeated .google.rpc.Status conditions = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getConditionsOrBuilderList() { + return conditions_; + } + /** + * + * + *
+   * Output only. Status conditions describing the current resource state.
+   * 
+ * + * repeated .google.rpc.Status conditions = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getConditionsCount() { + return conditions_.size(); + } + /** + * + * + *
+   * Output only. Status conditions describing the current resource state.
+   * 
+ * + * repeated .google.rpc.Status conditions = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.rpc.Status getConditions(int index) { + return conditions_.get(index); + } + /** + * + * + *
+   * Output only. Status conditions describing the current resource state.
+   * 
+ * + * repeated .google.rpc.Status conditions = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getConditionsOrBuilder(int index) { + return conditions_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uid_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, uid_); + } + if (reconciling_ != false) { + output.writeBool(4, reconciling_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetAnnotations(), AnnotationsDefaultEntryHolder.defaultEntry, 5); + if (createTime_ != null) { + output.writeMessage(6, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(7, getUpdateTime()); + } + if (deleteTime_ != null) { + output.writeMessage(8, getDeleteTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, etag_); + } + if (idleTimeout_ != null) { + output.writeMessage(10, getIdleTimeout()); + } + if (runningTimeout_ != null) { + output.writeMessage(11, getRunningTimeout()); + } + if (host_ != null) { + output.writeMessage(12, getHost()); + } + for (int i = 0; i < persistentDirectories_.size(); i++) { + output.writeMessage(13, persistentDirectories_.get(i)); + } + if (container_ != null) { + output.writeMessage(14, getContainer()); + } + if (degraded_ != false) { + output.writeBool(15, degraded_); + } + for (int i = 0; i < conditions_.size(); i++) { + output.writeMessage(16, conditions_.get(i)); + } + if (encryptionKey_ != null) { + output.writeMessage(17, getEncryptionKey()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 18); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uid_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, uid_); + } + if (reconciling_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, reconciling_); + } + for (java.util.Map.Entry entry : + internalGetAnnotations().getMap().entrySet()) { + com.google.protobuf.MapEntry annotations__ = + AnnotationsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, annotations__); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getUpdateTime()); + } + if (deleteTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getDeleteTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, etag_); + } + if (idleTimeout_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getIdleTimeout()); + } + if (runningTimeout_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getRunningTimeout()); + } + if (host_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getHost()); + } + for (int i = 0; i < persistentDirectories_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 13, persistentDirectories_.get(i)); + } + if (container_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, getContainer()); + } + if (degraded_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(15, degraded_); + } + for (int i = 0; i < conditions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(16, conditions_.get(i)); + } + if (encryptionKey_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(17, getEncryptionKey()); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(18, labels__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workstations.v1beta.WorkstationConfig)) { + return super.equals(obj); + } + com.google.cloud.workstations.v1beta.WorkstationConfig other = + (com.google.cloud.workstations.v1beta.WorkstationConfig) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getUid().equals(other.getUid())) return false; + if (getReconciling() != other.getReconciling()) return false; + if (!internalGetAnnotations().equals(other.internalGetAnnotations())) return false; + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (hasDeleteTime() != other.hasDeleteTime()) return false; + if (hasDeleteTime()) { + if (!getDeleteTime().equals(other.getDeleteTime())) return false; + } + if (!getEtag().equals(other.getEtag())) return false; + if (hasIdleTimeout() != other.hasIdleTimeout()) return false; + if (hasIdleTimeout()) { + if (!getIdleTimeout().equals(other.getIdleTimeout())) return false; + } + if (hasRunningTimeout() != other.hasRunningTimeout()) return false; + if (hasRunningTimeout()) { + if (!getRunningTimeout().equals(other.getRunningTimeout())) return false; + } + if (hasHost() != other.hasHost()) return false; + if (hasHost()) { + if (!getHost().equals(other.getHost())) return false; + } + if (!getPersistentDirectoriesList().equals(other.getPersistentDirectoriesList())) return false; + if (hasContainer() != other.hasContainer()) return false; + if (hasContainer()) { + if (!getContainer().equals(other.getContainer())) return false; + } + if (hasEncryptionKey() != other.hasEncryptionKey()) return false; + if (hasEncryptionKey()) { + if (!getEncryptionKey().equals(other.getEncryptionKey())) return false; + } + if (getDegraded() != other.getDegraded()) return false; + if (!getConditionsList().equals(other.getConditionsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + UID_FIELD_NUMBER; + hash = (53 * hash) + getUid().hashCode(); + hash = (37 * hash) + RECONCILING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReconciling()); + if (!internalGetAnnotations().getMap().isEmpty()) { + hash = (37 * hash) + ANNOTATIONS_FIELD_NUMBER; + hash = (53 * hash) + internalGetAnnotations().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (hasDeleteTime()) { + hash = (37 * hash) + DELETE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getDeleteTime().hashCode(); + } + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + if (hasIdleTimeout()) { + hash = (37 * hash) + IDLE_TIMEOUT_FIELD_NUMBER; + hash = (53 * hash) + getIdleTimeout().hashCode(); + } + if (hasRunningTimeout()) { + hash = (37 * hash) + RUNNING_TIMEOUT_FIELD_NUMBER; + hash = (53 * hash) + getRunningTimeout().hashCode(); + } + if (hasHost()) { + hash = (37 * hash) + HOST_FIELD_NUMBER; + hash = (53 * hash) + getHost().hashCode(); + } + if (getPersistentDirectoriesCount() > 0) { + hash = (37 * hash) + PERSISTENT_DIRECTORIES_FIELD_NUMBER; + hash = (53 * hash) + getPersistentDirectoriesList().hashCode(); + } + if (hasContainer()) { + hash = (37 * hash) + CONTAINER_FIELD_NUMBER; + hash = (53 * hash) + getContainer().hashCode(); + } + if (hasEncryptionKey()) { + hash = (37 * hash) + ENCRYPTION_KEY_FIELD_NUMBER; + hash = (53 * hash) + getEncryptionKey().hashCode(); + } + hash = (37 * hash) + DEGRADED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDegraded()); + if (getConditionsCount() > 0) { + hash = (37 * hash) + CONDITIONS_FIELD_NUMBER; + hash = (53 * hash) + getConditionsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workstations.v1beta.WorkstationConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A set of configuration options describing how a workstation will be run.
+   * Workstation configurations are intended to be shared across multiple
+   * workstations.
+   * 
+ * + * Protobuf type {@code google.cloud.workstations.v1beta.WorkstationConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workstations.v1beta.WorkstationConfig) + com.google.cloud.workstations.v1beta.WorkstationConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 5: + return internalGetAnnotations(); + case 18: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 5: + return internalGetMutableAnnotations(); + case 18: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workstations.v1beta.WorkstationConfig.class, + com.google.cloud.workstations.v1beta.WorkstationConfig.Builder.class); + } + + // Construct using com.google.cloud.workstations.v1beta.WorkstationConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + displayName_ = ""; + uid_ = ""; + reconciling_ = false; + internalGetMutableAnnotations().clear(); + internalGetMutableLabels().clear(); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + deleteTime_ = null; + if (deleteTimeBuilder_ != null) { + deleteTimeBuilder_.dispose(); + deleteTimeBuilder_ = null; + } + etag_ = ""; + idleTimeout_ = null; + if (idleTimeoutBuilder_ != null) { + idleTimeoutBuilder_.dispose(); + idleTimeoutBuilder_ = null; + } + runningTimeout_ = null; + if (runningTimeoutBuilder_ != null) { + runningTimeoutBuilder_.dispose(); + runningTimeoutBuilder_ = null; + } + host_ = null; + if (hostBuilder_ != null) { + hostBuilder_.dispose(); + hostBuilder_ = null; + } + if (persistentDirectoriesBuilder_ == null) { + persistentDirectories_ = java.util.Collections.emptyList(); + } else { + persistentDirectories_ = null; + persistentDirectoriesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00002000); + container_ = null; + if (containerBuilder_ != null) { + containerBuilder_.dispose(); + containerBuilder_ = null; + } + encryptionKey_ = null; + if (encryptionKeyBuilder_ != null) { + encryptionKeyBuilder_.dispose(); + encryptionKeyBuilder_ = null; + } + degraded_ = false; + if (conditionsBuilder_ == null) { + conditions_ = java.util.Collections.emptyList(); + } else { + conditions_ = null; + conditionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00020000); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workstations.v1beta.WorkstationsProto + .internal_static_google_cloud_workstations_v1beta_WorkstationConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig getDefaultInstanceForType() { + return com.google.cloud.workstations.v1beta.WorkstationConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig build() { + com.google.cloud.workstations.v1beta.WorkstationConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig buildPartial() { + com.google.cloud.workstations.v1beta.WorkstationConfig result = + new com.google.cloud.workstations.v1beta.WorkstationConfig(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.workstations.v1beta.WorkstationConfig result) { + if (persistentDirectoriesBuilder_ == null) { + if (((bitField0_ & 0x00002000) != 0)) { + persistentDirectories_ = java.util.Collections.unmodifiableList(persistentDirectories_); + bitField0_ = (bitField0_ & ~0x00002000); + } + result.persistentDirectories_ = persistentDirectories_; + } else { + result.persistentDirectories_ = persistentDirectoriesBuilder_.build(); + } + if (conditionsBuilder_ == null) { + if (((bitField0_ & 0x00020000) != 0)) { + conditions_ = java.util.Collections.unmodifiableList(conditions_); + bitField0_ = (bitField0_ & ~0x00020000); + } + result.conditions_ = conditions_; + } else { + result.conditions_ = conditionsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.workstations.v1beta.WorkstationConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.uid_ = uid_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.reconciling_ = reconciling_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.annotations_ = internalGetAnnotations(); + result.annotations_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.deleteTime_ = deleteTimeBuilder_ == null ? deleteTime_ : deleteTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.idleTimeout_ = + idleTimeoutBuilder_ == null ? idleTimeout_ : idleTimeoutBuilder_.build(); + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.runningTimeout_ = + runningTimeoutBuilder_ == null ? runningTimeout_ : runningTimeoutBuilder_.build(); + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.host_ = hostBuilder_ == null ? host_ : hostBuilder_.build(); + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.container_ = containerBuilder_ == null ? container_ : containerBuilder_.build(); + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.encryptionKey_ = + encryptionKeyBuilder_ == null ? encryptionKey_ : encryptionKeyBuilder_.build(); + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.degraded_ = degraded_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workstations.v1beta.WorkstationConfig) { + return mergeFrom((com.google.cloud.workstations.v1beta.WorkstationConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.workstations.v1beta.WorkstationConfig other) { + if (other == com.google.cloud.workstations.v1beta.WorkstationConfig.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getUid().isEmpty()) { + uid_ = other.uid_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getReconciling() != false) { + setReconciling(other.getReconciling()); + } + internalGetMutableAnnotations().mergeFrom(other.internalGetAnnotations()); + bitField0_ |= 0x00000010; + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + bitField0_ |= 0x00000020; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasDeleteTime()) { + mergeDeleteTime(other.getDeleteTime()); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000200; + onChanged(); + } + if (other.hasIdleTimeout()) { + mergeIdleTimeout(other.getIdleTimeout()); + } + if (other.hasRunningTimeout()) { + mergeRunningTimeout(other.getRunningTimeout()); + } + if (other.hasHost()) { + mergeHost(other.getHost()); + } + if (persistentDirectoriesBuilder_ == null) { + if (!other.persistentDirectories_.isEmpty()) { + if (persistentDirectories_.isEmpty()) { + persistentDirectories_ = other.persistentDirectories_; + bitField0_ = (bitField0_ & ~0x00002000); + } else { + ensurePersistentDirectoriesIsMutable(); + persistentDirectories_.addAll(other.persistentDirectories_); + } + onChanged(); + } + } else { + if (!other.persistentDirectories_.isEmpty()) { + if (persistentDirectoriesBuilder_.isEmpty()) { + persistentDirectoriesBuilder_.dispose(); + persistentDirectoriesBuilder_ = null; + persistentDirectories_ = other.persistentDirectories_; + bitField0_ = (bitField0_ & ~0x00002000); + persistentDirectoriesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPersistentDirectoriesFieldBuilder() + : null; + } else { + persistentDirectoriesBuilder_.addAllMessages(other.persistentDirectories_); + } + } + } + if (other.hasContainer()) { + mergeContainer(other.getContainer()); + } + if (other.hasEncryptionKey()) { + mergeEncryptionKey(other.getEncryptionKey()); + } + if (other.getDegraded() != false) { + setDegraded(other.getDegraded()); + } + if (conditionsBuilder_ == null) { + if (!other.conditions_.isEmpty()) { + if (conditions_.isEmpty()) { + conditions_ = other.conditions_; + bitField0_ = (bitField0_ & ~0x00020000); + } else { + ensureConditionsIsMutable(); + conditions_.addAll(other.conditions_); + } + onChanged(); + } + } else { + if (!other.conditions_.isEmpty()) { + if (conditionsBuilder_.isEmpty()) { + conditionsBuilder_.dispose(); + conditionsBuilder_ = null; + conditions_ = other.conditions_; + bitField0_ = (bitField0_ & ~0x00020000); + conditionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getConditionsFieldBuilder() + : null; + } else { + conditionsBuilder_.addAllMessages(other.conditions_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + uid_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + reconciling_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + com.google.protobuf.MapEntry annotations__ = + input.readMessage( + AnnotationsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableAnnotations() + .getMutableMap() + .put(annotations__.getKey(), annotations__.getValue()); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 50 + case 58: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 58 + case 66: + { + input.readMessage(getDeleteTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 66 + case 74: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000200; + break; + } // case 74 + case 82: + { + input.readMessage(getIdleTimeoutFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000400; + break; + } // case 82 + case 90: + { + input.readMessage(getRunningTimeoutFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000800; + break; + } // case 90 + case 98: + { + input.readMessage(getHostFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00001000; + break; + } // case 98 + case 106: + { + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory m = + input.readMessage( + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .parser(), + extensionRegistry); + if (persistentDirectoriesBuilder_ == null) { + ensurePersistentDirectoriesIsMutable(); + persistentDirectories_.add(m); + } else { + persistentDirectoriesBuilder_.addMessage(m); + } + break; + } // case 106 + case 114: + { + input.readMessage(getContainerFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00004000; + break; + } // case 114 + case 120: + { + degraded_ = input.readBool(); + bitField0_ |= 0x00010000; + break; + } // case 120 + case 130: + { + com.google.rpc.Status m = + input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); + if (conditionsBuilder_ == null) { + ensureConditionsIsMutable(); + conditions_.add(m); + } else { + conditionsBuilder_.addMessage(m); + } + break; + } // case 130 + case 138: + { + input.readMessage(getEncryptionKeyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00008000; + break; + } // case 138 + case 146: + { + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLabels() + .getMutableMap() + .put(labels__.getKey(), labels__.getValue()); + bitField0_ |= 0x00000020; + break; + } // case 146 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Full name of this resource.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Full name of this resource.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Full name of this resource.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Full name of this resource.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Full name of this resource.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Human-readable name for this resource.
+     * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Human-readable name for this resource.
+     * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Human-readable name for this resource.
+     * 
+ * + * string display_name = 2; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Human-readable name for this resource.
+     * 
+ * + * string display_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Human-readable name for this resource.
+     * 
+ * + * string display_name = 2; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object uid_ = ""; + /** + * + * + *
+     * Output only. A system-assigned unique identified for this resource.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + public java.lang.String getUid() { + java.lang.Object ref = uid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. A system-assigned unique identified for this resource.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + public com.google.protobuf.ByteString getUidBytes() { + java.lang.Object ref = uid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. A system-assigned unique identified for this resource.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The uid to set. + * @return This builder for chaining. + */ + public Builder setUid(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + uid_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. A system-assigned unique identified for this resource.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearUid() { + uid_ = getDefaultInstance().getUid(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. A system-assigned unique identified for this resource.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for uid to set. + * @return This builder for chaining. + */ + public Builder setUidBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + uid_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean reconciling_; + /** + * + * + *
+     * Output only. Indicates whether this resource is currently being updated to
+     * match its intended state.
+     * 
+ * + * bool reconciling = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + @java.lang.Override + public boolean getReconciling() { + return reconciling_; + } + /** + * + * + *
+     * Output only. Indicates whether this resource is currently being updated to
+     * match its intended state.
+     * 
+ * + * bool reconciling = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The reconciling to set. + * @return This builder for chaining. + */ + public Builder setReconciling(boolean value) { + + reconciling_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Indicates whether this resource is currently being updated to
+     * match its intended state.
+     * 
+ * + * bool reconciling = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearReconciling() { + bitField0_ = (bitField0_ & ~0x00000008); + reconciling_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + private com.google.protobuf.MapField + internalGetMutableAnnotations() { + if (annotations_ == null) { + annotations_ = + com.google.protobuf.MapField.newMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + if (!annotations_.isMutable()) { + annotations_ = annotations_.copy(); + } + bitField0_ |= 0x00000010; + onChanged(); + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + /** + * + * + *
+     * Client-specified annotations.
+     * 
+ * + * map<string, string> annotations = 5; + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + /** + * + * + *
+     * Client-specified annotations.
+     * 
+ * + * map<string, string> annotations = 5; + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + /** + * + * + *
+     * Client-specified annotations.
+     * 
+ * + * map<string, string> annotations = 5; + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Client-specified annotations.
+     * 
+ * + * map<string, string> annotations = 5; + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAnnotations() { + bitField0_ = (bitField0_ & ~0x00000010); + internalGetMutableAnnotations().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Client-specified annotations.
+     * 
+ * + * map<string, string> annotations = 5; + */ + public Builder removeAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAnnotations().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableAnnotations() { + bitField0_ |= 0x00000010; + return internalGetMutableAnnotations().getMutableMap(); + } + /** + * + * + *
+     * Client-specified annotations.
+     * 
+ * + * map<string, string> annotations = 5; + */ + public Builder putAnnotations(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableAnnotations().getMutableMap().put(key, value); + bitField0_ |= 0x00000010; + return this; + } + /** + * + * + *
+     * Client-specified annotations.
+     * 
+ * + * map<string, string> annotations = 5; + */ + public Builder putAllAnnotations(java.util.Map values) { + internalGetMutableAnnotations().getMutableMap().putAll(values); + bitField0_ |= 0x00000010; + return this; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + bitField0_ |= 0x00000020; + onChanged(); + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Client-specified labels that are applied to the resource and that are also
+     * propagated to the underlying Compute Engine resources.
+     * 
+ * + * map<string, string> labels = 18; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Client-specified labels that are applied to the resource and that are also
+     * propagated to the underlying Compute Engine resources.
+     * 
+ * + * map<string, string> labels = 18; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Client-specified labels that are applied to the resource and that are also
+     * propagated to the underlying Compute Engine resources.
+     * 
+ * + * map<string, string> labels = 18; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Client-specified labels that are applied to the resource and that are also
+     * propagated to the underlying Compute Engine resources.
+     * 
+ * + * map<string, string> labels = 18; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + bitField0_ = (bitField0_ & ~0x00000020); + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Client-specified labels that are applied to the resource and that are also
+     * propagated to the underlying Compute Engine resources.
+     * 
+ * + * map<string, string> labels = 18; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + bitField0_ |= 0x00000020; + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Client-specified labels that are applied to the resource and that are also
+     * propagated to the underlying Compute Engine resources.
+     * 
+ * + * map<string, string> labels = 18; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00000020; + return this; + } + /** + * + * + *
+     * Client-specified labels that are applied to the resource and that are also
+     * propagated to the underlying Compute Engine resources.
+     * 
+ * + * map<string, string> labels = 18; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000020; + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. Time when this resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+     * Output only. Time when this resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Time when this resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when this resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when this resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when this resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000040); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when this resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Time when this resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. Time when this resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. Time when this resource was most recently updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * + * + *
+     * Output only. Time when this resource was most recently updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Time when this resource was most recently updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when this resource was most recently updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when this resource was most recently updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when this resource was most recently updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000080); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when this resource was most recently updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Time when this resource was most recently updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. Time when this resource was most recently updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private com.google.protobuf.Timestamp deleteTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + deleteTimeBuilder_; + /** + * + * + *
+     * Output only. Time when this resource was soft-deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + public boolean hasDeleteTime() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + * + * + *
+     * Output only. Time when this resource was soft-deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The deleteTime. + */ + public com.google.protobuf.Timestamp getDeleteTime() { + if (deleteTimeBuilder_ == null) { + return deleteTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : deleteTime_; + } else { + return deleteTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Time when this resource was soft-deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDeleteTime(com.google.protobuf.Timestamp value) { + if (deleteTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deleteTime_ = value; + } else { + deleteTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when this resource was soft-deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDeleteTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (deleteTimeBuilder_ == null) { + deleteTime_ = builderForValue.build(); + } else { + deleteTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when this resource was soft-deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeDeleteTime(com.google.protobuf.Timestamp value) { + if (deleteTimeBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && deleteTime_ != null + && deleteTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getDeleteTimeBuilder().mergeFrom(value); + } else { + deleteTime_ = value; + } + } else { + deleteTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when this resource was soft-deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearDeleteTime() { + bitField0_ = (bitField0_ & ~0x00000100); + deleteTime_ = null; + if (deleteTimeBuilder_ != null) { + deleteTimeBuilder_.dispose(); + deleteTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when this resource was soft-deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getDeleteTimeBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return getDeleteTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Time when this resource was soft-deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { + if (deleteTimeBuilder_ != null) { + return deleteTimeBuilder_.getMessageOrBuilder(); + } else { + return deleteTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : deleteTime_; + } + } + /** + * + * + *
+     * Output only. Time when this resource was soft-deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getDeleteTimeFieldBuilder() { + if (deleteTimeBuilder_ == null) { + deleteTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getDeleteTime(), getParentForChildren(), isClean()); + deleteTime_ = null; + } + return deleteTimeBuilder_; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * Checksum computed by the server. May be sent on update and delete requests
+     * to ensure that the client has an up-to-date value before proceeding.
+     * 
+ * + * string etag = 9; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Checksum computed by the server. May be sent on update and delete requests
+     * to ensure that the client has an up-to-date value before proceeding.
+     * 
+ * + * string etag = 9; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Checksum computed by the server. May be sent on update and delete requests
+     * to ensure that the client has an up-to-date value before proceeding.
+     * 
+ * + * string etag = 9; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Checksum computed by the server. May be sent on update and delete requests
+     * to ensure that the client has an up-to-date value before proceeding.
+     * 
+ * + * string etag = 9; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + return this; + } + /** + * + * + *
+     * Checksum computed by the server. May be sent on update and delete requests
+     * to ensure that the client has an up-to-date value before proceeding.
+     * 
+ * + * string etag = 9; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + private com.google.protobuf.Duration idleTimeout_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + idleTimeoutBuilder_; + /** + * + * + *
+     * How long to wait before automatically stopping an instance that hasn't
+     * received any user traffic. A value of 0 indicates that this instance
+     * should never time out due to idleness. Defaults to 20 minutes.
+     * 
+ * + * .google.protobuf.Duration idle_timeout = 10; + * + * @return Whether the idleTimeout field is set. + */ + public boolean hasIdleTimeout() { + return ((bitField0_ & 0x00000400) != 0); + } + /** + * + * + *
+     * How long to wait before automatically stopping an instance that hasn't
+     * received any user traffic. A value of 0 indicates that this instance
+     * should never time out due to idleness. Defaults to 20 minutes.
+     * 
+ * + * .google.protobuf.Duration idle_timeout = 10; + * + * @return The idleTimeout. + */ + public com.google.protobuf.Duration getIdleTimeout() { + if (idleTimeoutBuilder_ == null) { + return idleTimeout_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : idleTimeout_; + } else { + return idleTimeoutBuilder_.getMessage(); + } + } + /** + * + * + *
+     * How long to wait before automatically stopping an instance that hasn't
+     * received any user traffic. A value of 0 indicates that this instance
+     * should never time out due to idleness. Defaults to 20 minutes.
+     * 
+ * + * .google.protobuf.Duration idle_timeout = 10; + */ + public Builder setIdleTimeout(com.google.protobuf.Duration value) { + if (idleTimeoutBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + idleTimeout_ = value; + } else { + idleTimeoutBuilder_.setMessage(value); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * How long to wait before automatically stopping an instance that hasn't
+     * received any user traffic. A value of 0 indicates that this instance
+     * should never time out due to idleness. Defaults to 20 minutes.
+     * 
+ * + * .google.protobuf.Duration idle_timeout = 10; + */ + public Builder setIdleTimeout(com.google.protobuf.Duration.Builder builderForValue) { + if (idleTimeoutBuilder_ == null) { + idleTimeout_ = builderForValue.build(); + } else { + idleTimeoutBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * How long to wait before automatically stopping an instance that hasn't
+     * received any user traffic. A value of 0 indicates that this instance
+     * should never time out due to idleness. Defaults to 20 minutes.
+     * 
+ * + * .google.protobuf.Duration idle_timeout = 10; + */ + public Builder mergeIdleTimeout(com.google.protobuf.Duration value) { + if (idleTimeoutBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0) + && idleTimeout_ != null + && idleTimeout_ != com.google.protobuf.Duration.getDefaultInstance()) { + getIdleTimeoutBuilder().mergeFrom(value); + } else { + idleTimeout_ = value; + } + } else { + idleTimeoutBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * How long to wait before automatically stopping an instance that hasn't
+     * received any user traffic. A value of 0 indicates that this instance
+     * should never time out due to idleness. Defaults to 20 minutes.
+     * 
+ * + * .google.protobuf.Duration idle_timeout = 10; + */ + public Builder clearIdleTimeout() { + bitField0_ = (bitField0_ & ~0x00000400); + idleTimeout_ = null; + if (idleTimeoutBuilder_ != null) { + idleTimeoutBuilder_.dispose(); + idleTimeoutBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * How long to wait before automatically stopping an instance that hasn't
+     * received any user traffic. A value of 0 indicates that this instance
+     * should never time out due to idleness. Defaults to 20 minutes.
+     * 
+ * + * .google.protobuf.Duration idle_timeout = 10; + */ + public com.google.protobuf.Duration.Builder getIdleTimeoutBuilder() { + bitField0_ |= 0x00000400; + onChanged(); + return getIdleTimeoutFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * How long to wait before automatically stopping an instance that hasn't
+     * received any user traffic. A value of 0 indicates that this instance
+     * should never time out due to idleness. Defaults to 20 minutes.
+     * 
+ * + * .google.protobuf.Duration idle_timeout = 10; + */ + public com.google.protobuf.DurationOrBuilder getIdleTimeoutOrBuilder() { + if (idleTimeoutBuilder_ != null) { + return idleTimeoutBuilder_.getMessageOrBuilder(); + } else { + return idleTimeout_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : idleTimeout_; + } + } + /** + * + * + *
+     * How long to wait before automatically stopping an instance that hasn't
+     * received any user traffic. A value of 0 indicates that this instance
+     * should never time out due to idleness. Defaults to 20 minutes.
+     * 
+ * + * .google.protobuf.Duration idle_timeout = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getIdleTimeoutFieldBuilder() { + if (idleTimeoutBuilder_ == null) { + idleTimeoutBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getIdleTimeout(), getParentForChildren(), isClean()); + idleTimeout_ = null; + } + return idleTimeoutBuilder_; + } + + private com.google.protobuf.Duration runningTimeout_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + runningTimeoutBuilder_; + /** + * + * + *
+     * How long to wait before automatically stopping a workstation after it
+     * started. A value of 0 indicates that workstations using this configuration
+     * should never time out. Must be greater than 0 and less than 24 hours if
+     * encryption_key is set. Defaults to 12 hours.
+     * 
+ * + * .google.protobuf.Duration running_timeout = 11; + * + * @return Whether the runningTimeout field is set. + */ + public boolean hasRunningTimeout() { + return ((bitField0_ & 0x00000800) != 0); + } + /** + * + * + *
+     * How long to wait before automatically stopping a workstation after it
+     * started. A value of 0 indicates that workstations using this configuration
+     * should never time out. Must be greater than 0 and less than 24 hours if
+     * encryption_key is set. Defaults to 12 hours.
+     * 
+ * + * .google.protobuf.Duration running_timeout = 11; + * + * @return The runningTimeout. + */ + public com.google.protobuf.Duration getRunningTimeout() { + if (runningTimeoutBuilder_ == null) { + return runningTimeout_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : runningTimeout_; + } else { + return runningTimeoutBuilder_.getMessage(); + } + } + /** + * + * + *
+     * How long to wait before automatically stopping a workstation after it
+     * started. A value of 0 indicates that workstations using this configuration
+     * should never time out. Must be greater than 0 and less than 24 hours if
+     * encryption_key is set. Defaults to 12 hours.
+     * 
+ * + * .google.protobuf.Duration running_timeout = 11; + */ + public Builder setRunningTimeout(com.google.protobuf.Duration value) { + if (runningTimeoutBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + runningTimeout_ = value; + } else { + runningTimeoutBuilder_.setMessage(value); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * How long to wait before automatically stopping a workstation after it
+     * started. A value of 0 indicates that workstations using this configuration
+     * should never time out. Must be greater than 0 and less than 24 hours if
+     * encryption_key is set. Defaults to 12 hours.
+     * 
+ * + * .google.protobuf.Duration running_timeout = 11; + */ + public Builder setRunningTimeout(com.google.protobuf.Duration.Builder builderForValue) { + if (runningTimeoutBuilder_ == null) { + runningTimeout_ = builderForValue.build(); + } else { + runningTimeoutBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * How long to wait before automatically stopping a workstation after it
+     * started. A value of 0 indicates that workstations using this configuration
+     * should never time out. Must be greater than 0 and less than 24 hours if
+     * encryption_key is set. Defaults to 12 hours.
+     * 
+ * + * .google.protobuf.Duration running_timeout = 11; + */ + public Builder mergeRunningTimeout(com.google.protobuf.Duration value) { + if (runningTimeoutBuilder_ == null) { + if (((bitField0_ & 0x00000800) != 0) + && runningTimeout_ != null + && runningTimeout_ != com.google.protobuf.Duration.getDefaultInstance()) { + getRunningTimeoutBuilder().mergeFrom(value); + } else { + runningTimeout_ = value; + } + } else { + runningTimeoutBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * How long to wait before automatically stopping a workstation after it
+     * started. A value of 0 indicates that workstations using this configuration
+     * should never time out. Must be greater than 0 and less than 24 hours if
+     * encryption_key is set. Defaults to 12 hours.
+     * 
+ * + * .google.protobuf.Duration running_timeout = 11; + */ + public Builder clearRunningTimeout() { + bitField0_ = (bitField0_ & ~0x00000800); + runningTimeout_ = null; + if (runningTimeoutBuilder_ != null) { + runningTimeoutBuilder_.dispose(); + runningTimeoutBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * How long to wait before automatically stopping a workstation after it
+     * started. A value of 0 indicates that workstations using this configuration
+     * should never time out. Must be greater than 0 and less than 24 hours if
+     * encryption_key is set. Defaults to 12 hours.
+     * 
+ * + * .google.protobuf.Duration running_timeout = 11; + */ + public com.google.protobuf.Duration.Builder getRunningTimeoutBuilder() { + bitField0_ |= 0x00000800; + onChanged(); + return getRunningTimeoutFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * How long to wait before automatically stopping a workstation after it
+     * started. A value of 0 indicates that workstations using this configuration
+     * should never time out. Must be greater than 0 and less than 24 hours if
+     * encryption_key is set. Defaults to 12 hours.
+     * 
+ * + * .google.protobuf.Duration running_timeout = 11; + */ + public com.google.protobuf.DurationOrBuilder getRunningTimeoutOrBuilder() { + if (runningTimeoutBuilder_ != null) { + return runningTimeoutBuilder_.getMessageOrBuilder(); + } else { + return runningTimeout_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : runningTimeout_; + } + } + /** + * + * + *
+     * How long to wait before automatically stopping a workstation after it
+     * started. A value of 0 indicates that workstations using this configuration
+     * should never time out. Must be greater than 0 and less than 24 hours if
+     * encryption_key is set. Defaults to 12 hours.
+     * 
+ * + * .google.protobuf.Duration running_timeout = 11; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getRunningTimeoutFieldBuilder() { + if (runningTimeoutBuilder_ == null) { + runningTimeoutBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getRunningTimeout(), getParentForChildren(), isClean()); + runningTimeout_ = null; + } + return runningTimeoutBuilder_; + } + + private com.google.cloud.workstations.v1beta.WorkstationConfig.Host host_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationConfig.Host, + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.Builder, + com.google.cloud.workstations.v1beta.WorkstationConfig.HostOrBuilder> + hostBuilder_; + /** + * + * + *
+     * Runtime host for the workstation.
+     * 
+ * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host host = 12; + * + * @return Whether the host field is set. + */ + public boolean hasHost() { + return ((bitField0_ & 0x00001000) != 0); + } + /** + * + * + *
+     * Runtime host for the workstation.
+     * 
+ * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host host = 12; + * + * @return The host. + */ + public com.google.cloud.workstations.v1beta.WorkstationConfig.Host getHost() { + if (hostBuilder_ == null) { + return host_ == null + ? com.google.cloud.workstations.v1beta.WorkstationConfig.Host.getDefaultInstance() + : host_; + } else { + return hostBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Runtime host for the workstation.
+     * 
+ * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host host = 12; + */ + public Builder setHost(com.google.cloud.workstations.v1beta.WorkstationConfig.Host value) { + if (hostBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + host_ = value; + } else { + hostBuilder_.setMessage(value); + } + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * Runtime host for the workstation.
+     * 
+ * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host host = 12; + */ + public Builder setHost( + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.Builder builderForValue) { + if (hostBuilder_ == null) { + host_ = builderForValue.build(); + } else { + hostBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * Runtime host for the workstation.
+     * 
+ * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host host = 12; + */ + public Builder mergeHost(com.google.cloud.workstations.v1beta.WorkstationConfig.Host value) { + if (hostBuilder_ == null) { + if (((bitField0_ & 0x00001000) != 0) + && host_ != null + && host_ + != com.google.cloud.workstations.v1beta.WorkstationConfig.Host + .getDefaultInstance()) { + getHostBuilder().mergeFrom(value); + } else { + host_ = value; + } + } else { + hostBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * Runtime host for the workstation.
+     * 
+ * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host host = 12; + */ + public Builder clearHost() { + bitField0_ = (bitField0_ & ~0x00001000); + host_ = null; + if (hostBuilder_ != null) { + hostBuilder_.dispose(); + hostBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Runtime host for the workstation.
+     * 
+ * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host host = 12; + */ + public com.google.cloud.workstations.v1beta.WorkstationConfig.Host.Builder getHostBuilder() { + bitField0_ |= 0x00001000; + onChanged(); + return getHostFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Runtime host for the workstation.
+     * 
+ * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host host = 12; + */ + public com.google.cloud.workstations.v1beta.WorkstationConfig.HostOrBuilder getHostOrBuilder() { + if (hostBuilder_ != null) { + return hostBuilder_.getMessageOrBuilder(); + } else { + return host_ == null + ? com.google.cloud.workstations.v1beta.WorkstationConfig.Host.getDefaultInstance() + : host_; + } + } + /** + * + * + *
+     * Runtime host for the workstation.
+     * 
+ * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host host = 12; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationConfig.Host, + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.Builder, + com.google.cloud.workstations.v1beta.WorkstationConfig.HostOrBuilder> + getHostFieldBuilder() { + if (hostBuilder_ == null) { + hostBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationConfig.Host, + com.google.cloud.workstations.v1beta.WorkstationConfig.Host.Builder, + com.google.cloud.workstations.v1beta.WorkstationConfig.HostOrBuilder>( + getHost(), getParentForChildren(), isClean()); + host_ = null; + } + return hostBuilder_; + } + + private java.util.List< + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory> + persistentDirectories_ = java.util.Collections.emptyList(); + + private void ensurePersistentDirectoriesIsMutable() { + if (!((bitField0_ & 0x00002000) != 0)) { + persistentDirectories_ = + new java.util.ArrayList< + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory>( + persistentDirectories_); + bitField0_ |= 0x00002000; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory, + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.Builder, + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectoryOrBuilder> + persistentDirectoriesBuilder_; + + /** + * + * + *
+     * Directories to persist across workstation sessions.
+     * 
+ * + * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory persistent_directories = 13; + * + */ + public java.util.List< + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory> + getPersistentDirectoriesList() { + if (persistentDirectoriesBuilder_ == null) { + return java.util.Collections.unmodifiableList(persistentDirectories_); + } else { + return persistentDirectoriesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Directories to persist across workstation sessions.
+     * 
+ * + * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory persistent_directories = 13; + * + */ + public int getPersistentDirectoriesCount() { + if (persistentDirectoriesBuilder_ == null) { + return persistentDirectories_.size(); + } else { + return persistentDirectoriesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Directories to persist across workstation sessions.
+     * 
+ * + * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory persistent_directories = 13; + * + */ + public com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + getPersistentDirectories(int index) { + if (persistentDirectoriesBuilder_ == null) { + return persistentDirectories_.get(index); + } else { + return persistentDirectoriesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Directories to persist across workstation sessions.
+     * 
+ * + * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory persistent_directories = 13; + * + */ + public Builder setPersistentDirectories( + int index, + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory value) { + if (persistentDirectoriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePersistentDirectoriesIsMutable(); + persistentDirectories_.set(index, value); + onChanged(); + } else { + persistentDirectoriesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Directories to persist across workstation sessions.
+     * 
+ * + * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory persistent_directories = 13; + * + */ + public Builder setPersistentDirectories( + int index, + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.Builder + builderForValue) { + if (persistentDirectoriesBuilder_ == null) { + ensurePersistentDirectoriesIsMutable(); + persistentDirectories_.set(index, builderForValue.build()); + onChanged(); + } else { + persistentDirectoriesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Directories to persist across workstation sessions.
+     * 
+ * + * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory persistent_directories = 13; + * + */ + public Builder addPersistentDirectories( + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory value) { + if (persistentDirectoriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePersistentDirectoriesIsMutable(); + persistentDirectories_.add(value); + onChanged(); + } else { + persistentDirectoriesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Directories to persist across workstation sessions.
+     * 
+ * + * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory persistent_directories = 13; + * + */ + public Builder addPersistentDirectories( + int index, + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory value) { + if (persistentDirectoriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePersistentDirectoriesIsMutable(); + persistentDirectories_.add(index, value); + onChanged(); + } else { + persistentDirectoriesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Directories to persist across workstation sessions.
+     * 
+ * + * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory persistent_directories = 13; + * + */ + public Builder addPersistentDirectories( + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.Builder + builderForValue) { + if (persistentDirectoriesBuilder_ == null) { + ensurePersistentDirectoriesIsMutable(); + persistentDirectories_.add(builderForValue.build()); + onChanged(); + } else { + persistentDirectoriesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Directories to persist across workstation sessions.
+     * 
+ * + * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory persistent_directories = 13; + * + */ + public Builder addPersistentDirectories( + int index, + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.Builder + builderForValue) { + if (persistentDirectoriesBuilder_ == null) { + ensurePersistentDirectoriesIsMutable(); + persistentDirectories_.add(index, builderForValue.build()); + onChanged(); + } else { + persistentDirectoriesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Directories to persist across workstation sessions.
+     * 
+ * + * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory persistent_directories = 13; + * + */ + public Builder addAllPersistentDirectories( + java.lang.Iterable< + ? extends + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory> + values) { + if (persistentDirectoriesBuilder_ == null) { + ensurePersistentDirectoriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, persistentDirectories_); + onChanged(); + } else { + persistentDirectoriesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Directories to persist across workstation sessions.
+     * 
+ * + * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory persistent_directories = 13; + * + */ + public Builder clearPersistentDirectories() { + if (persistentDirectoriesBuilder_ == null) { + persistentDirectories_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00002000); + onChanged(); + } else { + persistentDirectoriesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Directories to persist across workstation sessions.
+     * 
+ * + * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory persistent_directories = 13; + * + */ + public Builder removePersistentDirectories(int index) { + if (persistentDirectoriesBuilder_ == null) { + ensurePersistentDirectoriesIsMutable(); + persistentDirectories_.remove(index); + onChanged(); + } else { + persistentDirectoriesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Directories to persist across workstation sessions.
+     * 
+ * + * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory persistent_directories = 13; + * + */ + public com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.Builder + getPersistentDirectoriesBuilder(int index) { + return getPersistentDirectoriesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Directories to persist across workstation sessions.
+     * 
+ * + * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory persistent_directories = 13; + * + */ + public com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectoryOrBuilder + getPersistentDirectoriesOrBuilder(int index) { + if (persistentDirectoriesBuilder_ == null) { + return persistentDirectories_.get(index); + } else { + return persistentDirectoriesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Directories to persist across workstation sessions.
+     * 
+ * + * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory persistent_directories = 13; + * + */ + public java.util.List< + ? extends + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectoryOrBuilder> + getPersistentDirectoriesOrBuilderList() { + if (persistentDirectoriesBuilder_ != null) { + return persistentDirectoriesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(persistentDirectories_); + } + } + /** + * + * + *
+     * Directories to persist across workstation sessions.
+     * 
+ * + * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory persistent_directories = 13; + * + */ + public com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.Builder + addPersistentDirectoriesBuilder() { + return getPersistentDirectoriesFieldBuilder() + .addBuilder( + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .getDefaultInstance()); + } + /** + * + * + *
+     * Directories to persist across workstation sessions.
+     * 
+ * + * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory persistent_directories = 13; + * + */ + public com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.Builder + addPersistentDirectoriesBuilder(int index) { + return getPersistentDirectoriesFieldBuilder() + .addBuilder( + index, + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + .getDefaultInstance()); + } + /** + * + * + *
+     * Directories to persist across workstation sessions.
+     * 
+ * + * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory persistent_directories = 13; + * + */ + public java.util.List< + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.Builder> + getPersistentDirectoriesBuilderList() { + return getPersistentDirectoriesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory, + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.Builder, + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectoryOrBuilder> + getPersistentDirectoriesFieldBuilder() { + if (persistentDirectoriesBuilder_ == null) { + persistentDirectoriesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory, + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.Builder, + com.google.cloud.workstations.v1beta.WorkstationConfig + .PersistentDirectoryOrBuilder>( + persistentDirectories_, + ((bitField0_ & 0x00002000) != 0), + getParentForChildren(), + isClean()); + persistentDirectories_ = null; + } + return persistentDirectoriesBuilder_; + } + + private com.google.cloud.workstations.v1beta.WorkstationConfig.Container container_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationConfig.Container, + com.google.cloud.workstations.v1beta.WorkstationConfig.Container.Builder, + com.google.cloud.workstations.v1beta.WorkstationConfig.ContainerOrBuilder> + containerBuilder_; + /** + * + * + *
+     * Container that will be run for each workstation using this configuration
+     * when that workstation is started.
+     * 
+ * + * .google.cloud.workstations.v1beta.WorkstationConfig.Container container = 14; + * + * @return Whether the container field is set. + */ + public boolean hasContainer() { + return ((bitField0_ & 0x00004000) != 0); + } + /** + * + * + *
+     * Container that will be run for each workstation using this configuration
+     * when that workstation is started.
+     * 
+ * + * .google.cloud.workstations.v1beta.WorkstationConfig.Container container = 14; + * + * @return The container. + */ + public com.google.cloud.workstations.v1beta.WorkstationConfig.Container getContainer() { + if (containerBuilder_ == null) { + return container_ == null + ? com.google.cloud.workstations.v1beta.WorkstationConfig.Container.getDefaultInstance() + : container_; + } else { + return containerBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Container that will be run for each workstation using this configuration
+     * when that workstation is started.
+     * 
+ * + * .google.cloud.workstations.v1beta.WorkstationConfig.Container container = 14; + */ + public Builder setContainer( + com.google.cloud.workstations.v1beta.WorkstationConfig.Container value) { + if (containerBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + container_ = value; + } else { + containerBuilder_.setMessage(value); + } + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * + * + *
+     * Container that will be run for each workstation using this configuration
+     * when that workstation is started.
+     * 
+ * + * .google.cloud.workstations.v1beta.WorkstationConfig.Container container = 14; + */ + public Builder setContainer( + com.google.cloud.workstations.v1beta.WorkstationConfig.Container.Builder builderForValue) { + if (containerBuilder_ == null) { + container_ = builderForValue.build(); + } else { + containerBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * + * + *
+     * Container that will be run for each workstation using this configuration
+     * when that workstation is started.
+     * 
+ * + * .google.cloud.workstations.v1beta.WorkstationConfig.Container container = 14; + */ + public Builder mergeContainer( + com.google.cloud.workstations.v1beta.WorkstationConfig.Container value) { + if (containerBuilder_ == null) { + if (((bitField0_ & 0x00004000) != 0) + && container_ != null + && container_ + != com.google.cloud.workstations.v1beta.WorkstationConfig.Container + .getDefaultInstance()) { + getContainerBuilder().mergeFrom(value); + } else { + container_ = value; + } + } else { + containerBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * + * + *
+     * Container that will be run for each workstation using this configuration
+     * when that workstation is started.
+     * 
+ * + * .google.cloud.workstations.v1beta.WorkstationConfig.Container container = 14; + */ + public Builder clearContainer() { + bitField0_ = (bitField0_ & ~0x00004000); + container_ = null; + if (containerBuilder_ != null) { + containerBuilder_.dispose(); + containerBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Container that will be run for each workstation using this configuration
+     * when that workstation is started.
+     * 
+ * + * .google.cloud.workstations.v1beta.WorkstationConfig.Container container = 14; + */ + public com.google.cloud.workstations.v1beta.WorkstationConfig.Container.Builder + getContainerBuilder() { + bitField0_ |= 0x00004000; + onChanged(); + return getContainerFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Container that will be run for each workstation using this configuration
+     * when that workstation is started.
+     * 
+ * + * .google.cloud.workstations.v1beta.WorkstationConfig.Container container = 14; + */ + public com.google.cloud.workstations.v1beta.WorkstationConfig.ContainerOrBuilder + getContainerOrBuilder() { + if (containerBuilder_ != null) { + return containerBuilder_.getMessageOrBuilder(); + } else { + return container_ == null + ? com.google.cloud.workstations.v1beta.WorkstationConfig.Container.getDefaultInstance() + : container_; + } + } + /** + * + * + *
+     * Container that will be run for each workstation using this configuration
+     * when that workstation is started.
+     * 
+ * + * .google.cloud.workstations.v1beta.WorkstationConfig.Container container = 14; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationConfig.Container, + com.google.cloud.workstations.v1beta.WorkstationConfig.Container.Builder, + com.google.cloud.workstations.v1beta.WorkstationConfig.ContainerOrBuilder> + getContainerFieldBuilder() { + if (containerBuilder_ == null) { + containerBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationConfig.Container, + com.google.cloud.workstations.v1beta.WorkstationConfig.Container.Builder, + com.google.cloud.workstations.v1beta.WorkstationConfig.ContainerOrBuilder>( + getContainer(), getParentForChildren(), isClean()); + container_ = null; + } + return containerBuilder_; + } + + private com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey + encryptionKey_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey, + com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey.Builder, + com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKeyOrBuilder> + encryptionKeyBuilder_; + /** + * + * + *
+     * Encrypts resources of this workstation configuration using a
+     * customer-managed encryption key.
+     * If specified, the boot disk of the Compute Engine instance and the
+     * persistent disk are encrypted using this encryption key. If
+     * this field is not set, the disks are encrypted using a generated
+     * key. Customer-managed encryption keys do not protect disk metadata.
+     * If the customer-managed encryption key is rotated, when the workstation
+     * instance is stopped, the system attempts to recreate the
+     * persistent disk with the new version of the key. Be sure to keep
+     * older versions of the key until the persistent disk is recreated.
+     * Otherwise, data on the persistent disk will be lost.
+     * If the encryption key is revoked, the workstation session will
+     * automatically be stopped within 7 hours.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey encryption_key = 17; + * + * + * @return Whether the encryptionKey field is set. + */ + public boolean hasEncryptionKey() { + return ((bitField0_ & 0x00008000) != 0); + } + /** + * + * + *
+     * Encrypts resources of this workstation configuration using a
+     * customer-managed encryption key.
+     * If specified, the boot disk of the Compute Engine instance and the
+     * persistent disk are encrypted using this encryption key. If
+     * this field is not set, the disks are encrypted using a generated
+     * key. Customer-managed encryption keys do not protect disk metadata.
+     * If the customer-managed encryption key is rotated, when the workstation
+     * instance is stopped, the system attempts to recreate the
+     * persistent disk with the new version of the key. Be sure to keep
+     * older versions of the key until the persistent disk is recreated.
+     * Otherwise, data on the persistent disk will be lost.
+     * If the encryption key is revoked, the workstation session will
+     * automatically be stopped within 7 hours.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey encryption_key = 17; + * + * + * @return The encryptionKey. + */ + public com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey + getEncryptionKey() { + if (encryptionKeyBuilder_ == null) { + return encryptionKey_ == null + ? com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey + .getDefaultInstance() + : encryptionKey_; + } else { + return encryptionKeyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Encrypts resources of this workstation configuration using a
+     * customer-managed encryption key.
+     * If specified, the boot disk of the Compute Engine instance and the
+     * persistent disk are encrypted using this encryption key. If
+     * this field is not set, the disks are encrypted using a generated
+     * key. Customer-managed encryption keys do not protect disk metadata.
+     * If the customer-managed encryption key is rotated, when the workstation
+     * instance is stopped, the system attempts to recreate the
+     * persistent disk with the new version of the key. Be sure to keep
+     * older versions of the key until the persistent disk is recreated.
+     * Otherwise, data on the persistent disk will be lost.
+     * If the encryption key is revoked, the workstation session will
+     * automatically be stopped within 7 hours.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey encryption_key = 17; + * + */ + public Builder setEncryptionKey( + com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey value) { + if (encryptionKeyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encryptionKey_ = value; + } else { + encryptionKeyBuilder_.setMessage(value); + } + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * + * + *
+     * Encrypts resources of this workstation configuration using a
+     * customer-managed encryption key.
+     * If specified, the boot disk of the Compute Engine instance and the
+     * persistent disk are encrypted using this encryption key. If
+     * this field is not set, the disks are encrypted using a generated
+     * key. Customer-managed encryption keys do not protect disk metadata.
+     * If the customer-managed encryption key is rotated, when the workstation
+     * instance is stopped, the system attempts to recreate the
+     * persistent disk with the new version of the key. Be sure to keep
+     * older versions of the key until the persistent disk is recreated.
+     * Otherwise, data on the persistent disk will be lost.
+     * If the encryption key is revoked, the workstation session will
+     * automatically be stopped within 7 hours.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey encryption_key = 17; + * + */ + public Builder setEncryptionKey( + com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey.Builder + builderForValue) { + if (encryptionKeyBuilder_ == null) { + encryptionKey_ = builderForValue.build(); + } else { + encryptionKeyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * + * + *
+     * Encrypts resources of this workstation configuration using a
+     * customer-managed encryption key.
+     * If specified, the boot disk of the Compute Engine instance and the
+     * persistent disk are encrypted using this encryption key. If
+     * this field is not set, the disks are encrypted using a generated
+     * key. Customer-managed encryption keys do not protect disk metadata.
+     * If the customer-managed encryption key is rotated, when the workstation
+     * instance is stopped, the system attempts to recreate the
+     * persistent disk with the new version of the key. Be sure to keep
+     * older versions of the key until the persistent disk is recreated.
+     * Otherwise, data on the persistent disk will be lost.
+     * If the encryption key is revoked, the workstation session will
+     * automatically be stopped within 7 hours.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey encryption_key = 17; + * + */ + public Builder mergeEncryptionKey( + com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey value) { + if (encryptionKeyBuilder_ == null) { + if (((bitField0_ & 0x00008000) != 0) + && encryptionKey_ != null + && encryptionKey_ + != com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey + .getDefaultInstance()) { + getEncryptionKeyBuilder().mergeFrom(value); + } else { + encryptionKey_ = value; + } + } else { + encryptionKeyBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * + * + *
+     * Encrypts resources of this workstation configuration using a
+     * customer-managed encryption key.
+     * If specified, the boot disk of the Compute Engine instance and the
+     * persistent disk are encrypted using this encryption key. If
+     * this field is not set, the disks are encrypted using a generated
+     * key. Customer-managed encryption keys do not protect disk metadata.
+     * If the customer-managed encryption key is rotated, when the workstation
+     * instance is stopped, the system attempts to recreate the
+     * persistent disk with the new version of the key. Be sure to keep
+     * older versions of the key until the persistent disk is recreated.
+     * Otherwise, data on the persistent disk will be lost.
+     * If the encryption key is revoked, the workstation session will
+     * automatically be stopped within 7 hours.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey encryption_key = 17; + * + */ + public Builder clearEncryptionKey() { + bitField0_ = (bitField0_ & ~0x00008000); + encryptionKey_ = null; + if (encryptionKeyBuilder_ != null) { + encryptionKeyBuilder_.dispose(); + encryptionKeyBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Encrypts resources of this workstation configuration using a
+     * customer-managed encryption key.
+     * If specified, the boot disk of the Compute Engine instance and the
+     * persistent disk are encrypted using this encryption key. If
+     * this field is not set, the disks are encrypted using a generated
+     * key. Customer-managed encryption keys do not protect disk metadata.
+     * If the customer-managed encryption key is rotated, when the workstation
+     * instance is stopped, the system attempts to recreate the
+     * persistent disk with the new version of the key. Be sure to keep
+     * older versions of the key until the persistent disk is recreated.
+     * Otherwise, data on the persistent disk will be lost.
+     * If the encryption key is revoked, the workstation session will
+     * automatically be stopped within 7 hours.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey encryption_key = 17; + * + */ + public com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey.Builder + getEncryptionKeyBuilder() { + bitField0_ |= 0x00008000; + onChanged(); + return getEncryptionKeyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Encrypts resources of this workstation configuration using a
+     * customer-managed encryption key.
+     * If specified, the boot disk of the Compute Engine instance and the
+     * persistent disk are encrypted using this encryption key. If
+     * this field is not set, the disks are encrypted using a generated
+     * key. Customer-managed encryption keys do not protect disk metadata.
+     * If the customer-managed encryption key is rotated, when the workstation
+     * instance is stopped, the system attempts to recreate the
+     * persistent disk with the new version of the key. Be sure to keep
+     * older versions of the key until the persistent disk is recreated.
+     * Otherwise, data on the persistent disk will be lost.
+     * If the encryption key is revoked, the workstation session will
+     * automatically be stopped within 7 hours.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey encryption_key = 17; + * + */ + public com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKeyOrBuilder + getEncryptionKeyOrBuilder() { + if (encryptionKeyBuilder_ != null) { + return encryptionKeyBuilder_.getMessageOrBuilder(); + } else { + return encryptionKey_ == null + ? com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey + .getDefaultInstance() + : encryptionKey_; + } + } + /** + * + * + *
+     * Encrypts resources of this workstation configuration using a
+     * customer-managed encryption key.
+     * If specified, the boot disk of the Compute Engine instance and the
+     * persistent disk are encrypted using this encryption key. If
+     * this field is not set, the disks are encrypted using a generated
+     * key. Customer-managed encryption keys do not protect disk metadata.
+     * If the customer-managed encryption key is rotated, when the workstation
+     * instance is stopped, the system attempts to recreate the
+     * persistent disk with the new version of the key. Be sure to keep
+     * older versions of the key until the persistent disk is recreated.
+     * Otherwise, data on the persistent disk will be lost.
+     * If the encryption key is revoked, the workstation session will
+     * automatically be stopped within 7 hours.
+     * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey encryption_key = 17; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey, + com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey.Builder, + com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKeyOrBuilder> + getEncryptionKeyFieldBuilder() { + if (encryptionKeyBuilder_ == null) { + encryptionKeyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey, + com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey + .Builder, + com.google.cloud.workstations.v1beta.WorkstationConfig + .CustomerEncryptionKeyOrBuilder>( + getEncryptionKey(), getParentForChildren(), isClean()); + encryptionKey_ = null; + } + return encryptionKeyBuilder_; + } + + private boolean degraded_; + /** + * + * + *
+     * Output only. Whether this resource is in degraded mode, in which case it
+     * may require user action to restore full functionality. Details can be found
+     * in the `conditions` field.
+     * 
+ * + * bool degraded = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The degraded. + */ + @java.lang.Override + public boolean getDegraded() { + return degraded_; + } + /** + * + * + *
+     * Output only. Whether this resource is in degraded mode, in which case it
+     * may require user action to restore full functionality. Details can be found
+     * in the `conditions` field.
+     * 
+ * + * bool degraded = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The degraded to set. + * @return This builder for chaining. + */ + public Builder setDegraded(boolean value) { + + degraded_ = value; + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Whether this resource is in degraded mode, in which case it
+     * may require user action to restore full functionality. Details can be found
+     * in the `conditions` field.
+     * 
+ * + * bool degraded = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDegraded() { + bitField0_ = (bitField0_ & ~0x00010000); + degraded_ = false; + onChanged(); + return this; + } + + private java.util.List conditions_ = java.util.Collections.emptyList(); + + private void ensureConditionsIsMutable() { + if (!((bitField0_ & 0x00020000) != 0)) { + conditions_ = new java.util.ArrayList(conditions_); + bitField0_ |= 0x00020000; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + conditionsBuilder_; + + /** + * + * + *
+     * Output only. Status conditions describing the current resource state.
+     * 
+ * + * + * repeated .google.rpc.Status conditions = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getConditionsList() { + if (conditionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(conditions_); + } else { + return conditionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. Status conditions describing the current resource state.
+     * 
+ * + * + * repeated .google.rpc.Status conditions = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getConditionsCount() { + if (conditionsBuilder_ == null) { + return conditions_.size(); + } else { + return conditionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. Status conditions describing the current resource state.
+     * 
+ * + * + * repeated .google.rpc.Status conditions = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.rpc.Status getConditions(int index) { + if (conditionsBuilder_ == null) { + return conditions_.get(index); + } else { + return conditionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. Status conditions describing the current resource state.
+     * 
+ * + * + * repeated .google.rpc.Status conditions = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setConditions(int index, com.google.rpc.Status value) { + if (conditionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConditionsIsMutable(); + conditions_.set(index, value); + onChanged(); + } else { + conditionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Status conditions describing the current resource state.
+     * 
+ * + * + * repeated .google.rpc.Status conditions = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setConditions(int index, com.google.rpc.Status.Builder builderForValue) { + if (conditionsBuilder_ == null) { + ensureConditionsIsMutable(); + conditions_.set(index, builderForValue.build()); + onChanged(); + } else { + conditionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Status conditions describing the current resource state.
+     * 
+ * + * + * repeated .google.rpc.Status conditions = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addConditions(com.google.rpc.Status value) { + if (conditionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConditionsIsMutable(); + conditions_.add(value); + onChanged(); + } else { + conditionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. Status conditions describing the current resource state.
+     * 
+ * + * + * repeated .google.rpc.Status conditions = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addConditions(int index, com.google.rpc.Status value) { + if (conditionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConditionsIsMutable(); + conditions_.add(index, value); + onChanged(); + } else { + conditionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Status conditions describing the current resource state.
+     * 
+ * + * + * repeated .google.rpc.Status conditions = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addConditions(com.google.rpc.Status.Builder builderForValue) { + if (conditionsBuilder_ == null) { + ensureConditionsIsMutable(); + conditions_.add(builderForValue.build()); + onChanged(); + } else { + conditionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Status conditions describing the current resource state.
+     * 
+ * + * + * repeated .google.rpc.Status conditions = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addConditions(int index, com.google.rpc.Status.Builder builderForValue) { + if (conditionsBuilder_ == null) { + ensureConditionsIsMutable(); + conditions_.add(index, builderForValue.build()); + onChanged(); + } else { + conditionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Status conditions describing the current resource state.
+     * 
+ * + * + * repeated .google.rpc.Status conditions = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllConditions(java.lang.Iterable values) { + if (conditionsBuilder_ == null) { + ensureConditionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, conditions_); + onChanged(); + } else { + conditionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. Status conditions describing the current resource state.
+     * 
+ * + * + * repeated .google.rpc.Status conditions = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearConditions() { + if (conditionsBuilder_ == null) { + conditions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00020000); + onChanged(); + } else { + conditionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. Status conditions describing the current resource state.
+     * 
+ * + * + * repeated .google.rpc.Status conditions = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeConditions(int index) { + if (conditionsBuilder_ == null) { + ensureConditionsIsMutable(); + conditions_.remove(index); + onChanged(); + } else { + conditionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. Status conditions describing the current resource state.
+     * 
+ * + * + * repeated .google.rpc.Status conditions = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.rpc.Status.Builder getConditionsBuilder(int index) { + return getConditionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. Status conditions describing the current resource state.
+     * 
+ * + * + * repeated .google.rpc.Status conditions = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.rpc.StatusOrBuilder getConditionsOrBuilder(int index) { + if (conditionsBuilder_ == null) { + return conditions_.get(index); + } else { + return conditionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. Status conditions describing the current resource state.
+     * 
+ * + * + * repeated .google.rpc.Status conditions = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getConditionsOrBuilderList() { + if (conditionsBuilder_ != null) { + return conditionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(conditions_); + } + } + /** + * + * + *
+     * Output only. Status conditions describing the current resource state.
+     * 
+ * + * + * repeated .google.rpc.Status conditions = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.rpc.Status.Builder addConditionsBuilder() { + return getConditionsFieldBuilder().addBuilder(com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Status conditions describing the current resource state.
+     * 
+ * + * + * repeated .google.rpc.Status conditions = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.rpc.Status.Builder addConditionsBuilder(int index) { + return getConditionsFieldBuilder() + .addBuilder(index, com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Status conditions describing the current resource state.
+     * 
+ * + * + * repeated .google.rpc.Status conditions = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getConditionsBuilderList() { + return getConditionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getConditionsFieldBuilder() { + if (conditionsBuilder_ == null) { + conditionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>( + conditions_, ((bitField0_ & 0x00020000) != 0), getParentForChildren(), isClean()); + conditions_ = null; + } + return conditionsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workstations.v1beta.WorkstationConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workstations.v1beta.WorkstationConfig) + private static final com.google.cloud.workstations.v1beta.WorkstationConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workstations.v1beta.WorkstationConfig(); + } + + public static com.google.cloud.workstations.v1beta.WorkstationConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WorkstationConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workstations.v1beta.WorkstationConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/WorkstationConfigName.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/WorkstationConfigName.java new file mode 100644 index 000000000000..c195bc5d17ae --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/WorkstationConfigName.java @@ -0,0 +1,269 @@ +/* + * Copyright 2022 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.workstations.v1beta; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class WorkstationConfigName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_WORKSTATION_CLUSTER_WORKSTATION_CONFIG = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}/workstationConfigs/{workstation_config}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String workstationCluster; + private final String workstationConfig; + + @Deprecated + protected WorkstationConfigName() { + project = null; + location = null; + workstationCluster = null; + workstationConfig = null; + } + + private WorkstationConfigName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + workstationCluster = Preconditions.checkNotNull(builder.getWorkstationCluster()); + workstationConfig = Preconditions.checkNotNull(builder.getWorkstationConfig()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getWorkstationCluster() { + return workstationCluster; + } + + public String getWorkstationConfig() { + return workstationConfig; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static WorkstationConfigName of( + String project, String location, String workstationCluster, String workstationConfig) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setWorkstationCluster(workstationCluster) + .setWorkstationConfig(workstationConfig) + .build(); + } + + public static String format( + String project, String location, String workstationCluster, String workstationConfig) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setWorkstationCluster(workstationCluster) + .setWorkstationConfig(workstationConfig) + .build() + .toString(); + } + + public static WorkstationConfigName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_WORKSTATION_CLUSTER_WORKSTATION_CONFIG.validatedMatch( + formattedString, "WorkstationConfigName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("workstation_cluster"), + matchMap.get("workstation_config")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (WorkstationConfigName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_WORKSTATION_CLUSTER_WORKSTATION_CONFIG.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (workstationCluster != null) { + fieldMapBuilder.put("workstation_cluster", workstationCluster); + } + if (workstationConfig != null) { + fieldMapBuilder.put("workstation_config", workstationConfig); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_WORKSTATION_CLUSTER_WORKSTATION_CONFIG.instantiate( + "project", + project, + "location", + location, + "workstation_cluster", + workstationCluster, + "workstation_config", + workstationConfig); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + WorkstationConfigName that = ((WorkstationConfigName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.workstationCluster, that.workstationCluster) + && Objects.equals(this.workstationConfig, that.workstationConfig); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(workstationCluster); + h *= 1000003; + h ^= Objects.hashCode(workstationConfig); + return h; + } + + /** + * Builder for + * projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}/workstationConfigs/{workstation_config}. + */ + public static class Builder { + private String project; + private String location; + private String workstationCluster; + private String workstationConfig; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getWorkstationCluster() { + return workstationCluster; + } + + public String getWorkstationConfig() { + return workstationConfig; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setWorkstationCluster(String workstationCluster) { + this.workstationCluster = workstationCluster; + return this; + } + + public Builder setWorkstationConfig(String workstationConfig) { + this.workstationConfig = workstationConfig; + return this; + } + + private Builder(WorkstationConfigName workstationConfigName) { + this.project = workstationConfigName.project; + this.location = workstationConfigName.location; + this.workstationCluster = workstationConfigName.workstationCluster; + this.workstationConfig = workstationConfigName.workstationConfig; + } + + public WorkstationConfigName build() { + return new WorkstationConfigName(this); + } + } +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/WorkstationConfigOrBuilder.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/WorkstationConfigOrBuilder.java new file mode 100644 index 000000000000..72d9e2353375 --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/WorkstationConfigOrBuilder.java @@ -0,0 +1,750 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +public interface WorkstationConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workstations.v1beta.WorkstationConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Full name of this resource.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Full name of this resource.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Human-readable name for this resource.
+   * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Human-readable name for this resource.
+   * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Output only. A system-assigned unique identified for this resource.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + java.lang.String getUid(); + /** + * + * + *
+   * Output only. A system-assigned unique identified for this resource.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + com.google.protobuf.ByteString getUidBytes(); + + /** + * + * + *
+   * Output only. Indicates whether this resource is currently being updated to
+   * match its intended state.
+   * 
+ * + * bool reconciling = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + boolean getReconciling(); + + /** + * + * + *
+   * Client-specified annotations.
+   * 
+ * + * map<string, string> annotations = 5; + */ + int getAnnotationsCount(); + /** + * + * + *
+   * Client-specified annotations.
+   * 
+ * + * map<string, string> annotations = 5; + */ + boolean containsAnnotations(java.lang.String key); + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getAnnotations(); + /** + * + * + *
+   * Client-specified annotations.
+   * 
+ * + * map<string, string> annotations = 5; + */ + java.util.Map getAnnotationsMap(); + /** + * + * + *
+   * Client-specified annotations.
+   * 
+ * + * map<string, string> annotations = 5; + */ + /* nullable */ + java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Client-specified annotations.
+   * 
+ * + * map<string, string> annotations = 5; + */ + java.lang.String getAnnotationsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Client-specified labels that are applied to the resource and that are also
+   * propagated to the underlying Compute Engine resources.
+   * 
+ * + * map<string, string> labels = 18; + */ + int getLabelsCount(); + /** + * + * + *
+   * Client-specified labels that are applied to the resource and that are also
+   * propagated to the underlying Compute Engine resources.
+   * 
+ * + * map<string, string> labels = 18; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Client-specified labels that are applied to the resource and that are also
+   * propagated to the underlying Compute Engine resources.
+   * 
+ * + * map<string, string> labels = 18; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Client-specified labels that are applied to the resource and that are also
+   * propagated to the underlying Compute Engine resources.
+   * 
+ * + * map<string, string> labels = 18; + */ + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Client-specified labels that are applied to the resource and that are also
+   * propagated to the underlying Compute Engine resources.
+   * 
+ * + * map<string, string> labels = 18; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. Time when this resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Time when this resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Time when this resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Time when this resource was most recently updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. Time when this resource was most recently updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. Time when this resource was most recently updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Time when this resource was soft-deleted.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + boolean hasDeleteTime(); + /** + * + * + *
+   * Output only. Time when this resource was soft-deleted.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The deleteTime. + */ + com.google.protobuf.Timestamp getDeleteTime(); + /** + * + * + *
+   * Output only. Time when this resource was soft-deleted.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder(); + + /** + * + * + *
+   * Checksum computed by the server. May be sent on update and delete requests
+   * to ensure that the client has an up-to-date value before proceeding.
+   * 
+ * + * string etag = 9; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * Checksum computed by the server. May be sent on update and delete requests
+   * to ensure that the client has an up-to-date value before proceeding.
+   * 
+ * + * string etag = 9; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * How long to wait before automatically stopping an instance that hasn't
+   * received any user traffic. A value of 0 indicates that this instance
+   * should never time out due to idleness. Defaults to 20 minutes.
+   * 
+ * + * .google.protobuf.Duration idle_timeout = 10; + * + * @return Whether the idleTimeout field is set. + */ + boolean hasIdleTimeout(); + /** + * + * + *
+   * How long to wait before automatically stopping an instance that hasn't
+   * received any user traffic. A value of 0 indicates that this instance
+   * should never time out due to idleness. Defaults to 20 minutes.
+   * 
+ * + * .google.protobuf.Duration idle_timeout = 10; + * + * @return The idleTimeout. + */ + com.google.protobuf.Duration getIdleTimeout(); + /** + * + * + *
+   * How long to wait before automatically stopping an instance that hasn't
+   * received any user traffic. A value of 0 indicates that this instance
+   * should never time out due to idleness. Defaults to 20 minutes.
+   * 
+ * + * .google.protobuf.Duration idle_timeout = 10; + */ + com.google.protobuf.DurationOrBuilder getIdleTimeoutOrBuilder(); + + /** + * + * + *
+   * How long to wait before automatically stopping a workstation after it
+   * started. A value of 0 indicates that workstations using this configuration
+   * should never time out. Must be greater than 0 and less than 24 hours if
+   * encryption_key is set. Defaults to 12 hours.
+   * 
+ * + * .google.protobuf.Duration running_timeout = 11; + * + * @return Whether the runningTimeout field is set. + */ + boolean hasRunningTimeout(); + /** + * + * + *
+   * How long to wait before automatically stopping a workstation after it
+   * started. A value of 0 indicates that workstations using this configuration
+   * should never time out. Must be greater than 0 and less than 24 hours if
+   * encryption_key is set. Defaults to 12 hours.
+   * 
+ * + * .google.protobuf.Duration running_timeout = 11; + * + * @return The runningTimeout. + */ + com.google.protobuf.Duration getRunningTimeout(); + /** + * + * + *
+   * How long to wait before automatically stopping a workstation after it
+   * started. A value of 0 indicates that workstations using this configuration
+   * should never time out. Must be greater than 0 and less than 24 hours if
+   * encryption_key is set. Defaults to 12 hours.
+   * 
+ * + * .google.protobuf.Duration running_timeout = 11; + */ + com.google.protobuf.DurationOrBuilder getRunningTimeoutOrBuilder(); + + /** + * + * + *
+   * Runtime host for the workstation.
+   * 
+ * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host host = 12; + * + * @return Whether the host field is set. + */ + boolean hasHost(); + /** + * + * + *
+   * Runtime host for the workstation.
+   * 
+ * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host host = 12; + * + * @return The host. + */ + com.google.cloud.workstations.v1beta.WorkstationConfig.Host getHost(); + /** + * + * + *
+   * Runtime host for the workstation.
+   * 
+ * + * .google.cloud.workstations.v1beta.WorkstationConfig.Host host = 12; + */ + com.google.cloud.workstations.v1beta.WorkstationConfig.HostOrBuilder getHostOrBuilder(); + + /** + * + * + *
+   * Directories to persist across workstation sessions.
+   * 
+ * + * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory persistent_directories = 13; + * + */ + java.util.List + getPersistentDirectoriesList(); + /** + * + * + *
+   * Directories to persist across workstation sessions.
+   * 
+ * + * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory persistent_directories = 13; + * + */ + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory + getPersistentDirectories(int index); + /** + * + * + *
+   * Directories to persist across workstation sessions.
+   * 
+ * + * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory persistent_directories = 13; + * + */ + int getPersistentDirectoriesCount(); + /** + * + * + *
+   * Directories to persist across workstation sessions.
+   * 
+ * + * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory persistent_directories = 13; + * + */ + java.util.List< + ? extends + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectoryOrBuilder> + getPersistentDirectoriesOrBuilderList(); + /** + * + * + *
+   * Directories to persist across workstation sessions.
+   * 
+ * + * + * repeated .google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory persistent_directories = 13; + * + */ + com.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectoryOrBuilder + getPersistentDirectoriesOrBuilder(int index); + + /** + * + * + *
+   * Container that will be run for each workstation using this configuration
+   * when that workstation is started.
+   * 
+ * + * .google.cloud.workstations.v1beta.WorkstationConfig.Container container = 14; + * + * @return Whether the container field is set. + */ + boolean hasContainer(); + /** + * + * + *
+   * Container that will be run for each workstation using this configuration
+   * when that workstation is started.
+   * 
+ * + * .google.cloud.workstations.v1beta.WorkstationConfig.Container container = 14; + * + * @return The container. + */ + com.google.cloud.workstations.v1beta.WorkstationConfig.Container getContainer(); + /** + * + * + *
+   * Container that will be run for each workstation using this configuration
+   * when that workstation is started.
+   * 
+ * + * .google.cloud.workstations.v1beta.WorkstationConfig.Container container = 14; + */ + com.google.cloud.workstations.v1beta.WorkstationConfig.ContainerOrBuilder getContainerOrBuilder(); + + /** + * + * + *
+   * Encrypts resources of this workstation configuration using a
+   * customer-managed encryption key.
+   * If specified, the boot disk of the Compute Engine instance and the
+   * persistent disk are encrypted using this encryption key. If
+   * this field is not set, the disks are encrypted using a generated
+   * key. Customer-managed encryption keys do not protect disk metadata.
+   * If the customer-managed encryption key is rotated, when the workstation
+   * instance is stopped, the system attempts to recreate the
+   * persistent disk with the new version of the key. Be sure to keep
+   * older versions of the key until the persistent disk is recreated.
+   * Otherwise, data on the persistent disk will be lost.
+   * If the encryption key is revoked, the workstation session will
+   * automatically be stopped within 7 hours.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey encryption_key = 17; + * + * + * @return Whether the encryptionKey field is set. + */ + boolean hasEncryptionKey(); + /** + * + * + *
+   * Encrypts resources of this workstation configuration using a
+   * customer-managed encryption key.
+   * If specified, the boot disk of the Compute Engine instance and the
+   * persistent disk are encrypted using this encryption key. If
+   * this field is not set, the disks are encrypted using a generated
+   * key. Customer-managed encryption keys do not protect disk metadata.
+   * If the customer-managed encryption key is rotated, when the workstation
+   * instance is stopped, the system attempts to recreate the
+   * persistent disk with the new version of the key. Be sure to keep
+   * older versions of the key until the persistent disk is recreated.
+   * Otherwise, data on the persistent disk will be lost.
+   * If the encryption key is revoked, the workstation session will
+   * automatically be stopped within 7 hours.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey encryption_key = 17; + * + * + * @return The encryptionKey. + */ + com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey getEncryptionKey(); + /** + * + * + *
+   * Encrypts resources of this workstation configuration using a
+   * customer-managed encryption key.
+   * If specified, the boot disk of the Compute Engine instance and the
+   * persistent disk are encrypted using this encryption key. If
+   * this field is not set, the disks are encrypted using a generated
+   * key. Customer-managed encryption keys do not protect disk metadata.
+   * If the customer-managed encryption key is rotated, when the workstation
+   * instance is stopped, the system attempts to recreate the
+   * persistent disk with the new version of the key. Be sure to keep
+   * older versions of the key until the persistent disk is recreated.
+   * Otherwise, data on the persistent disk will be lost.
+   * If the encryption key is revoked, the workstation session will
+   * automatically be stopped within 7 hours.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey encryption_key = 17; + * + */ + com.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKeyOrBuilder + getEncryptionKeyOrBuilder(); + + /** + * + * + *
+   * Output only. Whether this resource is in degraded mode, in which case it
+   * may require user action to restore full functionality. Details can be found
+   * in the `conditions` field.
+   * 
+ * + * bool degraded = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The degraded. + */ + boolean getDegraded(); + + /** + * + * + *
+   * Output only. Status conditions describing the current resource state.
+   * 
+ * + * repeated .google.rpc.Status conditions = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getConditionsList(); + /** + * + * + *
+   * Output only. Status conditions describing the current resource state.
+   * 
+ * + * repeated .google.rpc.Status conditions = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.rpc.Status getConditions(int index); + /** + * + * + *
+   * Output only. Status conditions describing the current resource state.
+   * 
+ * + * repeated .google.rpc.Status conditions = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getConditionsCount(); + /** + * + * + *
+   * Output only. Status conditions describing the current resource state.
+   * 
+ * + * repeated .google.rpc.Status conditions = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getConditionsOrBuilderList(); + /** + * + * + *
+   * Output only. Status conditions describing the current resource state.
+   * 
+ * + * repeated .google.rpc.Status conditions = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.rpc.StatusOrBuilder getConditionsOrBuilder(int index); +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/WorkstationName.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/WorkstationName.java new file mode 100644 index 000000000000..1a2078e3fea4 --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/WorkstationName.java @@ -0,0 +1,308 @@ +/* + * Copyright 2022 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.workstations.v1beta; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class WorkstationName implements ResourceName { + private static final PathTemplate + PROJECT_LOCATION_WORKSTATION_CLUSTER_WORKSTATION_CONFIG_WORKSTATION = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}/workstationConfigs/{workstation_config}/workstations/{workstation}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String workstationCluster; + private final String workstationConfig; + private final String workstation; + + @Deprecated + protected WorkstationName() { + project = null; + location = null; + workstationCluster = null; + workstationConfig = null; + workstation = null; + } + + private WorkstationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + workstationCluster = Preconditions.checkNotNull(builder.getWorkstationCluster()); + workstationConfig = Preconditions.checkNotNull(builder.getWorkstationConfig()); + workstation = Preconditions.checkNotNull(builder.getWorkstation()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getWorkstationCluster() { + return workstationCluster; + } + + public String getWorkstationConfig() { + return workstationConfig; + } + + public String getWorkstation() { + return workstation; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static WorkstationName of( + String project, + String location, + String workstationCluster, + String workstationConfig, + String workstation) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setWorkstationCluster(workstationCluster) + .setWorkstationConfig(workstationConfig) + .setWorkstation(workstation) + .build(); + } + + public static String format( + String project, + String location, + String workstationCluster, + String workstationConfig, + String workstation) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setWorkstationCluster(workstationCluster) + .setWorkstationConfig(workstationConfig) + .setWorkstation(workstation) + .build() + .toString(); + } + + public static WorkstationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_WORKSTATION_CLUSTER_WORKSTATION_CONFIG_WORKSTATION.validatedMatch( + formattedString, "WorkstationName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("workstation_cluster"), + matchMap.get("workstation_config"), + matchMap.get("workstation")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (WorkstationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_WORKSTATION_CLUSTER_WORKSTATION_CONFIG_WORKSTATION.matches( + formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (workstationCluster != null) { + fieldMapBuilder.put("workstation_cluster", workstationCluster); + } + if (workstationConfig != null) { + fieldMapBuilder.put("workstation_config", workstationConfig); + } + if (workstation != null) { + fieldMapBuilder.put("workstation", workstation); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_WORKSTATION_CLUSTER_WORKSTATION_CONFIG_WORKSTATION.instantiate( + "project", + project, + "location", + location, + "workstation_cluster", + workstationCluster, + "workstation_config", + workstationConfig, + "workstation", + workstation); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + WorkstationName that = ((WorkstationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.workstationCluster, that.workstationCluster) + && Objects.equals(this.workstationConfig, that.workstationConfig) + && Objects.equals(this.workstation, that.workstation); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(workstationCluster); + h *= 1000003; + h ^= Objects.hashCode(workstationConfig); + h *= 1000003; + h ^= Objects.hashCode(workstation); + return h; + } + + /** + * Builder for + * projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}/workstationConfigs/{workstation_config}/workstations/{workstation}. + */ + public static class Builder { + private String project; + private String location; + private String workstationCluster; + private String workstationConfig; + private String workstation; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getWorkstationCluster() { + return workstationCluster; + } + + public String getWorkstationConfig() { + return workstationConfig; + } + + public String getWorkstation() { + return workstation; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setWorkstationCluster(String workstationCluster) { + this.workstationCluster = workstationCluster; + return this; + } + + public Builder setWorkstationConfig(String workstationConfig) { + this.workstationConfig = workstationConfig; + return this; + } + + public Builder setWorkstation(String workstation) { + this.workstation = workstation; + return this; + } + + private Builder(WorkstationName workstationName) { + this.project = workstationName.project; + this.location = workstationName.location; + this.workstationCluster = workstationName.workstationCluster; + this.workstationConfig = workstationName.workstationConfig; + this.workstation = workstationName.workstation; + } + + public WorkstationName build() { + return new WorkstationName(this); + } + } +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/WorkstationOrBuilder.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/WorkstationOrBuilder.java new file mode 100644 index 000000000000..ef067c8a562f --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/WorkstationOrBuilder.java @@ -0,0 +1,438 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +public interface WorkstationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workstations.v1beta.Workstation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Full name of this resource.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Full name of this resource.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Human-readable name for this resource.
+   * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Human-readable name for this resource.
+   * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Output only. A system-assigned unique identified for this resource.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + java.lang.String getUid(); + /** + * + * + *
+   * Output only. A system-assigned unique identified for this resource.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + com.google.protobuf.ByteString getUidBytes(); + + /** + * + * + *
+   * Output only. Indicates whether this resource is currently being updated to
+   * match its intended state.
+   * 
+ * + * bool reconciling = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + boolean getReconciling(); + + /** + * + * + *
+   * Client-specified annotations.
+   * 
+ * + * map<string, string> annotations = 5; + */ + int getAnnotationsCount(); + /** + * + * + *
+   * Client-specified annotations.
+   * 
+ * + * map<string, string> annotations = 5; + */ + boolean containsAnnotations(java.lang.String key); + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getAnnotations(); + /** + * + * + *
+   * Client-specified annotations.
+   * 
+ * + * map<string, string> annotations = 5; + */ + java.util.Map getAnnotationsMap(); + /** + * + * + *
+   * Client-specified annotations.
+   * 
+ * + * map<string, string> annotations = 5; + */ + /* nullable */ + java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Client-specified annotations.
+   * 
+ * + * map<string, string> annotations = 5; + */ + java.lang.String getAnnotationsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Client-specified labels that are applied to the resource and that are also
+   * propagated to the underlying Compute Engine resources.
+   * 
+ * + * map<string, string> labels = 13; + */ + int getLabelsCount(); + /** + * + * + *
+   * Client-specified labels that are applied to the resource and that are also
+   * propagated to the underlying Compute Engine resources.
+   * 
+ * + * map<string, string> labels = 13; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Client-specified labels that are applied to the resource and that are also
+   * propagated to the underlying Compute Engine resources.
+   * 
+ * + * map<string, string> labels = 13; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Client-specified labels that are applied to the resource and that are also
+   * propagated to the underlying Compute Engine resources.
+   * 
+ * + * map<string, string> labels = 13; + */ + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Client-specified labels that are applied to the resource and that are also
+   * propagated to the underlying Compute Engine resources.
+   * 
+ * + * map<string, string> labels = 13; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. Time when this resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Time when this resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Time when this resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Time when this resource was most recently updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. Time when this resource was most recently updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. Time when this resource was most recently updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Time when this resource was soft-deleted.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + boolean hasDeleteTime(); + /** + * + * + *
+   * Output only. Time when this resource was soft-deleted.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The deleteTime. + */ + com.google.protobuf.Timestamp getDeleteTime(); + /** + * + * + *
+   * Output only. Time when this resource was soft-deleted.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder(); + + /** + * + * + *
+   * Checksum computed by the server. May be sent on update and delete requests
+   * to ensure that the client has an up-to-date value before proceeding.
+   * 
+ * + * string etag = 9; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * Checksum computed by the server. May be sent on update and delete requests
+   * to ensure that the client has an up-to-date value before proceeding.
+   * 
+ * + * string etag = 9; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * Output only. Current state of the workstation.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.Workstation.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. Current state of the workstation.
+   * 
+ * + * + * .google.cloud.workstations.v1beta.Workstation.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.workstations.v1beta.Workstation.State getState(); + + /** + * + * + *
+   * Output only. Host to which clients can send HTTPS traffic that will be
+   * received by the workstation. Authorized traffic will be received to the
+   * workstation as HTTP on port 80. To send traffic to a different port,
+   * clients may prefix the host with the destination port in the format
+   * `{port}-{host}`.
+   * 
+ * + * string host = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The host. + */ + java.lang.String getHost(); + /** + * + * + *
+   * Output only. Host to which clients can send HTTPS traffic that will be
+   * received by the workstation. Authorized traffic will be received to the
+   * workstation as HTTP on port 80. To send traffic to a different port,
+   * clients may prefix the host with the destination port in the format
+   * `{port}-{host}`.
+   * 
+ * + * string host = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for host. + */ + com.google.protobuf.ByteString getHostBytes(); +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/WorkstationsProto.java b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/WorkstationsProto.java new file mode 100644 index 000000000000..9eae902e39b8 --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/java/com/google/cloud/workstations/v1beta/WorkstationsProto.java @@ -0,0 +1,1101 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workstations/v1beta/workstations.proto + +package com.google.cloud.workstations.v1beta; + +public final class WorkstationsProto { + private WorkstationsProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_WorkstationCluster_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_WorkstationCluster_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_WorkstationCluster_PrivateClusterConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_WorkstationCluster_PrivateClusterConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_WorkstationCluster_AnnotationsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_WorkstationCluster_AnnotationsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_WorkstationCluster_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_WorkstationCluster_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_GceInstance_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_GceInstance_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_GceInstance_GceShieldedInstanceConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_GceInstance_GceShieldedInstanceConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_GceInstance_GceConfidentialInstanceConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_GceInstance_GceConfidentialInstanceConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_PersistentDirectory_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_PersistentDirectory_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_PersistentDirectory_GceRegionalPersistentDisk_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_PersistentDirectory_GceRegionalPersistentDisk_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Container_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Container_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Container_EnvEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Container_EnvEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_CustomerEncryptionKey_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_CustomerEncryptionKey_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_AnnotationsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_AnnotationsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_Workstation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_Workstation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_Workstation_AnnotationsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_Workstation_AnnotationsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_Workstation_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_Workstation_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_GetWorkstationClusterRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_GetWorkstationClusterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_ListWorkstationClustersRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_ListWorkstationClustersRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_ListWorkstationClustersResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_ListWorkstationClustersResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_CreateWorkstationClusterRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_CreateWorkstationClusterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_UpdateWorkstationClusterRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_UpdateWorkstationClusterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_DeleteWorkstationClusterRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_DeleteWorkstationClusterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_GetWorkstationConfigRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_GetWorkstationConfigRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_ListWorkstationConfigsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_ListWorkstationConfigsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_ListWorkstationConfigsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_ListWorkstationConfigsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_ListUsableWorkstationConfigsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_ListUsableWorkstationConfigsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_ListUsableWorkstationConfigsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_ListUsableWorkstationConfigsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_CreateWorkstationConfigRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_CreateWorkstationConfigRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_UpdateWorkstationConfigRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_UpdateWorkstationConfigRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_DeleteWorkstationConfigRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_DeleteWorkstationConfigRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_GetWorkstationRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_GetWorkstationRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_ListWorkstationsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_ListWorkstationsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_ListWorkstationsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_ListWorkstationsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_ListUsableWorkstationsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_ListUsableWorkstationsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_ListUsableWorkstationsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_ListUsableWorkstationsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_CreateWorkstationRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_CreateWorkstationRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_UpdateWorkstationRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_UpdateWorkstationRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_DeleteWorkstationRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_DeleteWorkstationRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_StartWorkstationRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_StartWorkstationRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_StopWorkstationRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_StopWorkstationRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_GenerateAccessTokenRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_GenerateAccessTokenRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_GenerateAccessTokenResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_GenerateAccessTokenResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workstations_v1beta_OperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workstations_v1beta_OperationMetadata_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n3google/cloud/workstations/v1beta/works" + + "tations.proto\022 google.cloud.workstations" + + ".v1beta\032\034google/api/annotations.proto\032\027g" + + "oogle/api/client.proto\032\037google/api/field" + + "_behavior.proto\032\031google/api/resource.pro" + + "to\032#google/longrunning/operations.proto\032" + + "\036google/protobuf/duration.proto\032 google/" + + "protobuf/field_mask.proto\032\037google/protob" + + "uf/timestamp.proto\032\027google/rpc/status.pr" + + "oto\"\255\010\n\022WorkstationCluster\022\014\n\004name\030\001 \001(\t" + + "\022\024\n\014display_name\030\002 \001(\t\022\020\n\003uid\030\003 \001(\tB\003\340A\003" + + "\022\030\n\013reconciling\030\004 \001(\010B\003\340A\003\022Z\n\013annotation" + + "s\030\005 \003(\0132E.google.cloud.workstations.v1be" + + "ta.WorkstationCluster.AnnotationsEntry\022P" + + "\n\006labels\030\017 \003(\0132@.google.cloud.workstatio" + + "ns.v1beta.WorkstationCluster.LabelsEntry" + + "\0224\n\013create_time\030\006 \001(\0132\032.google.protobuf." + + "TimestampB\003\340A\003\0224\n\013update_time\030\007 \001(\0132\032.go" + + "ogle.protobuf.TimestampB\003\340A\003\0224\n\013delete_t" + + "ime\030\010 \001(\0132\032.google.protobuf.TimestampB\003\340" + + "A\003\022\014\n\004etag\030\t \001(\t\022\024\n\007network\030\n \001(\tB\003\340A\005\022\027" + + "\n\nsubnetwork\030\013 \001(\tB\003\340A\005\022i\n\026private_clust" + + "er_config\030\014 \001(\0132I.google.cloud.workstati" + + "ons.v1beta.WorkstationCluster.PrivateClu" + + "sterConfig\022\025\n\010degraded\030\r \001(\010B\003\340A\003\022+\n\ncon" + + "ditions\030\016 \003(\0132\022.google.rpc.StatusB\003\340A\003\032\232" + + "\001\n\024PrivateClusterConfig\022$\n\027enable_privat" + + "e_endpoint\030\001 \001(\010B\003\340A\005\022\035\n\020cluster_hostnam" + + "e\030\002 \001(\tB\003\340A\003\022#\n\026service_attachment_uri\030\003" + + " \001(\tB\003\340A\003\022\030\n\020allowed_projects\030\004 \003(\t\0322\n\020A" + + "nnotationsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 " + + "\001(\t:\0028\001\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005v" + + "alue\030\002 \001(\t:\0028\001:\212\001\352A\206\001\n.workstations.goog" + + "leapis.com/WorkstationCluster\022Qprojects/" + + "{project}/locations/{location}/workstati" + + "onClusters/{workstation_cluster}R\001\001\"\341\025\n\021" + + "WorkstationConfig\022\014\n\004name\030\001 \001(\t\022\024\n\014displ" + + "ay_name\030\002 \001(\t\022\020\n\003uid\030\003 \001(\tB\003\340A\003\022\030\n\013recon" + + "ciling\030\004 \001(\010B\003\340A\003\022Y\n\013annotations\030\005 \003(\0132D" + + ".google.cloud.workstations.v1beta.Workst" + + "ationConfig.AnnotationsEntry\022O\n\006labels\030\022" + + " \003(\0132?.google.cloud.workstations.v1beta." + + "WorkstationConfig.LabelsEntry\0224\n\013create_" + + "time\030\006 \001(\0132\032.google.protobuf.TimestampB\003" + + "\340A\003\0224\n\013update_time\030\007 \001(\0132\032.google.protob" + + "uf.TimestampB\003\340A\003\0224\n\013delete_time\030\010 \001(\0132\032" + + ".google.protobuf.TimestampB\003\340A\003\022\014\n\004etag\030" + + "\t \001(\t\022/\n\014idle_timeout\030\n \001(\0132\031.google.pro" + + "tobuf.Duration\0222\n\017running_timeout\030\013 \001(\0132" + + "\031.google.protobuf.Duration\022F\n\004host\030\014 \001(\013" + + "28.google.cloud.workstations.v1beta.Work" + + "stationConfig.Host\022g\n\026persistent_directo" + + "ries\030\r \003(\0132G.google.cloud.workstations.v" + + "1beta.WorkstationConfig.PersistentDirect" + + "ory\022P\n\tcontainer\030\016 \001(\0132=.google.cloud.wo" + + "rkstations.v1beta.WorkstationConfig.Cont" + + "ainer\022a\n\016encryption_key\030\021 \001(\0132I.google.c" + + "loud.workstations.v1beta.WorkstationConf" + + "ig.CustomerEncryptionKey\022\025\n\010degraded\030\017 \001" + + "(\010B\003\340A\003\022+\n\nconditions\030\020 \003(\0132\022.google.rpc" + + ".StatusB\003\340A\003\032\325\005\n\004Host\022\\\n\014gce_instance\030\001 " + + "\001(\0132D.google.cloud.workstations.v1beta.W" + + "orkstationConfig.Host.GceInstanceH\000\032\344\004\n\013" + + "GceInstance\022\024\n\014machine_type\030\001 \001(\t\022\027\n\017ser" + + "vice_account\030\002 \001(\t\022\014\n\004tags\030\004 \003(\t\022\021\n\tpool" + + "_size\030\005 \001(\005\022#\n\033disable_public_ip_address" + + "es\030\006 \001(\010\022\200\001\n\030shielded_instance_config\030\010 " + + "\001(\0132^.google.cloud.workstations.v1beta.W" + + "orkstationConfig.Host.GceInstance.GceShi" + + "eldedInstanceConfig\022\210\001\n\034confidential_ins" + + "tance_config\030\n \001(\0132b.google.cloud.workst" + + "ations.v1beta.WorkstationConfig.Host.Gce" + + "Instance.GceConfidentialInstanceConfig\022\031" + + "\n\021boot_disk_size_gb\030\t \001(\005\032q\n\031GceShielded" + + "InstanceConfig\022\032\n\022enable_secure_boot\030\001 \001" + + "(\010\022\023\n\013enable_vtpm\030\002 \001(\010\022#\n\033enable_integr" + + "ity_monitoring\030\003 \001(\010\032D\n\035GceConfidentialI" + + "nstanceConfig\022#\n\033enable_confidential_com" + + "pute\030\001 \001(\010B\010\n\006config\032\357\003\n\023PersistentDirec" + + "tory\022\022\n\nmount_path\030\001 \001(\t\022s\n\006gce_pd\030\002 \001(\013" + + "2a.google.cloud.workstations.v1beta.Work" + + "stationConfig.PersistentDirectory.GceReg" + + "ionalPersistentDiskH\000\032\274\002\n\031GceRegionalPer" + + "sistentDisk\022\017\n\007size_gb\030\001 \001(\005\022\017\n\007fs_type\030" + + "\002 \001(\t\022\021\n\tdisk_type\030\003 \001(\t\022\027\n\017source_snaps" + + "hot\030\005 \001(\t\022\207\001\n\016reclaim_policy\030\004 \001(\0162o.goo" + + "gle.cloud.workstations.v1beta.Workstatio" + + "nConfig.PersistentDirectory.GceRegionalP" + + "ersistentDisk.ReclaimPolicy\"G\n\rReclaimPo" + + "licy\022\036\n\032RECLAIM_POLICY_UNSPECIFIED\020\000\022\n\n\006" + + "DELETE\020\001\022\n\n\006RETAIN\020\002B\020\n\016directory_type\032\344" + + "\001\n\tContainer\022\r\n\005image\030\001 \001(\t\022\017\n\007command\030\002" + + " \003(\t\022\014\n\004args\030\003 \003(\t\022S\n\003env\030\004 \003(\0132F.google" + + ".cloud.workstations.v1beta.WorkstationCo" + + "nfig.Container.EnvEntry\022\023\n\013working_dir\030\005" + + " \001(\t\022\023\n\013run_as_user\030\006 \001(\005\032*\n\010EnvEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\032I\n\025Custome" + + "rEncryptionKey\022\017\n\007kms_key\030\001 \001(\t\022\037\n\027kms_k" + + "ey_service_account\030\002 \001(\t\0322\n\020AnnotationsE" + + "ntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\032-\n\013" + + "LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:" + + "\0028\001:\261\001\352A\255\001\n-workstations.googleapis.com/" + + "WorkstationConfig\022yprojects/{project}/lo" + + "cations/{location}/workstationClusters/{" + + "workstation_cluster}/workstationConfigs/" + + "{workstation_config}R\001\001\"\244\007\n\013Workstation\022" + + "\014\n\004name\030\001 \001(\t\022\024\n\014display_name\030\002 \001(\t\022\020\n\003u" + + "id\030\003 \001(\tB\003\340A\003\022\030\n\013reconciling\030\004 \001(\010B\003\340A\003\022" + + "S\n\013annotations\030\005 \003(\0132>.google.cloud.work" + + "stations.v1beta.Workstation.AnnotationsE" + + "ntry\022I\n\006labels\030\r \003(\01329.google.cloud.work" + + "stations.v1beta.Workstation.LabelsEntry\022" + + "4\n\013create_time\030\006 \001(\0132\032.google.protobuf.T" + + "imestampB\003\340A\003\0224\n\013update_time\030\007 \001(\0132\032.goo" + + "gle.protobuf.TimestampB\003\340A\003\0224\n\013delete_ti" + + "me\030\010 \001(\0132\032.google.protobuf.TimestampB\003\340A" + + "\003\022\014\n\004etag\030\t \001(\t\022G\n\005state\030\n \001(\01623.google." + + "cloud.workstations.v1beta.Workstation.St" + + "ateB\003\340A\003\022\021\n\004host\030\013 \001(\tB\003\340A\003\0322\n\020Annotatio" + + "nsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\032" + + "-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001" + + "(\t:\0028\001\"l\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\022" + + "\n\016STATE_STARTING\020\001\022\021\n\rSTATE_RUNNING\020\002\022\022\n" + + "\016STATE_STOPPING\020\003\022\021\n\rSTATE_STOPPED\020\004:\307\001\352" + + "A\303\001\n\'workstations.googleapis.com/Worksta" + + "tion\022\224\001projects/{project}/locations/{loc" + + "ation}/workstationClusters/{workstation_" + + "cluster}/workstationConfigs/{workstation" + + "_config}/workstations/{workstation}R\001\001\"d" + + "\n\034GetWorkstationClusterRequest\022D\n\004name\030\001" + + " \001(\tB6\340A\002\372A0\n.workstations.googleapis.co" + + "m/WorkstationCluster\"\217\001\n\036ListWorkstation" + + "ClustersRequest\022F\n\006parent\030\001 \001(\tB6\340A\002\372A0\022" + + ".workstations.googleapis.com/Workstation" + + "Cluster\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token" + + "\030\003 \001(\t\"\243\001\n\037ListWorkstationClustersRespon" + + "se\022R\n\024workstation_clusters\030\001 \003(\01324.googl" + + "e.cloud.workstations.v1beta.WorkstationC" + + "luster\022\027\n\017next_page_token\030\002 \001(\t\022\023\n\013unrea" + + "chable\030\003 \003(\t\"\375\001\n\037CreateWorkstationCluste" + + "rRequest\022F\n\006parent\030\001 \001(\tB6\340A\002\372A0\022.workst" + + "ations.googleapis.com/WorkstationCluster" + + "\022#\n\026workstation_cluster_id\030\002 \001(\tB\003\340A\002\022V\n" + + "\023workstation_cluster\030\003 \001(\01324.google.clou" + + "d.workstations.v1beta.WorkstationCluster" + + "B\003\340A\002\022\025\n\rvalidate_only\030\004 \001(\010\"\335\001\n\037UpdateW" + + "orkstationClusterRequest\022V\n\023workstation_" + + "cluster\030\001 \001(\01324.google.cloud.workstation" + + "s.v1beta.WorkstationClusterB\003\340A\002\0224\n\013upda" + + "te_mask\030\002 \001(\0132\032.google.protobuf.FieldMas" + + "kB\003\340A\002\022\025\n\rvalidate_only\030\003 \001(\010\022\025\n\rallow_m" + + "issing\030\004 \001(\010\"\233\001\n\037DeleteWorkstationCluste" + + "rRequest\022D\n\004name\030\001 \001(\tB6\340A\002\372A0\n.workstat" + + "ions.googleapis.com/WorkstationCluster\022\025" + + "\n\rvalidate_only\030\002 \001(\010\022\014\n\004etag\030\003 \001(\t\022\r\n\005f" + + "orce\030\004 \001(\010\"b\n\033GetWorkstationConfigReques" + + "t\022C\n\004name\030\001 \001(\tB5\340A\002\372A/\n-workstations.go" + + "ogleapis.com/WorkstationConfig\"\216\001\n\035ListW" + + "orkstationConfigsRequest\022F\n\006parent\030\001 \001(\t" + + "B6\340A\002\372A0\n.workstations.googleapis.com/Wo" + + "rkstationCluster\022\021\n\tpage_size\030\002 \001(\005\022\022\n\np" + + "age_token\030\003 \001(\t\"\240\001\n\036ListWorkstationConfi" + + "gsResponse\022P\n\023workstation_configs\030\001 \003(\0132" + + "3.google.cloud.workstations.v1beta.Works" + + "tationConfig\022\027\n\017next_page_token\030\002 \001(\t\022\023\n" + + "\013unreachable\030\003 \003(\t\"\224\001\n#ListUsableWorksta" + + "tionConfigsRequest\022F\n\006parent\030\001 \001(\tB6\340A\002\372" + + "A0\n.workstations.googleapis.com/Workstat" + + "ionCluster\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_to" + + "ken\030\003 \001(\t\"\246\001\n$ListUsableWorkstationConfi" + + "gsResponse\022P\n\023workstation_configs\030\001 \003(\0132" + + "3.google.cloud.workstations.v1beta.Works" + + "tationConfig\022\027\n\017next_page_token\030\002 \001(\t\022\023\n" + + "\013unreachable\030\003 \003(\t\"\371\001\n\036CreateWorkstation" + + "ConfigRequest\022F\n\006parent\030\001 \001(\tB6\340A\002\372A0\n.w" + + "orkstations.googleapis.com/WorkstationCl" + + "uster\022\"\n\025workstation_config_id\030\002 \001(\tB\003\340A" + + "\002\022T\n\022workstation_config\030\003 \001(\01323.google.c" + + "loud.workstations.v1beta.WorkstationConf" + + "igB\003\340A\002\022\025\n\rvalidate_only\030\004 \001(\010\"\332\001\n\036Updat" + + "eWorkstationConfigRequest\022T\n\022workstation" + + "_config\030\001 \001(\01323.google.cloud.workstation" + + "s.v1beta.WorkstationConfigB\003\340A\002\0224\n\013updat" + + "e_mask\030\002 \001(\0132\032.google.protobuf.FieldMask" + + "B\003\340A\002\022\025\n\rvalidate_only\030\003 \001(\010\022\025\n\rallow_mi" + + "ssing\030\004 \001(\010\"\231\001\n\036DeleteWorkstationConfigR" + + "equest\022C\n\004name\030\001 \001(\tB5\340A\002\372A/\n-workstatio" + + "ns.googleapis.com/WorkstationConfig\022\025\n\rv" + + "alidate_only\030\002 \001(\010\022\014\n\004etag\030\003 \001(\t\022\r\n\005forc" + + "e\030\004 \001(\010\"V\n\025GetWorkstationRequest\022=\n\004name" + + "\030\001 \001(\tB/\340A\002\372A)\n\'workstations.googleapis." + + "com/Workstation\"\207\001\n\027ListWorkstationsRequ" + + "est\022E\n\006parent\030\001 \001(\tB5\340A\002\372A/\n-workstation" + + "s.googleapis.com/WorkstationConfig\022\021\n\tpa" + + "ge_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"\215\001\n\030Li" + + "stWorkstationsResponse\022C\n\014workstations\030\001" + + " \003(\0132-.google.cloud.workstations.v1beta." + + "Workstation\022\027\n\017next_page_token\030\002 \001(\t\022\023\n\013" + + "unreachable\030\003 \003(\t\"\215\001\n\035ListUsableWorkstat" + + "ionsRequest\022E\n\006parent\030\001 \001(\tB5\340A\002\372A/\n-wor" + + "kstations.googleapis.com/WorkstationConf" + + "ig\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(" + + "\t\"\223\001\n\036ListUsableWorkstationsResponse\022C\n\014" + + "workstations\030\001 \003(\0132-.google.cloud.workst" + + "ations.v1beta.Workstation\022\027\n\017next_page_t" + + "oken\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"\336\001\n\030Crea" + + "teWorkstationRequest\022E\n\006parent\030\001 \001(\tB5\340A" + + "\002\372A/\n-workstations.googleapis.com/Workst" + + "ationConfig\022\033\n\016workstation_id\030\002 \001(\tB\003\340A\002" + + "\022G\n\013workstation\030\003 \001(\0132-.google.cloud.wor" + + "kstations.v1beta.WorkstationB\003\340A\002\022\025\n\rval" + + "idate_only\030\004 \001(\010\"\307\001\n\030UpdateWorkstationRe" + + "quest\022G\n\013workstation\030\001 \001(\0132-.google.clou" + + "d.workstations.v1beta.WorkstationB\003\340A\002\0224" + + "\n\013update_mask\030\002 \001(\0132\032.google.protobuf.Fi" + + "eldMaskB\003\340A\002\022\025\n\rvalidate_only\030\003 \001(\010\022\025\n\ra" + + "llow_missing\030\004 \001(\010\"~\n\030DeleteWorkstationR" + + "equest\022=\n\004name\030\001 \001(\tB/\340A\002\372A)\n\'workstatio" + + "ns.googleapis.com/Workstation\022\025\n\rvalidat" + + "e_only\030\002 \001(\010\022\014\n\004etag\030\003 \001(\t\"}\n\027StartWorks" + + "tationRequest\022=\n\004name\030\001 \001(\tB/\340A\002\372A)\n\'wor" + + "kstations.googleapis.com/Workstation\022\025\n\r" + + "validate_only\030\002 \001(\010\022\014\n\004etag\030\003 \001(\t\"|\n\026Sto" + + "pWorkstationRequest\022=\n\004name\030\001 \001(\tB/\340A\002\372A" + + ")\n\'workstations.googleapis.com/Workstati" + + "on\022\025\n\rvalidate_only\030\002 \001(\010\022\014\n\004etag\030\003 \001(\t\"" + + "\315\001\n\032GenerateAccessTokenRequest\022D\n\013workst" + + "ation\030\001 \001(\tB/\340A\002\372A)\n\'workstations.google" + + "apis.com/Workstation\0221\n\013expire_time\030\002 \001(" + + "\0132\032.google.protobuf.TimestampH\000\022(\n\003ttl\030\003" + + " \001(\0132\031.google.protobuf.DurationH\000B\014\n\nexp" + + "iration\"d\n\033GenerateAccessTokenResponse\022\024" + + "\n\014access_token\030\001 \001(\t\022/\n\013expire_time\030\002 \001(" + + "\0132\032.google.protobuf.Timestamp\"\200\002\n\021Operat" + + "ionMetadata\0224\n\013create_time\030\001 \001(\0132\032.googl" + + "e.protobuf.TimestampB\003\340A\003\0221\n\010end_time\030\002 " + + "\001(\0132\032.google.protobuf.TimestampB\003\340A\003\022\023\n\006" + + "target\030\003 \001(\tB\003\340A\003\022\021\n\004verb\030\004 \001(\tB\003\340A\003\022\033\n\016" + + "status_message\030\005 \001(\tB\003\340A\003\022#\n\026requested_c" + + "ancellation\030\006 \001(\010B\003\340A\003\022\030\n\013api_version\030\007 " + + "\001(\tB\003\340A\0032\337+\n\014Workstations\022\331\001\n\025GetWorksta" + + "tionCluster\022>.google.cloud.workstations." + + "v1beta.GetWorkstationClusterRequest\0324.go" + + "ogle.cloud.workstations.v1beta.Workstati" + + "onCluster\"J\202\323\344\223\002=\022;/v1beta/{name=project" + + "s/*/locations/*/workstationClusters/*}\332A" + + "\004name\022\354\001\n\027ListWorkstationClusters\022@.goog" + + "le.cloud.workstations.v1beta.ListWorksta" + + "tionClustersRequest\032A.google.cloud.works" + + "tations.v1beta.ListWorkstationClustersRe" + + "sponse\"L\202\323\344\223\002=\022;/v1beta/{parent=projects" + + "/*/locations/*}/workstationClusters\332A\006pa" + + "rent\022\265\002\n\030CreateWorkstationCluster\022A.goog" + + "le.cloud.workstations.v1beta.CreateWorks" + + "tationClusterRequest\032\035.google.longrunnin" + + "g.Operation\"\266\001\202\323\344\223\002R\";/v1beta/{parent=pr" + + "ojects/*/locations/*}/workstationCluster" + + "s:\023workstation_cluster\332A1parent,workstat" + + "ion_cluster,workstation_cluster_id\312A\'\n\022W" + + "orkstationCluster\022\021OperationMetadata\022\267\002\n" + + "\030UpdateWorkstationCluster\022A.google.cloud" + + ".workstations.v1beta.UpdateWorkstationCl" + + "usterRequest\032\035.google.longrunning.Operat" + + "ion\"\270\001\202\323\344\223\002f2O/v1beta/{workstation_clust" + + "er.name=projects/*/locations/*/workstati" + + "onClusters/*}:\023workstation_cluster\332A\037wor" + + "kstation_cluster,update_mask\312A\'\n\022Worksta" + + "tionCluster\022\021OperationMetadata\022\362\001\n\030Delet" + + "eWorkstationCluster\022A.google.cloud.works" + + "tations.v1beta.DeleteWorkstationClusterR" + + "equest\032\035.google.longrunning.Operation\"t\202" + + "\323\344\223\002=*;/v1beta/{name=projects/*/location" + + "s/*/workstationClusters/*}\332A\004name\312A\'\n\022Wo" + + "rkstationCluster\022\021OperationMetadata\022\353\001\n\024" + + "GetWorkstationConfig\022=.google.cloud.work" + + "stations.v1beta.GetWorkstationConfigRequ" + + "est\0323.google.cloud.workstations.v1beta.W" + + "orkstationConfig\"_\202\323\344\223\002R\022P/v1beta/{name=" + + "projects/*/locations/*/workstationCluste" + + "rs/*/workstationConfigs/*}\332A\004name\022\376\001\n\026Li" + + "stWorkstationConfigs\022?.google.cloud.work" + + "stations.v1beta.ListWorkstationConfigsRe" + + "quest\032@.google.cloud.workstations.v1beta" + + ".ListWorkstationConfigsResponse\"a\202\323\344\223\002R\022" + + "P/v1beta/{parent=projects/*/locations/*/" + + "workstationClusters/*}/workstationConfig" + + "s\332A\006parent\022\233\002\n\034ListUsableWorkstationConf" + + "igs\022E.google.cloud.workstations.v1beta.L" + + "istUsableWorkstationConfigsRequest\032F.goo" + + "gle.cloud.workstations.v1beta.ListUsable" + + "WorkstationConfigsResponse\"l\202\323\344\223\002]\022[/v1b" + + "eta/{parent=projects/*/locations/*/works" + + "tationClusters/*}/workstationConfigs:lis" + + "tUsable\332A\006parent\022\304\002\n\027CreateWorkstationCo" + + "nfig\022@.google.cloud.workstations.v1beta." + + "CreateWorkstationConfigRequest\032\035.google." + + "longrunning.Operation\"\307\001\202\323\344\223\002f\"P/v1beta/" + + "{parent=projects/*/locations/*/workstati" + + "onClusters/*}/workstationConfigs:\022workst" + + "ation_config\332A/parent,workstation_config" + + ",workstation_config_id\312A&\n\021WorkstationCo" + + "nfig\022\021OperationMetadata\022\306\002\n\027UpdateWorkst" + + "ationConfig\022@.google.cloud.workstations." + + "v1beta.UpdateWorkstationConfigRequest\032\035." + + "google.longrunning.Operation\"\311\001\202\323\344\223\002y2c/" + + "v1beta/{workstation_config.name=projects" + + "/*/locations/*/workstationClusters/*/wor" + + "kstationConfigs/*}:\022workstation_config\332A" + + "\036workstation_config,update_mask\312A&\n\021Work" + + "stationConfig\022\021OperationMetadata\022\205\002\n\027Del" + + "eteWorkstationConfig\022@.google.cloud.work" + + "stations.v1beta.DeleteWorkstationConfigR" + + "equest\032\035.google.longrunning.Operation\"\210\001" + + "\202\323\344\223\002R*P/v1beta/{name=projects/*/locatio" + + "ns/*/workstationClusters/*/workstationCo" + + "nfigs/*}\332A\004name\312A&\n\021WorkstationConfig\022\021O" + + "perationMetadata\022\350\001\n\016GetWorkstation\0227.go" + + "ogle.cloud.workstations.v1beta.GetWorkst" + + "ationRequest\032-.google.cloud.workstations" + + ".v1beta.Workstation\"n\202\323\344\223\002a\022_/v1beta/{na" + + "me=projects/*/locations/*/workstationClu" + + "sters/*/workstationConfigs/*/workstation" + + "s/*}\332A\004name\022\373\001\n\020ListWorkstations\0229.googl" + + "e.cloud.workstations.v1beta.ListWorkstat" + + "ionsRequest\032:.google.cloud.workstations." + + "v1beta.ListWorkstationsResponse\"p\202\323\344\223\002a\022" + + "_/v1beta/{parent=projects/*/locations/*/" + + "workstationClusters/*/workstationConfigs" + + "/*}/workstations\332A\006parent\022\230\002\n\026ListUsable" + + "Workstations\022?.google.cloud.workstations" + + ".v1beta.ListUsableWorkstationsRequest\032@." + + "google.cloud.workstations.v1beta.ListUsa" + + "bleWorkstationsResponse\"{\202\323\344\223\002l\022j/v1beta" + + "/{parent=projects/*/locations/*/workstat" + + "ionClusters/*/workstationConfigs/*}/work" + + "stations:listUsable\332A\006parent\022\254\002\n\021CreateW" + + "orkstation\022:.google.cloud.workstations.v" + + "1beta.CreateWorkstationRequest\032\035.google." + + "longrunning.Operation\"\273\001\202\323\344\223\002n\"_/v1beta/" + + "{parent=projects/*/locations/*/workstati" + + "onClusters/*/workstationConfigs/*}/works" + + "tations:\013workstation\332A!parent,workstatio" + + "n,workstation_id\312A \n\013Workstation\022\021Operat" + + "ionMetadata\022\256\002\n\021UpdateWorkstation\022:.goog" + + "le.cloud.workstations.v1beta.UpdateWorks" + + "tationRequest\032\035.google.longrunning.Opera" + + "tion\"\275\001\202\323\344\223\002z2k/v1beta/{workstation.name" + + "=projects/*/locations/*/workstationClust" + + "ers/*/workstationConfigs/*/workstations/" + + "*}:\013workstation\332A\027workstation,update_mas" + + "k\312A \n\013Workstation\022\021OperationMetadata\022\202\002\n" + + "\021DeleteWorkstation\022:.google.cloud.workst" + + "ations.v1beta.DeleteWorkstationRequest\032\035" + + ".google.longrunning.Operation\"\221\001\202\323\344\223\002a*_" + + "/v1beta/{name=projects/*/locations/*/wor" + + "kstationClusters/*/workstationConfigs/*/" + + "workstations/*}\332A\004name\312A \n\013Workstation\022\021" + + "OperationMetadata\022\211\002\n\020StartWorkstation\0229" + + ".google.cloud.workstations.v1beta.StartW" + + "orkstationRequest\032\035.google.longrunning.O" + + "peration\"\232\001\202\323\344\223\002j\"e/v1beta/{name=project" + + "s/*/locations/*/workstationClusters/*/wo" + + "rkstationConfigs/*/workstations/*}:start" + + ":\001*\332A\004name\312A \n\013Workstation\022\021OperationMet" + + "adata\022\206\002\n\017StopWorkstation\0228.google.cloud" + + ".workstations.v1beta.StopWorkstationRequ" + + "est\032\035.google.longrunning.Operation\"\231\001\202\323\344" + + "\223\002i\"d/v1beta/{name=projects/*/locations/" + + "*/workstationClusters/*/workstationConfi" + + "gs/*/workstations/*}:stop:\001*\332A\004name\312A \n\013" + + "Workstation\022\021OperationMetadata\022\250\002\n\023Gener" + + "ateAccessToken\022<.google.cloud.workstatio" + + "ns.v1beta.GenerateAccessTokenRequest\032=.g" + + "oogle.cloud.workstations.v1beta.Generate" + + "AccessTokenResponse\"\223\001\202\323\344\223\002\177\"z/v1beta/{w" + + "orkstation=projects/*/locations/*/workst" + + "ationClusters/*/workstationConfigs/*/wor" + + "kstations/*}:generateAccessToken:\001*\332A\013wo" + + "rkstation\032O\312A\033workstations.googleapis.co" + + "m\322A.https://www.googleapis.com/auth/clou" + + "d-platformB\205\001\n$com.google.cloud.workstat" + + "ions.v1betaB\021WorkstationsProtoP\001ZHcloud." + + "google.com/go/workstations/apiv1beta/wor" + + "kstationspb;workstationspbb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.rpc.StatusProto.getDescriptor(), + }); + internal_static_google_cloud_workstations_v1beta_WorkstationCluster_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_workstations_v1beta_WorkstationCluster_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_WorkstationCluster_descriptor, + new java.lang.String[] { + "Name", + "DisplayName", + "Uid", + "Reconciling", + "Annotations", + "Labels", + "CreateTime", + "UpdateTime", + "DeleteTime", + "Etag", + "Network", + "Subnetwork", + "PrivateClusterConfig", + "Degraded", + "Conditions", + }); + internal_static_google_cloud_workstations_v1beta_WorkstationCluster_PrivateClusterConfig_descriptor = + internal_static_google_cloud_workstations_v1beta_WorkstationCluster_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_workstations_v1beta_WorkstationCluster_PrivateClusterConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_WorkstationCluster_PrivateClusterConfig_descriptor, + new java.lang.String[] { + "EnablePrivateEndpoint", "ClusterHostname", "ServiceAttachmentUri", "AllowedProjects", + }); + internal_static_google_cloud_workstations_v1beta_WorkstationCluster_AnnotationsEntry_descriptor = + internal_static_google_cloud_workstations_v1beta_WorkstationCluster_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_workstations_v1beta_WorkstationCluster_AnnotationsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_WorkstationCluster_AnnotationsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_workstations_v1beta_WorkstationCluster_LabelsEntry_descriptor = + internal_static_google_cloud_workstations_v1beta_WorkstationCluster_descriptor + .getNestedTypes() + .get(2); + internal_static_google_cloud_workstations_v1beta_WorkstationCluster_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_WorkstationCluster_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_descriptor, + new java.lang.String[] { + "Name", + "DisplayName", + "Uid", + "Reconciling", + "Annotations", + "Labels", + "CreateTime", + "UpdateTime", + "DeleteTime", + "Etag", + "IdleTimeout", + "RunningTimeout", + "Host", + "PersistentDirectories", + "Container", + "EncryptionKey", + "Degraded", + "Conditions", + }); + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_descriptor = + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_descriptor, + new java.lang.String[] { + "GceInstance", "Config", + }); + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_GceInstance_descriptor = + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_GceInstance_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_GceInstance_descriptor, + new java.lang.String[] { + "MachineType", + "ServiceAccount", + "Tags", + "PoolSize", + "DisablePublicIpAddresses", + "ShieldedInstanceConfig", + "ConfidentialInstanceConfig", + "BootDiskSizeGb", + }); + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_GceInstance_GceShieldedInstanceConfig_descriptor = + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_GceInstance_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_GceInstance_GceShieldedInstanceConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_GceInstance_GceShieldedInstanceConfig_descriptor, + new java.lang.String[] { + "EnableSecureBoot", "EnableVtpm", "EnableIntegrityMonitoring", + }); + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_GceInstance_GceConfidentialInstanceConfig_descriptor = + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_GceInstance_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_GceInstance_GceConfidentialInstanceConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Host_GceInstance_GceConfidentialInstanceConfig_descriptor, + new java.lang.String[] { + "EnableConfidentialCompute", + }); + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_PersistentDirectory_descriptor = + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_PersistentDirectory_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_PersistentDirectory_descriptor, + new java.lang.String[] { + "MountPath", "GcePd", "DirectoryType", + }); + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_PersistentDirectory_GceRegionalPersistentDisk_descriptor = + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_PersistentDirectory_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_PersistentDirectory_GceRegionalPersistentDisk_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_PersistentDirectory_GceRegionalPersistentDisk_descriptor, + new java.lang.String[] { + "SizeGb", "FsType", "DiskType", "SourceSnapshot", "ReclaimPolicy", + }); + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Container_descriptor = + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_descriptor + .getNestedTypes() + .get(2); + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Container_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Container_descriptor, + new java.lang.String[] { + "Image", "Command", "Args", "Env", "WorkingDir", "RunAsUser", + }); + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Container_EnvEntry_descriptor = + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Container_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Container_EnvEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_Container_EnvEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_CustomerEncryptionKey_descriptor = + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_descriptor + .getNestedTypes() + .get(3); + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_CustomerEncryptionKey_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_CustomerEncryptionKey_descriptor, + new java.lang.String[] { + "KmsKey", "KmsKeyServiceAccount", + }); + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_AnnotationsEntry_descriptor = + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_descriptor + .getNestedTypes() + .get(4); + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_AnnotationsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_AnnotationsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_LabelsEntry_descriptor = + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_descriptor + .getNestedTypes() + .get(5); + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_WorkstationConfig_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_workstations_v1beta_Workstation_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_workstations_v1beta_Workstation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_Workstation_descriptor, + new java.lang.String[] { + "Name", + "DisplayName", + "Uid", + "Reconciling", + "Annotations", + "Labels", + "CreateTime", + "UpdateTime", + "DeleteTime", + "Etag", + "State", + "Host", + }); + internal_static_google_cloud_workstations_v1beta_Workstation_AnnotationsEntry_descriptor = + internal_static_google_cloud_workstations_v1beta_Workstation_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_workstations_v1beta_Workstation_AnnotationsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_Workstation_AnnotationsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_workstations_v1beta_Workstation_LabelsEntry_descriptor = + internal_static_google_cloud_workstations_v1beta_Workstation_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_workstations_v1beta_Workstation_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_Workstation_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_workstations_v1beta_GetWorkstationClusterRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_workstations_v1beta_GetWorkstationClusterRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_GetWorkstationClusterRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_workstations_v1beta_ListWorkstationClustersRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_workstations_v1beta_ListWorkstationClustersRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_ListWorkstationClustersRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_workstations_v1beta_ListWorkstationClustersResponse_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_workstations_v1beta_ListWorkstationClustersResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_ListWorkstationClustersResponse_descriptor, + new java.lang.String[] { + "WorkstationClusters", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_workstations_v1beta_CreateWorkstationClusterRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_workstations_v1beta_CreateWorkstationClusterRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_CreateWorkstationClusterRequest_descriptor, + new java.lang.String[] { + "Parent", "WorkstationClusterId", "WorkstationCluster", "ValidateOnly", + }); + internal_static_google_cloud_workstations_v1beta_UpdateWorkstationClusterRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_workstations_v1beta_UpdateWorkstationClusterRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_UpdateWorkstationClusterRequest_descriptor, + new java.lang.String[] { + "WorkstationCluster", "UpdateMask", "ValidateOnly", "AllowMissing", + }); + internal_static_google_cloud_workstations_v1beta_DeleteWorkstationClusterRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_workstations_v1beta_DeleteWorkstationClusterRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_DeleteWorkstationClusterRequest_descriptor, + new java.lang.String[] { + "Name", "ValidateOnly", "Etag", "Force", + }); + internal_static_google_cloud_workstations_v1beta_GetWorkstationConfigRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_workstations_v1beta_GetWorkstationConfigRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_GetWorkstationConfigRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_workstations_v1beta_ListWorkstationConfigsRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_workstations_v1beta_ListWorkstationConfigsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_ListWorkstationConfigsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_workstations_v1beta_ListWorkstationConfigsResponse_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_workstations_v1beta_ListWorkstationConfigsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_ListWorkstationConfigsResponse_descriptor, + new java.lang.String[] { + "WorkstationConfigs", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_workstations_v1beta_ListUsableWorkstationConfigsRequest_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_workstations_v1beta_ListUsableWorkstationConfigsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_ListUsableWorkstationConfigsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_workstations_v1beta_ListUsableWorkstationConfigsResponse_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_workstations_v1beta_ListUsableWorkstationConfigsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_ListUsableWorkstationConfigsResponse_descriptor, + new java.lang.String[] { + "WorkstationConfigs", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_workstations_v1beta_CreateWorkstationConfigRequest_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_workstations_v1beta_CreateWorkstationConfigRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_CreateWorkstationConfigRequest_descriptor, + new java.lang.String[] { + "Parent", "WorkstationConfigId", "WorkstationConfig", "ValidateOnly", + }); + internal_static_google_cloud_workstations_v1beta_UpdateWorkstationConfigRequest_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_workstations_v1beta_UpdateWorkstationConfigRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_UpdateWorkstationConfigRequest_descriptor, + new java.lang.String[] { + "WorkstationConfig", "UpdateMask", "ValidateOnly", "AllowMissing", + }); + internal_static_google_cloud_workstations_v1beta_DeleteWorkstationConfigRequest_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_cloud_workstations_v1beta_DeleteWorkstationConfigRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_DeleteWorkstationConfigRequest_descriptor, + new java.lang.String[] { + "Name", "ValidateOnly", "Etag", "Force", + }); + internal_static_google_cloud_workstations_v1beta_GetWorkstationRequest_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_cloud_workstations_v1beta_GetWorkstationRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_GetWorkstationRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_workstations_v1beta_ListWorkstationsRequest_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_cloud_workstations_v1beta_ListWorkstationsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_ListWorkstationsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_workstations_v1beta_ListWorkstationsResponse_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_google_cloud_workstations_v1beta_ListWorkstationsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_ListWorkstationsResponse_descriptor, + new java.lang.String[] { + "Workstations", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_workstations_v1beta_ListUsableWorkstationsRequest_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_google_cloud_workstations_v1beta_ListUsableWorkstationsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_ListUsableWorkstationsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_workstations_v1beta_ListUsableWorkstationsResponse_descriptor = + getDescriptor().getMessageTypes().get(21); + internal_static_google_cloud_workstations_v1beta_ListUsableWorkstationsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_ListUsableWorkstationsResponse_descriptor, + new java.lang.String[] { + "Workstations", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_workstations_v1beta_CreateWorkstationRequest_descriptor = + getDescriptor().getMessageTypes().get(22); + internal_static_google_cloud_workstations_v1beta_CreateWorkstationRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_CreateWorkstationRequest_descriptor, + new java.lang.String[] { + "Parent", "WorkstationId", "Workstation", "ValidateOnly", + }); + internal_static_google_cloud_workstations_v1beta_UpdateWorkstationRequest_descriptor = + getDescriptor().getMessageTypes().get(23); + internal_static_google_cloud_workstations_v1beta_UpdateWorkstationRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_UpdateWorkstationRequest_descriptor, + new java.lang.String[] { + "Workstation", "UpdateMask", "ValidateOnly", "AllowMissing", + }); + internal_static_google_cloud_workstations_v1beta_DeleteWorkstationRequest_descriptor = + getDescriptor().getMessageTypes().get(24); + internal_static_google_cloud_workstations_v1beta_DeleteWorkstationRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_DeleteWorkstationRequest_descriptor, + new java.lang.String[] { + "Name", "ValidateOnly", "Etag", + }); + internal_static_google_cloud_workstations_v1beta_StartWorkstationRequest_descriptor = + getDescriptor().getMessageTypes().get(25); + internal_static_google_cloud_workstations_v1beta_StartWorkstationRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_StartWorkstationRequest_descriptor, + new java.lang.String[] { + "Name", "ValidateOnly", "Etag", + }); + internal_static_google_cloud_workstations_v1beta_StopWorkstationRequest_descriptor = + getDescriptor().getMessageTypes().get(26); + internal_static_google_cloud_workstations_v1beta_StopWorkstationRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_StopWorkstationRequest_descriptor, + new java.lang.String[] { + "Name", "ValidateOnly", "Etag", + }); + internal_static_google_cloud_workstations_v1beta_GenerateAccessTokenRequest_descriptor = + getDescriptor().getMessageTypes().get(27); + internal_static_google_cloud_workstations_v1beta_GenerateAccessTokenRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_GenerateAccessTokenRequest_descriptor, + new java.lang.String[] { + "Workstation", "ExpireTime", "Ttl", "Expiration", + }); + internal_static_google_cloud_workstations_v1beta_GenerateAccessTokenResponse_descriptor = + getDescriptor().getMessageTypes().get(28); + internal_static_google_cloud_workstations_v1beta_GenerateAccessTokenResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_GenerateAccessTokenResponse_descriptor, + new java.lang.String[] { + "AccessToken", "ExpireTime", + }); + internal_static_google_cloud_workstations_v1beta_OperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(29); + internal_static_google_cloud_workstations_v1beta_OperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workstations_v1beta_OperationMetadata_descriptor, + new java.lang.String[] { + "CreateTime", + "EndTime", + "Target", + "Verb", + "StatusMessage", + "RequestedCancellation", + "ApiVersion", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.rpc.StatusProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-workstations/proto-google-cloud-workstations-v1beta/src/main/proto/google/cloud/workstations/v1beta/workstations.proto b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/proto/google/cloud/workstations/v1beta/workstations.proto new file mode 100644 index 000000000000..2849f45bcafd --- /dev/null +++ b/java-workstations/proto-google-cloud-workstations-v1beta/src/main/proto/google/cloud/workstations/v1beta/workstations.proto @@ -0,0 +1,1158 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.workstations.v1beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option go_package = "cloud.google.com/go/workstations/apiv1beta/workstationspb;workstationspb"; +option java_multiple_files = true; +option java_outer_classname = "WorkstationsProto"; +option java_package = "com.google.cloud.workstations.v1beta"; + +// Service for interacting with Cloud Workstations. +service Workstations { + option (google.api.default_host) = "workstations.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Returns the requested workstation cluster. + rpc GetWorkstationCluster(GetWorkstationClusterRequest) + returns (WorkstationCluster) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/workstationClusters/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Returns all workstation clusters in the specified location. + rpc ListWorkstationClusters(ListWorkstationClustersRequest) + returns (ListWorkstationClustersResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*}/workstationClusters" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a new workstation cluster. + rpc CreateWorkstationCluster(CreateWorkstationClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*}/workstationClusters" + body: "workstation_cluster" + }; + option (google.api.method_signature) = + "parent,workstation_cluster,workstation_cluster_id"; + option (google.longrunning.operation_info) = { + response_type: "WorkstationCluster" + metadata_type: "OperationMetadata" + }; + } + + // Updates an existing workstation cluster. + rpc UpdateWorkstationCluster(UpdateWorkstationClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta/{workstation_cluster.name=projects/*/locations/*/workstationClusters/*}" + body: "workstation_cluster" + }; + option (google.api.method_signature) = "workstation_cluster,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "WorkstationCluster" + metadata_type: "OperationMetadata" + }; + } + + // Deletes the specified workstation cluster. + rpc DeleteWorkstationCluster(DeleteWorkstationClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta/{name=projects/*/locations/*/workstationClusters/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "WorkstationCluster" + metadata_type: "OperationMetadata" + }; + } + + // Returns the requested workstation configuration. + rpc GetWorkstationConfig(GetWorkstationConfigRequest) + returns (WorkstationConfig) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Returns all workstation configurations in the specified cluster. + rpc ListWorkstationConfigs(ListWorkstationConfigsRequest) + returns (ListWorkstationConfigsResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*/workstationClusters/*}/workstationConfigs" + }; + option (google.api.method_signature) = "parent"; + } + + // Returns all workstation configurations in the specified cluster on which + // the caller has the "workstations.workstation.create" permission. + rpc ListUsableWorkstationConfigs(ListUsableWorkstationConfigsRequest) + returns (ListUsableWorkstationConfigsResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*/workstationClusters/*}/workstationConfigs:listUsable" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a new workstation configuration. + rpc CreateWorkstationConfig(CreateWorkstationConfigRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*/workstationClusters/*}/workstationConfigs" + body: "workstation_config" + }; + option (google.api.method_signature) = + "parent,workstation_config,workstation_config_id"; + option (google.longrunning.operation_info) = { + response_type: "WorkstationConfig" + metadata_type: "OperationMetadata" + }; + } + + // Updates an existing workstation configuration. + rpc UpdateWorkstationConfig(UpdateWorkstationConfigRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta/{workstation_config.name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}" + body: "workstation_config" + }; + option (google.api.method_signature) = "workstation_config,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "WorkstationConfig" + metadata_type: "OperationMetadata" + }; + } + + // Deletes the specified workstation configuration. + rpc DeleteWorkstationConfig(DeleteWorkstationConfigRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "WorkstationConfig" + metadata_type: "OperationMetadata" + }; + } + + // Returns the requested workstation. + rpc GetWorkstation(GetWorkstationRequest) returns (Workstation) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Returns all Workstations using the specified config. + rpc ListWorkstations(ListWorkstationsRequest) + returns (ListWorkstationsResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}/workstations" + }; + option (google.api.method_signature) = "parent"; + } + + // Returns all Workstations using the specified config on which the caller has + // the "workstations.workstations.use" permission. + rpc ListUsableWorkstations(ListUsableWorkstationsRequest) + returns (ListUsableWorkstationsResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}/workstations:listUsable" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a new workstation. + rpc CreateWorkstation(CreateWorkstationRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}/workstations" + body: "workstation" + }; + option (google.api.method_signature) = "parent,workstation,workstation_id"; + option (google.longrunning.operation_info) = { + response_type: "Workstation" + metadata_type: "OperationMetadata" + }; + } + + // Updates an existing workstation. + rpc UpdateWorkstation(UpdateWorkstationRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta/{workstation.name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}" + body: "workstation" + }; + option (google.api.method_signature) = "workstation,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Workstation" + metadata_type: "OperationMetadata" + }; + } + + // Deletes the specified workstation. + rpc DeleteWorkstation(DeleteWorkstationRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Workstation" + metadata_type: "OperationMetadata" + }; + } + + // Starts running a workstation so that users can connect to it. + rpc StartWorkstation(StartWorkstationRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}:start" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Workstation" + metadata_type: "OperationMetadata" + }; + } + + // Stops running a workstation, reducing costs. + rpc StopWorkstation(StopWorkstationRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}:stop" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Workstation" + metadata_type: "OperationMetadata" + }; + } + + // Returns a short-lived credential that can be used to send authenticated and + // authorized traffic to a workstation. + rpc GenerateAccessToken(GenerateAccessTokenRequest) + returns (GenerateAccessTokenResponse) { + option (google.api.http) = { + post: "/v1beta/{workstation=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}:generateAccessToken" + body: "*" + }; + option (google.api.method_signature) = "workstation"; + } +} + +// A grouping of workstation configurations and the associated workstations +// in that region. +message WorkstationCluster { + option (google.api.resource) = { + type: "workstations.googleapis.com/WorkstationCluster" + pattern: "projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}" + style: DECLARATIVE_FRIENDLY + }; + + // Configuration options for private clusters. + message PrivateClusterConfig { + // Immutable. Whether Workstations endpoint is private. + bool enable_private_endpoint = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. Hostname for the workstation cluster. This field will be + // populated only when private endpoint is enabled. To access workstations + // in the cluster, create a new DNS zone mapping this domain name to an + // internal IP address and a forwarding rule mapping that address to the + // service attachment. + string cluster_hostname = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Service attachment URI for the workstation cluster. The + // service attachemnt is created when private endpoint is enabled. To access + // workstations in the cluster, configure access to the managed service + // using [Private Service + // Connect](https://cloud.google.com/vpc/docs/configure-private-service-connect-services). + string service_attachment_uri = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Additional projects that are allowed to attach to the workstation + // cluster's service attachment. By default, the workstation cluster's + // project and the VPC host project (if different) are allowed. + repeated string allowed_projects = 4; + } + + // Full name of this resource. + string name = 1; + + // Human-readable name for this resource. + string display_name = 2; + + // Output only. A system-assigned unique identified for this resource. + string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Indicates whether this resource is currently being updated to + // match its intended state. + bool reconciling = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Client-specified annotations. + map annotations = 5; + + // Client-specified labels that are applied to the resource and that are also + // propagated to the underlying Compute Engine resources. + map labels = 15; + + // Output only. Time when this resource was created. + google.protobuf.Timestamp create_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when this resource was most recently updated. + google.protobuf.Timestamp update_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when this resource was soft-deleted. + google.protobuf.Timestamp delete_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Checksum computed by the server. May be sent on update and delete requests + // to ensure that the client has an up-to-date value before proceeding. + string etag = 9; + + // Immutable. Name of the Compute Engine network in which instances associated + // with this cluster will be created. + string network = 10 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. Name of the Compute Engine subnetwork in which instances + // associated with this cluster will be created. Must be part of the + // subnetwork specified for this cluster. + string subnetwork = 11 [(google.api.field_behavior) = IMMUTABLE]; + + // Configuration for private cluster. + PrivateClusterConfig private_cluster_config = 12; + + // Output only. Whether this resource is in degraded mode, in which case it + // may require user action to restore full functionality. Details can be found + // in the `conditions` field. + bool degraded = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Status conditions describing the current resource state. + repeated google.rpc.Status conditions = 14 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A set of configuration options describing how a workstation will be run. +// Workstation configurations are intended to be shared across multiple +// workstations. +message WorkstationConfig { + option (google.api.resource) = { + type: "workstations.googleapis.com/WorkstationConfig" + pattern: "projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}/workstationConfigs/{workstation_config}" + style: DECLARATIVE_FRIENDLY + }; + + // Runtime host for a workstation. + message Host { + // A runtime using a Compute Engine instance. + message GceInstance { + // A set of Compute Engine Shielded instance options. + message GceShieldedInstanceConfig { + // Whether the instance has Secure Boot enabled. + bool enable_secure_boot = 1; + + // Whether the instance has the vTPM enabled. + bool enable_vtpm = 2; + + // Whether the instance has integrity monitoring enabled. + bool enable_integrity_monitoring = 3; + } + + // A set of Compute Engine Confidential VM instance options. + message GceConfidentialInstanceConfig { + // Whether the instance has confidential compute enabled. + bool enable_confidential_compute = 1; + } + + // The name of a Compute Engine machine type. + string machine_type = 1; + + // Email address of the service account that will be used on VM instances + // used to support this config. This service account must have permission + // to pull the specified container image. If not set, VMs will run without + // a service account, in which case the image must be publicly accessible. + string service_account = 2; + + // Network tags to add to the Compute Engine machines backing the + // Workstations. + repeated string tags = 4; + + // Number of instances to pool for faster workstation starup. + int32 pool_size = 5; + + // Whether instances have no public IP address. + bool disable_public_ip_addresses = 6; + + // A set of Compute Engine Shielded instance options. + GceShieldedInstanceConfig shielded_instance_config = 8; + + // A set of Compute Engine Confidential VM instance options. + GceConfidentialInstanceConfig confidential_instance_config = 10; + + // Size of the boot disk in GB. + int32 boot_disk_size_gb = 9; + } + + // Type of host that will be used for the workstation's runtime. + oneof config { + // Specifies a Compute Engine instance as the host. + GceInstance gce_instance = 1; + } + } + + // A directory to persist across workstation sessions. + message PersistentDirectory { + // A PersistentDirectory backed by a Compute Engine regional persistent + // disk. + message GceRegionalPersistentDisk { + // Value representing what should happen to the disk after the workstation + // is deleted. + enum ReclaimPolicy { + // Do not use. + RECLAIM_POLICY_UNSPECIFIED = 0; + + // The persistent disk will be deleted with the workstation. + DELETE = 1; + + // The persistent disk will be remain after the workstation is deleted, + // and the administrator must manually delete the disk. + RETAIN = 2; + } + + // Size of the disk in GB. Must be empty if source_snapshot is set. + int32 size_gb = 1; + + // Type of file system that the disk should be formatted with. The + // workstation image must support this file system type. Must be empty + // if source_snapshot is set. + string fs_type = 2; + + // Type of the disk to use. + string disk_type = 3; + + // Name of the snapshot to use as the source for the disk. If set, + // size_gb and fs_type must be empty. + string source_snapshot = 5; + + // What should happen to the disk after the workstation is deleted. + // Defaults to DELETE. + ReclaimPolicy reclaim_policy = 4; + } + + // Location of this directory in the running workstation. + string mount_path = 1; + + // How a persistent directory should be implemented. + oneof directory_type { + // A PersistentDirectory backed by a Compute Engine persistent disk. + GceRegionalPersistentDisk gce_pd = 2; + } + } + + // A Docker container. + message Container { + // Docker image defining the container. This image must be accessible by the + // config's service account. + string image = 1; + + // If set, overrides the default ENTRYPOINT specified by the image. + repeated string command = 2; + + // Arguments passed to the entrypoint. + repeated string args = 3; + + // Environment variables passed to the container. + map env = 4; + + // If set, overrides the default DIR specified by the image. + string working_dir = 5; + + // If set, overrides the USER specified in the image with the given uid. + int32 run_as_user = 6; + } + + // A customer-managed encryption key for the Compute Engine resources + // of this workstation configuration. + message CustomerEncryptionKey { + // The name of the Google Cloud KMS encryption key. For example, + // `projects/PROJECT_ID/locations/REGION/keyRings/KEY_RING/cryptoKeys/KEY_NAME`. + string kms_key = 1; + + // The service account to use with the specified + // KMS key. We recommend that you use a separate service account + // and follow KMS best practices. For more information, see + // [Separation of + // duties](https://cloud.google.com/kms/docs/separation-of-duties) and + // `gcloud kms keys add-iam-policy-binding` + // [`--member`](https://cloud.google.com/sdk/gcloud/reference/kms/keys/add-iam-policy-binding#--member). + string kms_key_service_account = 2; + } + + // Full name of this resource. + string name = 1; + + // Human-readable name for this resource. + string display_name = 2; + + // Output only. A system-assigned unique identified for this resource. + string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Indicates whether this resource is currently being updated to + // match its intended state. + bool reconciling = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Client-specified annotations. + map annotations = 5; + + // Client-specified labels that are applied to the resource and that are also + // propagated to the underlying Compute Engine resources. + map labels = 18; + + // Output only. Time when this resource was created. + google.protobuf.Timestamp create_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when this resource was most recently updated. + google.protobuf.Timestamp update_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when this resource was soft-deleted. + google.protobuf.Timestamp delete_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Checksum computed by the server. May be sent on update and delete requests + // to ensure that the client has an up-to-date value before proceeding. + string etag = 9; + + // How long to wait before automatically stopping an instance that hasn't + // received any user traffic. A value of 0 indicates that this instance + // should never time out due to idleness. Defaults to 20 minutes. + google.protobuf.Duration idle_timeout = 10; + + // How long to wait before automatically stopping a workstation after it + // started. A value of 0 indicates that workstations using this configuration + // should never time out. Must be greater than 0 and less than 24 hours if + // encryption_key is set. Defaults to 12 hours. + google.protobuf.Duration running_timeout = 11; + + // Runtime host for the workstation. + Host host = 12; + + // Directories to persist across workstation sessions. + repeated PersistentDirectory persistent_directories = 13; + + // Container that will be run for each workstation using this configuration + // when that workstation is started. + Container container = 14; + + // Encrypts resources of this workstation configuration using a + // customer-managed encryption key. + // + // If specified, the boot disk of the Compute Engine instance and the + // persistent disk are encrypted using this encryption key. If + // this field is not set, the disks are encrypted using a generated + // key. Customer-managed encryption keys do not protect disk metadata. + // + // If the customer-managed encryption key is rotated, when the workstation + // instance is stopped, the system attempts to recreate the + // persistent disk with the new version of the key. Be sure to keep + // older versions of the key until the persistent disk is recreated. + // Otherwise, data on the persistent disk will be lost. + // + // If the encryption key is revoked, the workstation session will + // automatically be stopped within 7 hours. + CustomerEncryptionKey encryption_key = 17; + + // Output only. Whether this resource is in degraded mode, in which case it + // may require user action to restore full functionality. Details can be found + // in the `conditions` field. + bool degraded = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Status conditions describing the current resource state. + repeated google.rpc.Status conditions = 16 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A single instance of a developer workstation with its own persistent storage. +message Workstation { + option (google.api.resource) = { + type: "workstations.googleapis.com/Workstation" + pattern: "projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}/workstationConfigs/{workstation_config}/workstations/{workstation}" + style: DECLARATIVE_FRIENDLY + }; + + // Whether a workstation is running and ready to receive user requests. + enum State { + // Do not use. + STATE_UNSPECIFIED = 0; + + // The workstation is not yet ready to accept requests from users but will + // be soon. + STATE_STARTING = 1; + + // The workstation is ready to accept requests from users. + STATE_RUNNING = 2; + + // The workstation is being stopped. + STATE_STOPPING = 3; + + // The workstation is stopped and will not be able to receive requests until + // it is started. + STATE_STOPPED = 4; + } + + // Full name of this resource. + string name = 1; + + // Human-readable name for this resource. + string display_name = 2; + + // Output only. A system-assigned unique identified for this resource. + string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Indicates whether this resource is currently being updated to + // match its intended state. + bool reconciling = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Client-specified annotations. + map annotations = 5; + + // Client-specified labels that are applied to the resource and that are also + // propagated to the underlying Compute Engine resources. + map labels = 13; + + // Output only. Time when this resource was created. + google.protobuf.Timestamp create_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when this resource was most recently updated. + google.protobuf.Timestamp update_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when this resource was soft-deleted. + google.protobuf.Timestamp delete_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Checksum computed by the server. May be sent on update and delete requests + // to ensure that the client has an up-to-date value before proceeding. + string etag = 9; + + // Output only. Current state of the workstation. + State state = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Host to which clients can send HTTPS traffic that will be + // received by the workstation. Authorized traffic will be received to the + // workstation as HTTP on port 80. To send traffic to a different port, + // clients may prefix the host with the destination port in the format + // `{port}-{host}`. + string host = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for GetWorkstationCluster. +message GetWorkstationClusterRequest { + // Required. Name of the requested resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workstations.googleapis.com/WorkstationCluster" + } + ]; +} + +// Request message for ListWorkstationClusters. +message ListWorkstationClustersRequest { + // Required. Parent resource name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "workstations.googleapis.com/WorkstationCluster" + } + ]; + + // Maximum number of items to return. + int32 page_size = 2; + + // next_page_token value returned from a previous List request, if any. + string page_token = 3; +} + +// Response message for ListWorkstationClusters. +message ListWorkstationClustersResponse { + // The requested workstation clusters. + repeated WorkstationCluster workstation_clusters = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; + + // Unreachable resources. + repeated string unreachable = 3; +} + +// Message for creating a CreateWorkstationCluster. +message CreateWorkstationClusterRequest { + // Required. Parent resource name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "workstations.googleapis.com/WorkstationCluster" + } + ]; + + // Required. ID to use for the workstation cluster. + string workstation_cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Workstation cluster to create. + WorkstationCluster workstation_cluster = 3 + [(google.api.field_behavior) = REQUIRED]; + + // If set, validate the request and preview the review, but do not actually + // apply it. + bool validate_only = 4; +} + +// Request message for UpdateWorkstationCluster. +message UpdateWorkstationClusterRequest { + // Required. Workstation cluster to update. + WorkstationCluster workstation_cluster = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Mask that specifies which fields in the workstation cluster + // should be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; + + // If set, validate the request and preview the review, but do not actually + // apply it. + bool validate_only = 3; + + // If set, and the workstation cluster is not found, a new workstation + // cluster will be created. In this situation, update_mask is ignored. + bool allow_missing = 4; +} + +// Message for deleting a workstation cluster. +message DeleteWorkstationClusterRequest { + // Required. Name of the workstation cluster to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workstations.googleapis.com/WorkstationCluster" + } + ]; + + // If set, validate the request and preview the review, but do not apply it. + bool validate_only = 2; + + // If set, the request will be rejected if the latest version of the + // workstation cluster on the server does not have this etag. + string etag = 3; + + // If set, any workstation configurations and workstations in the + // workstation cluster are also deleted. Otherwise, the request only + // works if the workstation cluster has no configurations or workstations. + bool force = 4; +} + +// Request message for GetWorkstationConfig. +message GetWorkstationConfigRequest { + // Required. Name of the requested resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workstations.googleapis.com/WorkstationConfig" + } + ]; +} + +// Request message for ListWorkstationConfigs. +message ListWorkstationConfigsRequest { + // Required. Parent resource name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workstations.googleapis.com/WorkstationCluster" + } + ]; + + // Maximum number of items to return. + int32 page_size = 2; + + // next_page_token value returned from a previous List request, if any. + string page_token = 3; +} + +// Response message for ListWorkstationConfigs. +message ListWorkstationConfigsResponse { + // The requested configs. + repeated WorkstationConfig workstation_configs = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; + + // Unreachable resources. + repeated string unreachable = 3; +} + +// Request message for ListUsableWorkstationConfigs. +message ListUsableWorkstationConfigsRequest { + // Required. Parent resource name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workstations.googleapis.com/WorkstationCluster" + } + ]; + + // Maximum number of items to return. + int32 page_size = 2; + + // next_page_token value returned from a previous List request, if any. + string page_token = 3; +} + +// Response message for ListUsableWorkstationConfigs. +message ListUsableWorkstationConfigsResponse { + // The requested configs. + repeated WorkstationConfig workstation_configs = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; + + // Unreachable resources. + repeated string unreachable = 3; +} + +// Message for creating a CreateWorkstationConfig. +message CreateWorkstationConfigRequest { + // Required. Parent resource name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workstations.googleapis.com/WorkstationCluster" + } + ]; + + // Required. ID to use for the config. + string workstation_config_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Config to create. + WorkstationConfig workstation_config = 3 + [(google.api.field_behavior) = REQUIRED]; + + // If set, validate the request and preview the review, but do not actually + // apply it. + bool validate_only = 4; +} + +// Request message for UpdateWorkstationConfig. +message UpdateWorkstationConfigRequest { + // Required. Config to update. + WorkstationConfig workstation_config = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Mask specifying which fields in the config should be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; + + // If set, validate the request and preview the review, but do not actually + // apply it. + bool validate_only = 3; + + // If set, and the config is not found, a new config will be created. + // In this situation, update_mask is ignored. + bool allow_missing = 4; +} + +// Message for deleting a workstation configuration. +message DeleteWorkstationConfigRequest { + // Required. Name of the config to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workstations.googleapis.com/WorkstationConfig" + } + ]; + + // If set, validate the request and preview the review, but do not actually + // apply it. + bool validate_only = 2; + + // If set, the request will be rejected if the latest version of the config on + // the server does not have this etag. + string etag = 3; + + // If set, any Workstations in the config will also be deleted. Otherwise, + // the request will work only if the config has no workstations. + bool force = 4; +} + +// Request message for GetWorkstation. +message GetWorkstationRequest { + // Required. Name of the requested resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workstations.googleapis.com/Workstation" + } + ]; +} + +// Request message for ListWorkstations. +message ListWorkstationsRequest { + // Required. Parent resource name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workstations.googleapis.com/WorkstationConfig" + } + ]; + + // Maximum number of items to return. + int32 page_size = 2; + + // next_page_token value returned from a previous List request, if any. + string page_token = 3; +} + +// Response message for ListWorkstations. +message ListWorkstationsResponse { + // The requested workstations. + repeated Workstation workstations = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; + + // Unreachable resources. + repeated string unreachable = 3; +} + +// Request message for ListUsableWorkstations. +message ListUsableWorkstationsRequest { + // Required. Parent resource name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workstations.googleapis.com/WorkstationConfig" + } + ]; + + // Maximum number of items to return. + int32 page_size = 2; + + // next_page_token value returned from a previous List request, if any. + string page_token = 3; +} + +// Response message for ListUsableWorkstations. +message ListUsableWorkstationsResponse { + // The requested workstations. + repeated Workstation workstations = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; + + // Unreachable resources. + repeated string unreachable = 3; +} + +// Message for creating a CreateWorkstation. +message CreateWorkstationRequest { + // Required. Parent resource name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workstations.googleapis.com/WorkstationConfig" + } + ]; + + // Required. ID to use for the workstation. + string workstation_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Workstation to create. + Workstation workstation = 3 [(google.api.field_behavior) = REQUIRED]; + + // If set, validate the request and preview the review, but do not actually + // apply it. + bool validate_only = 4; +} + +// Request message for UpdateWorkstation. +message UpdateWorkstationRequest { + // Required. Workstation to update. + Workstation workstation = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Mask specifying which fields in the config should be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; + + // If set, validate the request and preview the review, but do not actually + // apply it. + bool validate_only = 3; + + // If set, and the config is not found, a new config will be created. + // In this situation, update_mask is ignored. + bool allow_missing = 4; +} + +// Request message for DeleteWorkstation. +message DeleteWorkstationRequest { + // Required. Name of the workstation to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workstations.googleapis.com/Workstation" + } + ]; + + // If set, validate the request and preview the review, but do not actually + // apply it. + bool validate_only = 2; + + // If set, the request will be rejected if the latest version of the + // workstation on the server does not have this etag. + string etag = 3; +} + +// Request message for StartWorkstation. +message StartWorkstationRequest { + // Required. Name of the workstation to start. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workstations.googleapis.com/Workstation" + } + ]; + + // If set, validate the request and preview the review, but do not actually + // apply it. + bool validate_only = 2; + + // If set, the request will be rejected if the latest version of the + // workstation on the server does not have this etag. + string etag = 3; +} + +// Request message for StopWorkstation. +message StopWorkstationRequest { + // Required. Name of the workstation to stop. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workstations.googleapis.com/Workstation" + } + ]; + + // If set, validate the request and preview the review, but do not actually + // apply it. + bool validate_only = 2; + + // If set, the request will be rejected if the latest version of the + // workstation on the server does not have this etag. + string etag = 3; +} + +// Request message for GenerateAccessToken. +message GenerateAccessTokenRequest { + // Required. Name of the workstation for which the access token should be + // generated. + string workstation = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workstations.googleapis.com/Workstation" + } + ]; + + // Desired expiration or lifetime of the access token. + oneof expiration { + // Desired expiration time of the access token. This value must + // be at most 24 hours in the future. If a value is not specified, the + // token's expiration time will be set to a default value of 1 hour in the + // future. + google.protobuf.Timestamp expire_time = 2; + + // Desired lifetime duration of the access token. This value must + // be at most 24 hours. If a value is not specified, the token's lifetime + // will be set to a default value of 1 hour. + google.protobuf.Duration ttl = 3; + } +} + +// Response message for GenerateAccessToken. +message GenerateAccessTokenResponse { + // The generated bearer access token. To use this token, include it in an + // Authorization header of an HTTP request sent to the associated + // workstation's hostname, for example, `Authorization: Bearer + // `. + string access_token = 1; + + // Time at which the generated token will expire. + google.protobuf.Timestamp expire_time = 2; +} + +// Metadata for long-running operations. +message OperationMetadata { + // Output only. Time that the operation was created. + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time that the operation finished running. + google.protobuf.Timestamp end_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. + bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/stub/workstationsstubsettings/getworkstationcluster/SyncGetWorkstationCluster.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/stub/workstationsstubsettings/getworkstationcluster/SyncGetWorkstationCluster.java new file mode 100644 index 000000000000..c39009332619 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/stub/workstationsstubsettings/getworkstationcluster/SyncGetWorkstationCluster.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 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.workstations.v1beta.stub.samples; + +// [START workstations_v1beta_generated_WorkstationsStubSettings_GetWorkstationCluster_sync] +import com.google.cloud.workstations.v1beta.stub.WorkstationsStubSettings; +import java.time.Duration; + +public class SyncGetWorkstationCluster { + + public static void main(String[] args) throws Exception { + syncGetWorkstationCluster(); + } + + public static void syncGetWorkstationCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + WorkstationsStubSettings.Builder workstationsSettingsBuilder = + WorkstationsStubSettings.newBuilder(); + workstationsSettingsBuilder + .getWorkstationClusterSettings() + .setRetrySettings( + workstationsSettingsBuilder + .getWorkstationClusterSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + WorkstationsStubSettings workstationsSettings = workstationsSettingsBuilder.build(); + } +} +// [END workstations_v1beta_generated_WorkstationsStubSettings_GetWorkstationCluster_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/create/SyncCreateSetCredentialsProvider.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..5ffcf6edc3a2 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.workstations.v1beta.WorkstationsClient; +import com.google.cloud.workstations.v1beta.WorkstationsSettings; +import com.google.cloud.workstations.v1beta.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + WorkstationsSettings workstationsSettings = + WorkstationsSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + WorkstationsClient workstationsClient = WorkstationsClient.create(workstationsSettings); + } +} +// [END workstations_v1beta_generated_Workstations_Create_SetCredentialsProvider_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/create/SyncCreateSetCredentialsProvider1.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..a7fefa8e2c89 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_Create_SetCredentialsProvider1_sync] +import com.google.cloud.workstations.v1beta.WorkstationsClient; +import com.google.cloud.workstations.v1beta.WorkstationsSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + WorkstationsSettings workstationsSettings = WorkstationsSettings.newHttpJsonBuilder().build(); + WorkstationsClient workstationsClient = WorkstationsClient.create(workstationsSettings); + } +} +// [END workstations_v1beta_generated_Workstations_Create_SetCredentialsProvider1_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/create/SyncCreateSetEndpoint.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..d7177603827a --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/create/SyncCreateSetEndpoint.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_Create_SetEndpoint_sync] +import com.google.cloud.workstations.v1beta.WorkstationsClient; +import com.google.cloud.workstations.v1beta.WorkstationsSettings; +import com.google.cloud.workstations.v1beta.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + WorkstationsSettings workstationsSettings = + WorkstationsSettings.newBuilder().setEndpoint(myEndpoint).build(); + WorkstationsClient workstationsClient = WorkstationsClient.create(workstationsSettings); + } +} +// [END workstations_v1beta_generated_Workstations_Create_SetEndpoint_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstation/AsyncCreateWorkstation.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstation/AsyncCreateWorkstation.java new file mode 100644 index 000000000000..9a360ce05789 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstation/AsyncCreateWorkstation.java @@ -0,0 +1,60 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_CreateWorkstation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.workstations.v1beta.CreateWorkstationRequest; +import com.google.cloud.workstations.v1beta.Workstation; +import com.google.cloud.workstations.v1beta.WorkstationConfigName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; +import com.google.longrunning.Operation; + +public class AsyncCreateWorkstation { + + public static void main(String[] args) throws Exception { + asyncCreateWorkstation(); + } + + public static void asyncCreateWorkstation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + CreateWorkstationRequest request = + CreateWorkstationRequest.newBuilder() + .setParent( + WorkstationConfigName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]") + .toString()) + .setWorkstationId("workstationId560540030") + .setWorkstation(Workstation.newBuilder().build()) + .setValidateOnly(true) + .build(); + ApiFuture future = + workstationsClient.createWorkstationCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_CreateWorkstation_async] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstation/AsyncCreateWorkstationLRO.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstation/AsyncCreateWorkstationLRO.java new file mode 100644 index 000000000000..5a96822513f7 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstation/AsyncCreateWorkstationLRO.java @@ -0,0 +1,60 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_CreateWorkstation_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.workstations.v1beta.CreateWorkstationRequest; +import com.google.cloud.workstations.v1beta.OperationMetadata; +import com.google.cloud.workstations.v1beta.Workstation; +import com.google.cloud.workstations.v1beta.WorkstationConfigName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class AsyncCreateWorkstationLRO { + + public static void main(String[] args) throws Exception { + asyncCreateWorkstationLRO(); + } + + public static void asyncCreateWorkstationLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + CreateWorkstationRequest request = + CreateWorkstationRequest.newBuilder() + .setParent( + WorkstationConfigName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]") + .toString()) + .setWorkstationId("workstationId560540030") + .setWorkstation(Workstation.newBuilder().build()) + .setValidateOnly(true) + .build(); + OperationFuture future = + workstationsClient.createWorkstationOperationCallable().futureCall(request); + // Do something. + Workstation response = future.get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_CreateWorkstation_LRO_async] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstation/SyncCreateWorkstation.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstation/SyncCreateWorkstation.java new file mode 100644 index 000000000000..0ea26990cce7 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstation/SyncCreateWorkstation.java @@ -0,0 +1,55 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_CreateWorkstation_sync] +import com.google.cloud.workstations.v1beta.CreateWorkstationRequest; +import com.google.cloud.workstations.v1beta.Workstation; +import com.google.cloud.workstations.v1beta.WorkstationConfigName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncCreateWorkstation { + + public static void main(String[] args) throws Exception { + syncCreateWorkstation(); + } + + public static void syncCreateWorkstation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + CreateWorkstationRequest request = + CreateWorkstationRequest.newBuilder() + .setParent( + WorkstationConfigName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]") + .toString()) + .setWorkstationId("workstationId560540030") + .setWorkstation(Workstation.newBuilder().build()) + .setValidateOnly(true) + .build(); + Workstation response = workstationsClient.createWorkstationAsync(request).get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_CreateWorkstation_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstation/SyncCreateWorkstationStringWorkstationString.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstation/SyncCreateWorkstationStringWorkstationString.java new file mode 100644 index 000000000000..edbf16d8d730 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstation/SyncCreateWorkstationStringWorkstationString.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_CreateWorkstation_StringWorkstationString_sync] +import com.google.cloud.workstations.v1beta.Workstation; +import com.google.cloud.workstations.v1beta.WorkstationConfigName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncCreateWorkstationStringWorkstationString { + + public static void main(String[] args) throws Exception { + syncCreateWorkstationStringWorkstationString(); + } + + public static void syncCreateWorkstationStringWorkstationString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + String parent = + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]") + .toString(); + Workstation workstation = Workstation.newBuilder().build(); + String workstationId = "workstationId560540030"; + Workstation response = + workstationsClient.createWorkstationAsync(parent, workstation, workstationId).get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_CreateWorkstation_StringWorkstationString_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstation/SyncCreateWorkstationWorkstationconfignameWorkstationString.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstation/SyncCreateWorkstationWorkstationconfignameWorkstationString.java new file mode 100644 index 000000000000..ad06b0d5d5e0 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstation/SyncCreateWorkstationWorkstationconfignameWorkstationString.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_CreateWorkstation_WorkstationconfignameWorkstationString_sync] +import com.google.cloud.workstations.v1beta.Workstation; +import com.google.cloud.workstations.v1beta.WorkstationConfigName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncCreateWorkstationWorkstationconfignameWorkstationString { + + public static void main(String[] args) throws Exception { + syncCreateWorkstationWorkstationconfignameWorkstationString(); + } + + public static void syncCreateWorkstationWorkstationconfignameWorkstationString() + throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + WorkstationConfigName parent = + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]"); + Workstation workstation = Workstation.newBuilder().build(); + String workstationId = "workstationId560540030"; + Workstation response = + workstationsClient.createWorkstationAsync(parent, workstation, workstationId).get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_CreateWorkstation_WorkstationconfignameWorkstationString_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstationcluster/AsyncCreateWorkstationCluster.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstationcluster/AsyncCreateWorkstationCluster.java new file mode 100644 index 000000000000..c75ca6cd0a93 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstationcluster/AsyncCreateWorkstationCluster.java @@ -0,0 +1,54 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_CreateWorkstationCluster_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest; +import com.google.cloud.workstations.v1beta.LocationName; +import com.google.cloud.workstations.v1beta.WorkstationCluster; +import com.google.cloud.workstations.v1beta.WorkstationsClient; +import com.google.longrunning.Operation; + +public class AsyncCreateWorkstationCluster { + + public static void main(String[] args) throws Exception { + asyncCreateWorkstationCluster(); + } + + public static void asyncCreateWorkstationCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + CreateWorkstationClusterRequest request = + CreateWorkstationClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setWorkstationClusterId("workstationClusterId351421170") + .setWorkstationCluster(WorkstationCluster.newBuilder().build()) + .setValidateOnly(true) + .build(); + ApiFuture future = + workstationsClient.createWorkstationClusterCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_CreateWorkstationCluster_async] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstationcluster/AsyncCreateWorkstationClusterLRO.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstationcluster/AsyncCreateWorkstationClusterLRO.java new file mode 100644 index 000000000000..c1a8bde55225 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstationcluster/AsyncCreateWorkstationClusterLRO.java @@ -0,0 +1,54 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_CreateWorkstationCluster_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest; +import com.google.cloud.workstations.v1beta.LocationName; +import com.google.cloud.workstations.v1beta.OperationMetadata; +import com.google.cloud.workstations.v1beta.WorkstationCluster; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class AsyncCreateWorkstationClusterLRO { + + public static void main(String[] args) throws Exception { + asyncCreateWorkstationClusterLRO(); + } + + public static void asyncCreateWorkstationClusterLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + CreateWorkstationClusterRequest request = + CreateWorkstationClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setWorkstationClusterId("workstationClusterId351421170") + .setWorkstationCluster(WorkstationCluster.newBuilder().build()) + .setValidateOnly(true) + .build(); + OperationFuture future = + workstationsClient.createWorkstationClusterOperationCallable().futureCall(request); + // Do something. + WorkstationCluster response = future.get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_CreateWorkstationCluster_LRO_async] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstationcluster/SyncCreateWorkstationCluster.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstationcluster/SyncCreateWorkstationCluster.java new file mode 100644 index 000000000000..9f958e668ba9 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstationcluster/SyncCreateWorkstationCluster.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_CreateWorkstationCluster_sync] +import com.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest; +import com.google.cloud.workstations.v1beta.LocationName; +import com.google.cloud.workstations.v1beta.WorkstationCluster; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncCreateWorkstationCluster { + + public static void main(String[] args) throws Exception { + syncCreateWorkstationCluster(); + } + + public static void syncCreateWorkstationCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + CreateWorkstationClusterRequest request = + CreateWorkstationClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setWorkstationClusterId("workstationClusterId351421170") + .setWorkstationCluster(WorkstationCluster.newBuilder().build()) + .setValidateOnly(true) + .build(); + WorkstationCluster response = workstationsClient.createWorkstationClusterAsync(request).get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_CreateWorkstationCluster_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstationcluster/SyncCreateWorkstationClusterLocationnameWorkstationclusterString.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstationcluster/SyncCreateWorkstationClusterLocationnameWorkstationclusterString.java new file mode 100644 index 000000000000..98afbb8566a3 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstationcluster/SyncCreateWorkstationClusterLocationnameWorkstationclusterString.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_CreateWorkstationCluster_LocationnameWorkstationclusterString_sync] +import com.google.cloud.workstations.v1beta.LocationName; +import com.google.cloud.workstations.v1beta.WorkstationCluster; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncCreateWorkstationClusterLocationnameWorkstationclusterString { + + public static void main(String[] args) throws Exception { + syncCreateWorkstationClusterLocationnameWorkstationclusterString(); + } + + public static void syncCreateWorkstationClusterLocationnameWorkstationclusterString() + throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + WorkstationCluster workstationCluster = WorkstationCluster.newBuilder().build(); + String workstationClusterId = "workstationClusterId351421170"; + WorkstationCluster response = + workstationsClient + .createWorkstationClusterAsync(parent, workstationCluster, workstationClusterId) + .get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_CreateWorkstationCluster_LocationnameWorkstationclusterString_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstationcluster/SyncCreateWorkstationClusterStringWorkstationclusterString.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstationcluster/SyncCreateWorkstationClusterStringWorkstationclusterString.java new file mode 100644 index 000000000000..495b02dbb5b6 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstationcluster/SyncCreateWorkstationClusterStringWorkstationclusterString.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_CreateWorkstationCluster_StringWorkstationclusterString_sync] +import com.google.cloud.workstations.v1beta.LocationName; +import com.google.cloud.workstations.v1beta.WorkstationCluster; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncCreateWorkstationClusterStringWorkstationclusterString { + + public static void main(String[] args) throws Exception { + syncCreateWorkstationClusterStringWorkstationclusterString(); + } + + public static void syncCreateWorkstationClusterStringWorkstationclusterString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + WorkstationCluster workstationCluster = WorkstationCluster.newBuilder().build(); + String workstationClusterId = "workstationClusterId351421170"; + WorkstationCluster response = + workstationsClient + .createWorkstationClusterAsync(parent, workstationCluster, workstationClusterId) + .get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_CreateWorkstationCluster_StringWorkstationclusterString_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstationconfig/AsyncCreateWorkstationConfig.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstationconfig/AsyncCreateWorkstationConfig.java new file mode 100644 index 000000000000..0614c3cd646d --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstationconfig/AsyncCreateWorkstationConfig.java @@ -0,0 +1,56 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_CreateWorkstationConfig_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest; +import com.google.cloud.workstations.v1beta.WorkstationClusterName; +import com.google.cloud.workstations.v1beta.WorkstationConfig; +import com.google.cloud.workstations.v1beta.WorkstationsClient; +import com.google.longrunning.Operation; + +public class AsyncCreateWorkstationConfig { + + public static void main(String[] args) throws Exception { + asyncCreateWorkstationConfig(); + } + + public static void asyncCreateWorkstationConfig() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + CreateWorkstationConfigRequest request = + CreateWorkstationConfigRequest.newBuilder() + .setParent( + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]") + .toString()) + .setWorkstationConfigId("workstationConfigId798542368") + .setWorkstationConfig(WorkstationConfig.newBuilder().build()) + .setValidateOnly(true) + .build(); + ApiFuture future = + workstationsClient.createWorkstationConfigCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_CreateWorkstationConfig_async] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstationconfig/AsyncCreateWorkstationConfigLRO.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstationconfig/AsyncCreateWorkstationConfigLRO.java new file mode 100644 index 000000000000..4b12a11ae7e8 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstationconfig/AsyncCreateWorkstationConfigLRO.java @@ -0,0 +1,56 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_CreateWorkstationConfig_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest; +import com.google.cloud.workstations.v1beta.OperationMetadata; +import com.google.cloud.workstations.v1beta.WorkstationClusterName; +import com.google.cloud.workstations.v1beta.WorkstationConfig; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class AsyncCreateWorkstationConfigLRO { + + public static void main(String[] args) throws Exception { + asyncCreateWorkstationConfigLRO(); + } + + public static void asyncCreateWorkstationConfigLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + CreateWorkstationConfigRequest request = + CreateWorkstationConfigRequest.newBuilder() + .setParent( + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]") + .toString()) + .setWorkstationConfigId("workstationConfigId798542368") + .setWorkstationConfig(WorkstationConfig.newBuilder().build()) + .setValidateOnly(true) + .build(); + OperationFuture future = + workstationsClient.createWorkstationConfigOperationCallable().futureCall(request); + // Do something. + WorkstationConfig response = future.get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_CreateWorkstationConfig_LRO_async] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstationconfig/SyncCreateWorkstationConfig.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstationconfig/SyncCreateWorkstationConfig.java new file mode 100644 index 000000000000..d35002a714fb --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstationconfig/SyncCreateWorkstationConfig.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_CreateWorkstationConfig_sync] +import com.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest; +import com.google.cloud.workstations.v1beta.WorkstationClusterName; +import com.google.cloud.workstations.v1beta.WorkstationConfig; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncCreateWorkstationConfig { + + public static void main(String[] args) throws Exception { + syncCreateWorkstationConfig(); + } + + public static void syncCreateWorkstationConfig() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + CreateWorkstationConfigRequest request = + CreateWorkstationConfigRequest.newBuilder() + .setParent( + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]") + .toString()) + .setWorkstationConfigId("workstationConfigId798542368") + .setWorkstationConfig(WorkstationConfig.newBuilder().build()) + .setValidateOnly(true) + .build(); + WorkstationConfig response = workstationsClient.createWorkstationConfigAsync(request).get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_CreateWorkstationConfig_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstationconfig/SyncCreateWorkstationConfigStringWorkstationconfigString.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstationconfig/SyncCreateWorkstationConfigStringWorkstationconfigString.java new file mode 100644 index 000000000000..6b2e52397699 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstationconfig/SyncCreateWorkstationConfigStringWorkstationconfigString.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_CreateWorkstationConfig_StringWorkstationconfigString_sync] +import com.google.cloud.workstations.v1beta.WorkstationClusterName; +import com.google.cloud.workstations.v1beta.WorkstationConfig; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncCreateWorkstationConfigStringWorkstationconfigString { + + public static void main(String[] args) throws Exception { + syncCreateWorkstationConfigStringWorkstationconfigString(); + } + + public static void syncCreateWorkstationConfigStringWorkstationconfigString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + String parent = + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]").toString(); + WorkstationConfig workstationConfig = WorkstationConfig.newBuilder().build(); + String workstationConfigId = "workstationConfigId798542368"; + WorkstationConfig response = + workstationsClient + .createWorkstationConfigAsync(parent, workstationConfig, workstationConfigId) + .get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_CreateWorkstationConfig_StringWorkstationconfigString_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstationconfig/SyncCreateWorkstationConfigWorkstationclusternameWorkstationconfigString.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstationconfig/SyncCreateWorkstationConfigWorkstationclusternameWorkstationconfigString.java new file mode 100644 index 000000000000..4ae06d23d8f0 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/createworkstationconfig/SyncCreateWorkstationConfigWorkstationclusternameWorkstationconfigString.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_CreateWorkstationConfig_WorkstationclusternameWorkstationconfigString_sync] +import com.google.cloud.workstations.v1beta.WorkstationClusterName; +import com.google.cloud.workstations.v1beta.WorkstationConfig; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncCreateWorkstationConfigWorkstationclusternameWorkstationconfigString { + + public static void main(String[] args) throws Exception { + syncCreateWorkstationConfigWorkstationclusternameWorkstationconfigString(); + } + + public static void syncCreateWorkstationConfigWorkstationclusternameWorkstationconfigString() + throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + WorkstationClusterName parent = + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]"); + WorkstationConfig workstationConfig = WorkstationConfig.newBuilder().build(); + String workstationConfigId = "workstationConfigId798542368"; + WorkstationConfig response = + workstationsClient + .createWorkstationConfigAsync(parent, workstationConfig, workstationConfigId) + .get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_CreateWorkstationConfig_WorkstationclusternameWorkstationconfigString_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstation/AsyncDeleteWorkstation.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstation/AsyncDeleteWorkstation.java new file mode 100644 index 000000000000..ab2a41badb3a --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstation/AsyncDeleteWorkstation.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_DeleteWorkstation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.workstations.v1beta.DeleteWorkstationRequest; +import com.google.cloud.workstations.v1beta.WorkstationName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; +import com.google.longrunning.Operation; + +public class AsyncDeleteWorkstation { + + public static void main(String[] args) throws Exception { + asyncDeleteWorkstation(); + } + + public static void asyncDeleteWorkstation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + DeleteWorkstationRequest request = + DeleteWorkstationRequest.newBuilder() + .setName( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setValidateOnly(true) + .setEtag("etag3123477") + .build(); + ApiFuture future = + workstationsClient.deleteWorkstationCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_DeleteWorkstation_async] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstation/AsyncDeleteWorkstationLRO.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstation/AsyncDeleteWorkstationLRO.java new file mode 100644 index 000000000000..b22debf711a1 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstation/AsyncDeleteWorkstationLRO.java @@ -0,0 +1,60 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_DeleteWorkstation_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.workstations.v1beta.DeleteWorkstationRequest; +import com.google.cloud.workstations.v1beta.OperationMetadata; +import com.google.cloud.workstations.v1beta.Workstation; +import com.google.cloud.workstations.v1beta.WorkstationName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class AsyncDeleteWorkstationLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteWorkstationLRO(); + } + + public static void asyncDeleteWorkstationLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + DeleteWorkstationRequest request = + DeleteWorkstationRequest.newBuilder() + .setName( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setValidateOnly(true) + .setEtag("etag3123477") + .build(); + OperationFuture future = + workstationsClient.deleteWorkstationOperationCallable().futureCall(request); + // Do something. + Workstation response = future.get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_DeleteWorkstation_LRO_async] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstation/SyncDeleteWorkstation.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstation/SyncDeleteWorkstation.java new file mode 100644 index 000000000000..fdf874944f07 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstation/SyncDeleteWorkstation.java @@ -0,0 +1,55 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_DeleteWorkstation_sync] +import com.google.cloud.workstations.v1beta.DeleteWorkstationRequest; +import com.google.cloud.workstations.v1beta.Workstation; +import com.google.cloud.workstations.v1beta.WorkstationName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncDeleteWorkstation { + + public static void main(String[] args) throws Exception { + syncDeleteWorkstation(); + } + + public static void syncDeleteWorkstation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + DeleteWorkstationRequest request = + DeleteWorkstationRequest.newBuilder() + .setName( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setValidateOnly(true) + .setEtag("etag3123477") + .build(); + Workstation response = workstationsClient.deleteWorkstationAsync(request).get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_DeleteWorkstation_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstation/SyncDeleteWorkstationString.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstation/SyncDeleteWorkstationString.java new file mode 100644 index 000000000000..6812a2384f9a --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstation/SyncDeleteWorkstationString.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_DeleteWorkstation_String_sync] +import com.google.cloud.workstations.v1beta.Workstation; +import com.google.cloud.workstations.v1beta.WorkstationName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncDeleteWorkstationString { + + public static void main(String[] args) throws Exception { + syncDeleteWorkstationString(); + } + + public static void syncDeleteWorkstationString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + String name = + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString(); + Workstation response = workstationsClient.deleteWorkstationAsync(name).get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_DeleteWorkstation_String_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstation/SyncDeleteWorkstationWorkstationname.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstation/SyncDeleteWorkstationWorkstationname.java new file mode 100644 index 000000000000..10052c23ccdd --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstation/SyncDeleteWorkstationWorkstationname.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_DeleteWorkstation_Workstationname_sync] +import com.google.cloud.workstations.v1beta.Workstation; +import com.google.cloud.workstations.v1beta.WorkstationName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncDeleteWorkstationWorkstationname { + + public static void main(String[] args) throws Exception { + syncDeleteWorkstationWorkstationname(); + } + + public static void syncDeleteWorkstationWorkstationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + WorkstationName name = + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]"); + Workstation response = workstationsClient.deleteWorkstationAsync(name).get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_DeleteWorkstation_Workstationname_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstationcluster/AsyncDeleteWorkstationCluster.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstationcluster/AsyncDeleteWorkstationCluster.java new file mode 100644 index 000000000000..35bf4bc7b36b --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstationcluster/AsyncDeleteWorkstationCluster.java @@ -0,0 +1,55 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_DeleteWorkstationCluster_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest; +import com.google.cloud.workstations.v1beta.WorkstationClusterName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; +import com.google.longrunning.Operation; + +public class AsyncDeleteWorkstationCluster { + + public static void main(String[] args) throws Exception { + asyncDeleteWorkstationCluster(); + } + + public static void asyncDeleteWorkstationCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + DeleteWorkstationClusterRequest request = + DeleteWorkstationClusterRequest.newBuilder() + .setName( + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]") + .toString()) + .setValidateOnly(true) + .setEtag("etag3123477") + .setForce(true) + .build(); + ApiFuture future = + workstationsClient.deleteWorkstationClusterCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_DeleteWorkstationCluster_async] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstationcluster/AsyncDeleteWorkstationClusterLRO.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstationcluster/AsyncDeleteWorkstationClusterLRO.java new file mode 100644 index 000000000000..ef59dfb76025 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstationcluster/AsyncDeleteWorkstationClusterLRO.java @@ -0,0 +1,56 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_DeleteWorkstationCluster_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest; +import com.google.cloud.workstations.v1beta.OperationMetadata; +import com.google.cloud.workstations.v1beta.WorkstationCluster; +import com.google.cloud.workstations.v1beta.WorkstationClusterName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class AsyncDeleteWorkstationClusterLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteWorkstationClusterLRO(); + } + + public static void asyncDeleteWorkstationClusterLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + DeleteWorkstationClusterRequest request = + DeleteWorkstationClusterRequest.newBuilder() + .setName( + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]") + .toString()) + .setValidateOnly(true) + .setEtag("etag3123477") + .setForce(true) + .build(); + OperationFuture future = + workstationsClient.deleteWorkstationClusterOperationCallable().futureCall(request); + // Do something. + WorkstationCluster response = future.get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_DeleteWorkstationCluster_LRO_async] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstationcluster/SyncDeleteWorkstationCluster.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstationcluster/SyncDeleteWorkstationCluster.java new file mode 100644 index 000000000000..008c9a1f404e --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstationcluster/SyncDeleteWorkstationCluster.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_DeleteWorkstationCluster_sync] +import com.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest; +import com.google.cloud.workstations.v1beta.WorkstationCluster; +import com.google.cloud.workstations.v1beta.WorkstationClusterName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncDeleteWorkstationCluster { + + public static void main(String[] args) throws Exception { + syncDeleteWorkstationCluster(); + } + + public static void syncDeleteWorkstationCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + DeleteWorkstationClusterRequest request = + DeleteWorkstationClusterRequest.newBuilder() + .setName( + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]") + .toString()) + .setValidateOnly(true) + .setEtag("etag3123477") + .setForce(true) + .build(); + WorkstationCluster response = workstationsClient.deleteWorkstationClusterAsync(request).get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_DeleteWorkstationCluster_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstationcluster/SyncDeleteWorkstationClusterString.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstationcluster/SyncDeleteWorkstationClusterString.java new file mode 100644 index 000000000000..46a2e4a867d8 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstationcluster/SyncDeleteWorkstationClusterString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_DeleteWorkstationCluster_String_sync] +import com.google.cloud.workstations.v1beta.WorkstationCluster; +import com.google.cloud.workstations.v1beta.WorkstationClusterName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncDeleteWorkstationClusterString { + + public static void main(String[] args) throws Exception { + syncDeleteWorkstationClusterString(); + } + + public static void syncDeleteWorkstationClusterString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + String name = + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]").toString(); + WorkstationCluster response = workstationsClient.deleteWorkstationClusterAsync(name).get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_DeleteWorkstationCluster_String_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstationcluster/SyncDeleteWorkstationClusterWorkstationclustername.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstationcluster/SyncDeleteWorkstationClusterWorkstationclustername.java new file mode 100644 index 000000000000..a8f67f447bb6 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstationcluster/SyncDeleteWorkstationClusterWorkstationclustername.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_DeleteWorkstationCluster_Workstationclustername_sync] +import com.google.cloud.workstations.v1beta.WorkstationCluster; +import com.google.cloud.workstations.v1beta.WorkstationClusterName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncDeleteWorkstationClusterWorkstationclustername { + + public static void main(String[] args) throws Exception { + syncDeleteWorkstationClusterWorkstationclustername(); + } + + public static void syncDeleteWorkstationClusterWorkstationclustername() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + WorkstationClusterName name = + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]"); + WorkstationCluster response = workstationsClient.deleteWorkstationClusterAsync(name).get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_DeleteWorkstationCluster_Workstationclustername_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstationconfig/AsyncDeleteWorkstationConfig.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstationconfig/AsyncDeleteWorkstationConfig.java new file mode 100644 index 000000000000..caa01565626f --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstationconfig/AsyncDeleteWorkstationConfig.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_DeleteWorkstationConfig_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest; +import com.google.cloud.workstations.v1beta.WorkstationConfigName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; +import com.google.longrunning.Operation; + +public class AsyncDeleteWorkstationConfig { + + public static void main(String[] args) throws Exception { + asyncDeleteWorkstationConfig(); + } + + public static void asyncDeleteWorkstationConfig() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + DeleteWorkstationConfigRequest request = + DeleteWorkstationConfigRequest.newBuilder() + .setName( + WorkstationConfigName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]") + .toString()) + .setValidateOnly(true) + .setEtag("etag3123477") + .setForce(true) + .build(); + ApiFuture future = + workstationsClient.deleteWorkstationConfigCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_DeleteWorkstationConfig_async] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstationconfig/AsyncDeleteWorkstationConfigLRO.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstationconfig/AsyncDeleteWorkstationConfigLRO.java new file mode 100644 index 000000000000..917878e5356c --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstationconfig/AsyncDeleteWorkstationConfigLRO.java @@ -0,0 +1,60 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_DeleteWorkstationConfig_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest; +import com.google.cloud.workstations.v1beta.OperationMetadata; +import com.google.cloud.workstations.v1beta.WorkstationConfig; +import com.google.cloud.workstations.v1beta.WorkstationConfigName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class AsyncDeleteWorkstationConfigLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteWorkstationConfigLRO(); + } + + public static void asyncDeleteWorkstationConfigLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + DeleteWorkstationConfigRequest request = + DeleteWorkstationConfigRequest.newBuilder() + .setName( + WorkstationConfigName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]") + .toString()) + .setValidateOnly(true) + .setEtag("etag3123477") + .setForce(true) + .build(); + OperationFuture future = + workstationsClient.deleteWorkstationConfigOperationCallable().futureCall(request); + // Do something. + WorkstationConfig response = future.get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_DeleteWorkstationConfig_LRO_async] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstationconfig/SyncDeleteWorkstationConfig.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstationconfig/SyncDeleteWorkstationConfig.java new file mode 100644 index 000000000000..72f60ce729fd --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstationconfig/SyncDeleteWorkstationConfig.java @@ -0,0 +1,55 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_DeleteWorkstationConfig_sync] +import com.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest; +import com.google.cloud.workstations.v1beta.WorkstationConfig; +import com.google.cloud.workstations.v1beta.WorkstationConfigName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncDeleteWorkstationConfig { + + public static void main(String[] args) throws Exception { + syncDeleteWorkstationConfig(); + } + + public static void syncDeleteWorkstationConfig() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + DeleteWorkstationConfigRequest request = + DeleteWorkstationConfigRequest.newBuilder() + .setName( + WorkstationConfigName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]") + .toString()) + .setValidateOnly(true) + .setEtag("etag3123477") + .setForce(true) + .build(); + WorkstationConfig response = workstationsClient.deleteWorkstationConfigAsync(request).get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_DeleteWorkstationConfig_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstationconfig/SyncDeleteWorkstationConfigString.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstationconfig/SyncDeleteWorkstationConfigString.java new file mode 100644 index 000000000000..c0d393444d45 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstationconfig/SyncDeleteWorkstationConfigString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_DeleteWorkstationConfig_String_sync] +import com.google.cloud.workstations.v1beta.WorkstationConfig; +import com.google.cloud.workstations.v1beta.WorkstationConfigName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncDeleteWorkstationConfigString { + + public static void main(String[] args) throws Exception { + syncDeleteWorkstationConfigString(); + } + + public static void syncDeleteWorkstationConfigString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + String name = + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]") + .toString(); + WorkstationConfig response = workstationsClient.deleteWorkstationConfigAsync(name).get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_DeleteWorkstationConfig_String_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstationconfig/SyncDeleteWorkstationConfigWorkstationconfigname.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstationconfig/SyncDeleteWorkstationConfigWorkstationconfigname.java new file mode 100644 index 000000000000..97c9121a34c5 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/deleteworkstationconfig/SyncDeleteWorkstationConfigWorkstationconfigname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_DeleteWorkstationConfig_Workstationconfigname_sync] +import com.google.cloud.workstations.v1beta.WorkstationConfig; +import com.google.cloud.workstations.v1beta.WorkstationConfigName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncDeleteWorkstationConfigWorkstationconfigname { + + public static void main(String[] args) throws Exception { + syncDeleteWorkstationConfigWorkstationconfigname(); + } + + public static void syncDeleteWorkstationConfigWorkstationconfigname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + WorkstationConfigName name = + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]"); + WorkstationConfig response = workstationsClient.deleteWorkstationConfigAsync(name).get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_DeleteWorkstationConfig_Workstationconfigname_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/generateaccesstoken/AsyncGenerateAccessToken.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/generateaccesstoken/AsyncGenerateAccessToken.java new file mode 100644 index 000000000000..908a39642390 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/generateaccesstoken/AsyncGenerateAccessToken.java @@ -0,0 +1,57 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_GenerateAccessToken_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest; +import com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse; +import com.google.cloud.workstations.v1beta.WorkstationName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class AsyncGenerateAccessToken { + + public static void main(String[] args) throws Exception { + asyncGenerateAccessToken(); + } + + public static void asyncGenerateAccessToken() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + GenerateAccessTokenRequest request = + GenerateAccessTokenRequest.newBuilder() + .setWorkstation( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .build(); + ApiFuture future = + workstationsClient.generateAccessTokenCallable().futureCall(request); + // Do something. + GenerateAccessTokenResponse response = future.get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_GenerateAccessToken_async] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/generateaccesstoken/SyncGenerateAccessToken.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/generateaccesstoken/SyncGenerateAccessToken.java new file mode 100644 index 000000000000..928fdd07e179 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/generateaccesstoken/SyncGenerateAccessToken.java @@ -0,0 +1,53 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_GenerateAccessToken_sync] +import com.google.cloud.workstations.v1beta.GenerateAccessTokenRequest; +import com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse; +import com.google.cloud.workstations.v1beta.WorkstationName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncGenerateAccessToken { + + public static void main(String[] args) throws Exception { + syncGenerateAccessToken(); + } + + public static void syncGenerateAccessToken() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + GenerateAccessTokenRequest request = + GenerateAccessTokenRequest.newBuilder() + .setWorkstation( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .build(); + GenerateAccessTokenResponse response = workstationsClient.generateAccessToken(request); + } + } +} +// [END workstations_v1beta_generated_Workstations_GenerateAccessToken_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/generateaccesstoken/SyncGenerateAccessTokenString.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/generateaccesstoken/SyncGenerateAccessTokenString.java new file mode 100644 index 000000000000..8fb34594e6cb --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/generateaccesstoken/SyncGenerateAccessTokenString.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_GenerateAccessToken_String_sync] +import com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse; +import com.google.cloud.workstations.v1beta.WorkstationName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncGenerateAccessTokenString { + + public static void main(String[] args) throws Exception { + syncGenerateAccessTokenString(); + } + + public static void syncGenerateAccessTokenString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + String workstation = + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString(); + GenerateAccessTokenResponse response = workstationsClient.generateAccessToken(workstation); + } + } +} +// [END workstations_v1beta_generated_Workstations_GenerateAccessToken_String_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/generateaccesstoken/SyncGenerateAccessTokenWorkstationname.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/generateaccesstoken/SyncGenerateAccessTokenWorkstationname.java new file mode 100644 index 000000000000..01f71ee3e23b --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/generateaccesstoken/SyncGenerateAccessTokenWorkstationname.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_GenerateAccessToken_Workstationname_sync] +import com.google.cloud.workstations.v1beta.GenerateAccessTokenResponse; +import com.google.cloud.workstations.v1beta.WorkstationName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncGenerateAccessTokenWorkstationname { + + public static void main(String[] args) throws Exception { + syncGenerateAccessTokenWorkstationname(); + } + + public static void syncGenerateAccessTokenWorkstationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + WorkstationName workstation = + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]"); + GenerateAccessTokenResponse response = workstationsClient.generateAccessToken(workstation); + } + } +} +// [END workstations_v1beta_generated_Workstations_GenerateAccessToken_Workstationname_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/getiampolicy/AsyncGetIamPolicy.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/getiampolicy/AsyncGetIamPolicy.java new file mode 100644 index 000000000000..9a2b1455717c --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/getiampolicy/AsyncGetIamPolicy.java @@ -0,0 +1,58 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_GetIamPolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.workstations.v1beta.WorkstationName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; + +public class AsyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncGetIamPolicy(); + } + + public static void asyncGetIamPolicy() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + ApiFuture future = workstationsClient.getIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_GetIamPolicy_async] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/getiampolicy/SyncGetIamPolicy.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/getiampolicy/SyncGetIamPolicy.java new file mode 100644 index 000000000000..e1c0cea63aee --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/getiampolicy/SyncGetIamPolicy.java @@ -0,0 +1,55 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_GetIamPolicy_sync] +import com.google.cloud.workstations.v1beta.WorkstationName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; + +public class SyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + syncGetIamPolicy(); + } + + public static void syncGetIamPolicy() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + Policy response = workstationsClient.getIamPolicy(request); + } + } +} +// [END workstations_v1beta_generated_Workstations_GetIamPolicy_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/getworkstation/AsyncGetWorkstation.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/getworkstation/AsyncGetWorkstation.java new file mode 100644 index 000000000000..5c67e694ed2f --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/getworkstation/AsyncGetWorkstation.java @@ -0,0 +1,57 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_GetWorkstation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.workstations.v1beta.GetWorkstationRequest; +import com.google.cloud.workstations.v1beta.Workstation; +import com.google.cloud.workstations.v1beta.WorkstationName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class AsyncGetWorkstation { + + public static void main(String[] args) throws Exception { + asyncGetWorkstation(); + } + + public static void asyncGetWorkstation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + GetWorkstationRequest request = + GetWorkstationRequest.newBuilder() + .setName( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .build(); + ApiFuture future = + workstationsClient.getWorkstationCallable().futureCall(request); + // Do something. + Workstation response = future.get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_GetWorkstation_async] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/getworkstation/SyncGetWorkstation.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/getworkstation/SyncGetWorkstation.java new file mode 100644 index 000000000000..85b0c7d7c373 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/getworkstation/SyncGetWorkstation.java @@ -0,0 +1,53 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_GetWorkstation_sync] +import com.google.cloud.workstations.v1beta.GetWorkstationRequest; +import com.google.cloud.workstations.v1beta.Workstation; +import com.google.cloud.workstations.v1beta.WorkstationName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncGetWorkstation { + + public static void main(String[] args) throws Exception { + syncGetWorkstation(); + } + + public static void syncGetWorkstation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + GetWorkstationRequest request = + GetWorkstationRequest.newBuilder() + .setName( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .build(); + Workstation response = workstationsClient.getWorkstation(request); + } + } +} +// [END workstations_v1beta_generated_Workstations_GetWorkstation_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/getworkstation/SyncGetWorkstationString.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/getworkstation/SyncGetWorkstationString.java new file mode 100644 index 000000000000..55a43bd3cb4e --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/getworkstation/SyncGetWorkstationString.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_GetWorkstation_String_sync] +import com.google.cloud.workstations.v1beta.Workstation; +import com.google.cloud.workstations.v1beta.WorkstationName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncGetWorkstationString { + + public static void main(String[] args) throws Exception { + syncGetWorkstationString(); + } + + public static void syncGetWorkstationString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + String name = + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString(); + Workstation response = workstationsClient.getWorkstation(name); + } + } +} +// [END workstations_v1beta_generated_Workstations_GetWorkstation_String_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/getworkstation/SyncGetWorkstationWorkstationname.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/getworkstation/SyncGetWorkstationWorkstationname.java new file mode 100644 index 000000000000..ff7e31af93c5 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/getworkstation/SyncGetWorkstationWorkstationname.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_GetWorkstation_Workstationname_sync] +import com.google.cloud.workstations.v1beta.Workstation; +import com.google.cloud.workstations.v1beta.WorkstationName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncGetWorkstationWorkstationname { + + public static void main(String[] args) throws Exception { + syncGetWorkstationWorkstationname(); + } + + public static void syncGetWorkstationWorkstationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + WorkstationName name = + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]"); + Workstation response = workstationsClient.getWorkstation(name); + } + } +} +// [END workstations_v1beta_generated_Workstations_GetWorkstation_Workstationname_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/getworkstationcluster/AsyncGetWorkstationCluster.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/getworkstationcluster/AsyncGetWorkstationCluster.java new file mode 100644 index 000000000000..8c0d51e99b42 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/getworkstationcluster/AsyncGetWorkstationCluster.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_GetWorkstationCluster_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest; +import com.google.cloud.workstations.v1beta.WorkstationCluster; +import com.google.cloud.workstations.v1beta.WorkstationClusterName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class AsyncGetWorkstationCluster { + + public static void main(String[] args) throws Exception { + asyncGetWorkstationCluster(); + } + + public static void asyncGetWorkstationCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + GetWorkstationClusterRequest request = + GetWorkstationClusterRequest.newBuilder() + .setName( + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]") + .toString()) + .build(); + ApiFuture future = + workstationsClient.getWorkstationClusterCallable().futureCall(request); + // Do something. + WorkstationCluster response = future.get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_GetWorkstationCluster_async] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/getworkstationcluster/SyncGetWorkstationCluster.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/getworkstationcluster/SyncGetWorkstationCluster.java new file mode 100644 index 000000000000..421b797ed50e --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/getworkstationcluster/SyncGetWorkstationCluster.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_GetWorkstationCluster_sync] +import com.google.cloud.workstations.v1beta.GetWorkstationClusterRequest; +import com.google.cloud.workstations.v1beta.WorkstationCluster; +import com.google.cloud.workstations.v1beta.WorkstationClusterName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncGetWorkstationCluster { + + public static void main(String[] args) throws Exception { + syncGetWorkstationCluster(); + } + + public static void syncGetWorkstationCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + GetWorkstationClusterRequest request = + GetWorkstationClusterRequest.newBuilder() + .setName( + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]") + .toString()) + .build(); + WorkstationCluster response = workstationsClient.getWorkstationCluster(request); + } + } +} +// [END workstations_v1beta_generated_Workstations_GetWorkstationCluster_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/getworkstationcluster/SyncGetWorkstationClusterString.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/getworkstationcluster/SyncGetWorkstationClusterString.java new file mode 100644 index 000000000000..e5fa7822d67c --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/getworkstationcluster/SyncGetWorkstationClusterString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_GetWorkstationCluster_String_sync] +import com.google.cloud.workstations.v1beta.WorkstationCluster; +import com.google.cloud.workstations.v1beta.WorkstationClusterName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncGetWorkstationClusterString { + + public static void main(String[] args) throws Exception { + syncGetWorkstationClusterString(); + } + + public static void syncGetWorkstationClusterString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + String name = + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]").toString(); + WorkstationCluster response = workstationsClient.getWorkstationCluster(name); + } + } +} +// [END workstations_v1beta_generated_Workstations_GetWorkstationCluster_String_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/getworkstationcluster/SyncGetWorkstationClusterWorkstationclustername.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/getworkstationcluster/SyncGetWorkstationClusterWorkstationclustername.java new file mode 100644 index 000000000000..efebed37f0ba --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/getworkstationcluster/SyncGetWorkstationClusterWorkstationclustername.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_GetWorkstationCluster_Workstationclustername_sync] +import com.google.cloud.workstations.v1beta.WorkstationCluster; +import com.google.cloud.workstations.v1beta.WorkstationClusterName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncGetWorkstationClusterWorkstationclustername { + + public static void main(String[] args) throws Exception { + syncGetWorkstationClusterWorkstationclustername(); + } + + public static void syncGetWorkstationClusterWorkstationclustername() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + WorkstationClusterName name = + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]"); + WorkstationCluster response = workstationsClient.getWorkstationCluster(name); + } + } +} +// [END workstations_v1beta_generated_Workstations_GetWorkstationCluster_Workstationclustername_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/getworkstationconfig/AsyncGetWorkstationConfig.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/getworkstationconfig/AsyncGetWorkstationConfig.java new file mode 100644 index 000000000000..83f07f5dacb1 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/getworkstationconfig/AsyncGetWorkstationConfig.java @@ -0,0 +1,56 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_GetWorkstationConfig_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest; +import com.google.cloud.workstations.v1beta.WorkstationConfig; +import com.google.cloud.workstations.v1beta.WorkstationConfigName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class AsyncGetWorkstationConfig { + + public static void main(String[] args) throws Exception { + asyncGetWorkstationConfig(); + } + + public static void asyncGetWorkstationConfig() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + GetWorkstationConfigRequest request = + GetWorkstationConfigRequest.newBuilder() + .setName( + WorkstationConfigName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]") + .toString()) + .build(); + ApiFuture future = + workstationsClient.getWorkstationConfigCallable().futureCall(request); + // Do something. + WorkstationConfig response = future.get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_GetWorkstationConfig_async] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/getworkstationconfig/SyncGetWorkstationConfig.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/getworkstationconfig/SyncGetWorkstationConfig.java new file mode 100644 index 000000000000..6e5a422cd6ce --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/getworkstationconfig/SyncGetWorkstationConfig.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_GetWorkstationConfig_sync] +import com.google.cloud.workstations.v1beta.GetWorkstationConfigRequest; +import com.google.cloud.workstations.v1beta.WorkstationConfig; +import com.google.cloud.workstations.v1beta.WorkstationConfigName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncGetWorkstationConfig { + + public static void main(String[] args) throws Exception { + syncGetWorkstationConfig(); + } + + public static void syncGetWorkstationConfig() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + GetWorkstationConfigRequest request = + GetWorkstationConfigRequest.newBuilder() + .setName( + WorkstationConfigName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]") + .toString()) + .build(); + WorkstationConfig response = workstationsClient.getWorkstationConfig(request); + } + } +} +// [END workstations_v1beta_generated_Workstations_GetWorkstationConfig_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/getworkstationconfig/SyncGetWorkstationConfigString.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/getworkstationconfig/SyncGetWorkstationConfigString.java new file mode 100644 index 000000000000..c3e2a87e73c0 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/getworkstationconfig/SyncGetWorkstationConfigString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_GetWorkstationConfig_String_sync] +import com.google.cloud.workstations.v1beta.WorkstationConfig; +import com.google.cloud.workstations.v1beta.WorkstationConfigName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncGetWorkstationConfigString { + + public static void main(String[] args) throws Exception { + syncGetWorkstationConfigString(); + } + + public static void syncGetWorkstationConfigString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + String name = + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]") + .toString(); + WorkstationConfig response = workstationsClient.getWorkstationConfig(name); + } + } +} +// [END workstations_v1beta_generated_Workstations_GetWorkstationConfig_String_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/getworkstationconfig/SyncGetWorkstationConfigWorkstationconfigname.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/getworkstationconfig/SyncGetWorkstationConfigWorkstationconfigname.java new file mode 100644 index 000000000000..d58cf13deba4 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/getworkstationconfig/SyncGetWorkstationConfigWorkstationconfigname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_GetWorkstationConfig_Workstationconfigname_sync] +import com.google.cloud.workstations.v1beta.WorkstationConfig; +import com.google.cloud.workstations.v1beta.WorkstationConfigName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncGetWorkstationConfigWorkstationconfigname { + + public static void main(String[] args) throws Exception { + syncGetWorkstationConfigWorkstationconfigname(); + } + + public static void syncGetWorkstationConfigWorkstationconfigname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + WorkstationConfigName name = + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]"); + WorkstationConfig response = workstationsClient.getWorkstationConfig(name); + } + } +} +// [END workstations_v1beta_generated_Workstations_GetWorkstationConfig_Workstationconfigname_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listusableworkstationconfigs/AsyncListUsableWorkstationConfigs.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listusableworkstationconfigs/AsyncListUsableWorkstationConfigs.java new file mode 100644 index 000000000000..b83c543ffc54 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listusableworkstationconfigs/AsyncListUsableWorkstationConfigs.java @@ -0,0 +1,56 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_ListUsableWorkstationConfigs_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest; +import com.google.cloud.workstations.v1beta.WorkstationClusterName; +import com.google.cloud.workstations.v1beta.WorkstationConfig; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class AsyncListUsableWorkstationConfigs { + + public static void main(String[] args) throws Exception { + asyncListUsableWorkstationConfigs(); + } + + public static void asyncListUsableWorkstationConfigs() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + ListUsableWorkstationConfigsRequest request = + ListUsableWorkstationConfigsRequest.newBuilder() + .setParent( + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + workstationsClient.listUsableWorkstationConfigsPagedCallable().futureCall(request); + // Do something. + for (WorkstationConfig element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END workstations_v1beta_generated_Workstations_ListUsableWorkstationConfigs_async] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listusableworkstationconfigs/AsyncListUsableWorkstationConfigsPaged.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listusableworkstationconfigs/AsyncListUsableWorkstationConfigsPaged.java new file mode 100644 index 000000000000..fa0f3b5e1fd1 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listusableworkstationconfigs/AsyncListUsableWorkstationConfigsPaged.java @@ -0,0 +1,64 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_ListUsableWorkstationConfigs_Paged_async] +import com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest; +import com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse; +import com.google.cloud.workstations.v1beta.WorkstationClusterName; +import com.google.cloud.workstations.v1beta.WorkstationConfig; +import com.google.cloud.workstations.v1beta.WorkstationsClient; +import com.google.common.base.Strings; + +public class AsyncListUsableWorkstationConfigsPaged { + + public static void main(String[] args) throws Exception { + asyncListUsableWorkstationConfigsPaged(); + } + + public static void asyncListUsableWorkstationConfigsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + ListUsableWorkstationConfigsRequest request = + ListUsableWorkstationConfigsRequest.newBuilder() + .setParent( + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListUsableWorkstationConfigsResponse response = + workstationsClient.listUsableWorkstationConfigsCallable().call(request); + for (WorkstationConfig element : response.getWorkstationConfigsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END workstations_v1beta_generated_Workstations_ListUsableWorkstationConfigs_Paged_async] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listusableworkstationconfigs/SyncListUsableWorkstationConfigs.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listusableworkstationconfigs/SyncListUsableWorkstationConfigs.java new file mode 100644 index 000000000000..e6aba38479bb --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listusableworkstationconfigs/SyncListUsableWorkstationConfigs.java @@ -0,0 +1,53 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_ListUsableWorkstationConfigs_sync] +import com.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest; +import com.google.cloud.workstations.v1beta.WorkstationClusterName; +import com.google.cloud.workstations.v1beta.WorkstationConfig; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncListUsableWorkstationConfigs { + + public static void main(String[] args) throws Exception { + syncListUsableWorkstationConfigs(); + } + + public static void syncListUsableWorkstationConfigs() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + ListUsableWorkstationConfigsRequest request = + ListUsableWorkstationConfigsRequest.newBuilder() + .setParent( + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (WorkstationConfig element : + workstationsClient.listUsableWorkstationConfigs(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END workstations_v1beta_generated_Workstations_ListUsableWorkstationConfigs_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listusableworkstationconfigs/SyncListUsableWorkstationConfigsString.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listusableworkstationconfigs/SyncListUsableWorkstationConfigsString.java new file mode 100644 index 000000000000..8795e1f61e75 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listusableworkstationconfigs/SyncListUsableWorkstationConfigsString.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_ListUsableWorkstationConfigs_String_sync] +import com.google.cloud.workstations.v1beta.WorkstationClusterName; +import com.google.cloud.workstations.v1beta.WorkstationConfig; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncListUsableWorkstationConfigsString { + + public static void main(String[] args) throws Exception { + syncListUsableWorkstationConfigsString(); + } + + public static void syncListUsableWorkstationConfigsString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + String parent = + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]").toString(); + for (WorkstationConfig element : + workstationsClient.listUsableWorkstationConfigs(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END workstations_v1beta_generated_Workstations_ListUsableWorkstationConfigs_String_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listusableworkstationconfigs/SyncListUsableWorkstationConfigsWorkstationclustername.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listusableworkstationconfigs/SyncListUsableWorkstationConfigsWorkstationclustername.java new file mode 100644 index 000000000000..fb021f13813f --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listusableworkstationconfigs/SyncListUsableWorkstationConfigsWorkstationclustername.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_ListUsableWorkstationConfigs_Workstationclustername_sync] +import com.google.cloud.workstations.v1beta.WorkstationClusterName; +import com.google.cloud.workstations.v1beta.WorkstationConfig; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncListUsableWorkstationConfigsWorkstationclustername { + + public static void main(String[] args) throws Exception { + syncListUsableWorkstationConfigsWorkstationclustername(); + } + + public static void syncListUsableWorkstationConfigsWorkstationclustername() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + WorkstationClusterName parent = + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]"); + for (WorkstationConfig element : + workstationsClient.listUsableWorkstationConfigs(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END workstations_v1beta_generated_Workstations_ListUsableWorkstationConfigs_Workstationclustername_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listusableworkstations/AsyncListUsableWorkstations.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listusableworkstations/AsyncListUsableWorkstations.java new file mode 100644 index 000000000000..1e1399646460 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listusableworkstations/AsyncListUsableWorkstations.java @@ -0,0 +1,60 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_ListUsableWorkstations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest; +import com.google.cloud.workstations.v1beta.Workstation; +import com.google.cloud.workstations.v1beta.WorkstationConfigName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class AsyncListUsableWorkstations { + + public static void main(String[] args) throws Exception { + asyncListUsableWorkstations(); + } + + public static void asyncListUsableWorkstations() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + ListUsableWorkstationsRequest request = + ListUsableWorkstationsRequest.newBuilder() + .setParent( + WorkstationConfigName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + workstationsClient.listUsableWorkstationsPagedCallable().futureCall(request); + // Do something. + for (Workstation element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END workstations_v1beta_generated_Workstations_ListUsableWorkstations_async] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listusableworkstations/AsyncListUsableWorkstationsPaged.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listusableworkstations/AsyncListUsableWorkstationsPaged.java new file mode 100644 index 000000000000..5e289bf6c221 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listusableworkstations/AsyncListUsableWorkstationsPaged.java @@ -0,0 +1,68 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_ListUsableWorkstations_Paged_async] +import com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest; +import com.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse; +import com.google.cloud.workstations.v1beta.Workstation; +import com.google.cloud.workstations.v1beta.WorkstationConfigName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; +import com.google.common.base.Strings; + +public class AsyncListUsableWorkstationsPaged { + + public static void main(String[] args) throws Exception { + asyncListUsableWorkstationsPaged(); + } + + public static void asyncListUsableWorkstationsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + ListUsableWorkstationsRequest request = + ListUsableWorkstationsRequest.newBuilder() + .setParent( + WorkstationConfigName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListUsableWorkstationsResponse response = + workstationsClient.listUsableWorkstationsCallable().call(request); + for (Workstation element : response.getWorkstationsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END workstations_v1beta_generated_Workstations_ListUsableWorkstations_Paged_async] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listusableworkstations/SyncListUsableWorkstations.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listusableworkstations/SyncListUsableWorkstations.java new file mode 100644 index 000000000000..4ea6ed34800b --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listusableworkstations/SyncListUsableWorkstations.java @@ -0,0 +1,56 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_ListUsableWorkstations_sync] +import com.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest; +import com.google.cloud.workstations.v1beta.Workstation; +import com.google.cloud.workstations.v1beta.WorkstationConfigName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncListUsableWorkstations { + + public static void main(String[] args) throws Exception { + syncListUsableWorkstations(); + } + + public static void syncListUsableWorkstations() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + ListUsableWorkstationsRequest request = + ListUsableWorkstationsRequest.newBuilder() + .setParent( + WorkstationConfigName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Workstation element : workstationsClient.listUsableWorkstations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END workstations_v1beta_generated_Workstations_ListUsableWorkstations_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listusableworkstations/SyncListUsableWorkstationsString.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listusableworkstations/SyncListUsableWorkstationsString.java new file mode 100644 index 000000000000..4e2d06866e1b --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listusableworkstations/SyncListUsableWorkstationsString.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_ListUsableWorkstations_String_sync] +import com.google.cloud.workstations.v1beta.Workstation; +import com.google.cloud.workstations.v1beta.WorkstationConfigName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncListUsableWorkstationsString { + + public static void main(String[] args) throws Exception { + syncListUsableWorkstationsString(); + } + + public static void syncListUsableWorkstationsString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + String parent = + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]") + .toString(); + for (Workstation element : workstationsClient.listUsableWorkstations(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END workstations_v1beta_generated_Workstations_ListUsableWorkstations_String_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listusableworkstations/SyncListUsableWorkstationsWorkstationconfigname.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listusableworkstations/SyncListUsableWorkstationsWorkstationconfigname.java new file mode 100644 index 000000000000..2cb8e41f8c55 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listusableworkstations/SyncListUsableWorkstationsWorkstationconfigname.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_ListUsableWorkstations_Workstationconfigname_sync] +import com.google.cloud.workstations.v1beta.Workstation; +import com.google.cloud.workstations.v1beta.WorkstationConfigName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncListUsableWorkstationsWorkstationconfigname { + + public static void main(String[] args) throws Exception { + syncListUsableWorkstationsWorkstationconfigname(); + } + + public static void syncListUsableWorkstationsWorkstationconfigname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + WorkstationConfigName parent = + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]"); + for (Workstation element : workstationsClient.listUsableWorkstations(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END workstations_v1beta_generated_Workstations_ListUsableWorkstations_Workstationconfigname_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstationclusters/AsyncListWorkstationClusters.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstationclusters/AsyncListWorkstationClusters.java new file mode 100644 index 000000000000..7d5a4872dcf2 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstationclusters/AsyncListWorkstationClusters.java @@ -0,0 +1,54 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_ListWorkstationClusters_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest; +import com.google.cloud.workstations.v1beta.LocationName; +import com.google.cloud.workstations.v1beta.WorkstationCluster; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class AsyncListWorkstationClusters { + + public static void main(String[] args) throws Exception { + asyncListWorkstationClusters(); + } + + public static void asyncListWorkstationClusters() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + ListWorkstationClustersRequest request = + ListWorkstationClustersRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + workstationsClient.listWorkstationClustersPagedCallable().futureCall(request); + // Do something. + for (WorkstationCluster element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END workstations_v1beta_generated_Workstations_ListWorkstationClusters_async] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstationclusters/AsyncListWorkstationClustersPaged.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstationclusters/AsyncListWorkstationClustersPaged.java new file mode 100644 index 000000000000..6f36a5f80fc9 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstationclusters/AsyncListWorkstationClustersPaged.java @@ -0,0 +1,62 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_ListWorkstationClusters_Paged_async] +import com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest; +import com.google.cloud.workstations.v1beta.ListWorkstationClustersResponse; +import com.google.cloud.workstations.v1beta.LocationName; +import com.google.cloud.workstations.v1beta.WorkstationCluster; +import com.google.cloud.workstations.v1beta.WorkstationsClient; +import com.google.common.base.Strings; + +public class AsyncListWorkstationClustersPaged { + + public static void main(String[] args) throws Exception { + asyncListWorkstationClustersPaged(); + } + + public static void asyncListWorkstationClustersPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + ListWorkstationClustersRequest request = + ListWorkstationClustersRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListWorkstationClustersResponse response = + workstationsClient.listWorkstationClustersCallable().call(request); + for (WorkstationCluster element : response.getWorkstationClustersList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END workstations_v1beta_generated_Workstations_ListWorkstationClusters_Paged_async] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstationclusters/SyncListWorkstationClusters.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstationclusters/SyncListWorkstationClusters.java new file mode 100644 index 000000000000..ab115bedf417 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstationclusters/SyncListWorkstationClusters.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_ListWorkstationClusters_sync] +import com.google.cloud.workstations.v1beta.ListWorkstationClustersRequest; +import com.google.cloud.workstations.v1beta.LocationName; +import com.google.cloud.workstations.v1beta.WorkstationCluster; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncListWorkstationClusters { + + public static void main(String[] args) throws Exception { + syncListWorkstationClusters(); + } + + public static void syncListWorkstationClusters() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + ListWorkstationClustersRequest request = + ListWorkstationClustersRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (WorkstationCluster element : + workstationsClient.listWorkstationClusters(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END workstations_v1beta_generated_Workstations_ListWorkstationClusters_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstationclusters/SyncListWorkstationClustersLocationname.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstationclusters/SyncListWorkstationClustersLocationname.java new file mode 100644 index 000000000000..c37891311661 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstationclusters/SyncListWorkstationClustersLocationname.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_ListWorkstationClusters_Locationname_sync] +import com.google.cloud.workstations.v1beta.LocationName; +import com.google.cloud.workstations.v1beta.WorkstationCluster; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncListWorkstationClustersLocationname { + + public static void main(String[] args) throws Exception { + syncListWorkstationClustersLocationname(); + } + + public static void syncListWorkstationClustersLocationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (WorkstationCluster element : + workstationsClient.listWorkstationClusters(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END workstations_v1beta_generated_Workstations_ListWorkstationClusters_Locationname_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstationclusters/SyncListWorkstationClustersString.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstationclusters/SyncListWorkstationClustersString.java new file mode 100644 index 000000000000..a4ae2176988c --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstationclusters/SyncListWorkstationClustersString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_ListWorkstationClusters_String_sync] +import com.google.cloud.workstations.v1beta.LocationName; +import com.google.cloud.workstations.v1beta.WorkstationCluster; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncListWorkstationClustersString { + + public static void main(String[] args) throws Exception { + syncListWorkstationClustersString(); + } + + public static void syncListWorkstationClustersString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (WorkstationCluster element : + workstationsClient.listWorkstationClusters(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END workstations_v1beta_generated_Workstations_ListWorkstationClusters_String_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstationconfigs/AsyncListWorkstationConfigs.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstationconfigs/AsyncListWorkstationConfigs.java new file mode 100644 index 000000000000..daa21721caf8 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstationconfigs/AsyncListWorkstationConfigs.java @@ -0,0 +1,56 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_ListWorkstationConfigs_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest; +import com.google.cloud.workstations.v1beta.WorkstationClusterName; +import com.google.cloud.workstations.v1beta.WorkstationConfig; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class AsyncListWorkstationConfigs { + + public static void main(String[] args) throws Exception { + asyncListWorkstationConfigs(); + } + + public static void asyncListWorkstationConfigs() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + ListWorkstationConfigsRequest request = + ListWorkstationConfigsRequest.newBuilder() + .setParent( + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + workstationsClient.listWorkstationConfigsPagedCallable().futureCall(request); + // Do something. + for (WorkstationConfig element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END workstations_v1beta_generated_Workstations_ListWorkstationConfigs_async] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstationconfigs/AsyncListWorkstationConfigsPaged.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstationconfigs/AsyncListWorkstationConfigsPaged.java new file mode 100644 index 000000000000..c8027ba922e3 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstationconfigs/AsyncListWorkstationConfigsPaged.java @@ -0,0 +1,64 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_ListWorkstationConfigs_Paged_async] +import com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest; +import com.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse; +import com.google.cloud.workstations.v1beta.WorkstationClusterName; +import com.google.cloud.workstations.v1beta.WorkstationConfig; +import com.google.cloud.workstations.v1beta.WorkstationsClient; +import com.google.common.base.Strings; + +public class AsyncListWorkstationConfigsPaged { + + public static void main(String[] args) throws Exception { + asyncListWorkstationConfigsPaged(); + } + + public static void asyncListWorkstationConfigsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + ListWorkstationConfigsRequest request = + ListWorkstationConfigsRequest.newBuilder() + .setParent( + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListWorkstationConfigsResponse response = + workstationsClient.listWorkstationConfigsCallable().call(request); + for (WorkstationConfig element : response.getWorkstationConfigsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END workstations_v1beta_generated_Workstations_ListWorkstationConfigs_Paged_async] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstationconfigs/SyncListWorkstationConfigs.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstationconfigs/SyncListWorkstationConfigs.java new file mode 100644 index 000000000000..9a77c9b755d0 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstationconfigs/SyncListWorkstationConfigs.java @@ -0,0 +1,53 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_ListWorkstationConfigs_sync] +import com.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest; +import com.google.cloud.workstations.v1beta.WorkstationClusterName; +import com.google.cloud.workstations.v1beta.WorkstationConfig; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncListWorkstationConfigs { + + public static void main(String[] args) throws Exception { + syncListWorkstationConfigs(); + } + + public static void syncListWorkstationConfigs() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + ListWorkstationConfigsRequest request = + ListWorkstationConfigsRequest.newBuilder() + .setParent( + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (WorkstationConfig element : + workstationsClient.listWorkstationConfigs(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END workstations_v1beta_generated_Workstations_ListWorkstationConfigs_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstationconfigs/SyncListWorkstationConfigsString.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstationconfigs/SyncListWorkstationConfigsString.java new file mode 100644 index 000000000000..626ece08ba16 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstationconfigs/SyncListWorkstationConfigsString.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_ListWorkstationConfigs_String_sync] +import com.google.cloud.workstations.v1beta.WorkstationClusterName; +import com.google.cloud.workstations.v1beta.WorkstationConfig; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncListWorkstationConfigsString { + + public static void main(String[] args) throws Exception { + syncListWorkstationConfigsString(); + } + + public static void syncListWorkstationConfigsString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + String parent = + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]").toString(); + for (WorkstationConfig element : + workstationsClient.listWorkstationConfigs(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END workstations_v1beta_generated_Workstations_ListWorkstationConfigs_String_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstationconfigs/SyncListWorkstationConfigsWorkstationclustername.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstationconfigs/SyncListWorkstationConfigsWorkstationclustername.java new file mode 100644 index 000000000000..30d6fa50d2a2 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstationconfigs/SyncListWorkstationConfigsWorkstationclustername.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_ListWorkstationConfigs_Workstationclustername_sync] +import com.google.cloud.workstations.v1beta.WorkstationClusterName; +import com.google.cloud.workstations.v1beta.WorkstationConfig; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncListWorkstationConfigsWorkstationclustername { + + public static void main(String[] args) throws Exception { + syncListWorkstationConfigsWorkstationclustername(); + } + + public static void syncListWorkstationConfigsWorkstationclustername() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + WorkstationClusterName parent = + WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]"); + for (WorkstationConfig element : + workstationsClient.listWorkstationConfigs(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END workstations_v1beta_generated_Workstations_ListWorkstationConfigs_Workstationclustername_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstations/AsyncListWorkstations.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstations/AsyncListWorkstations.java new file mode 100644 index 000000000000..03136aa2cc29 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstations/AsyncListWorkstations.java @@ -0,0 +1,60 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_ListWorkstations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.workstations.v1beta.ListWorkstationsRequest; +import com.google.cloud.workstations.v1beta.Workstation; +import com.google.cloud.workstations.v1beta.WorkstationConfigName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class AsyncListWorkstations { + + public static void main(String[] args) throws Exception { + asyncListWorkstations(); + } + + public static void asyncListWorkstations() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + ListWorkstationsRequest request = + ListWorkstationsRequest.newBuilder() + .setParent( + WorkstationConfigName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + workstationsClient.listWorkstationsPagedCallable().futureCall(request); + // Do something. + for (Workstation element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END workstations_v1beta_generated_Workstations_ListWorkstations_async] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstations/AsyncListWorkstationsPaged.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstations/AsyncListWorkstationsPaged.java new file mode 100644 index 000000000000..b3520213a11e --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstations/AsyncListWorkstationsPaged.java @@ -0,0 +1,68 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_ListWorkstations_Paged_async] +import com.google.cloud.workstations.v1beta.ListWorkstationsRequest; +import com.google.cloud.workstations.v1beta.ListWorkstationsResponse; +import com.google.cloud.workstations.v1beta.Workstation; +import com.google.cloud.workstations.v1beta.WorkstationConfigName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; +import com.google.common.base.Strings; + +public class AsyncListWorkstationsPaged { + + public static void main(String[] args) throws Exception { + asyncListWorkstationsPaged(); + } + + public static void asyncListWorkstationsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + ListWorkstationsRequest request = + ListWorkstationsRequest.newBuilder() + .setParent( + WorkstationConfigName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListWorkstationsResponse response = + workstationsClient.listWorkstationsCallable().call(request); + for (Workstation element : response.getWorkstationsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END workstations_v1beta_generated_Workstations_ListWorkstations_Paged_async] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstations/SyncListWorkstations.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstations/SyncListWorkstations.java new file mode 100644 index 000000000000..6f0e148a78ea --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstations/SyncListWorkstations.java @@ -0,0 +1,56 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_ListWorkstations_sync] +import com.google.cloud.workstations.v1beta.ListWorkstationsRequest; +import com.google.cloud.workstations.v1beta.Workstation; +import com.google.cloud.workstations.v1beta.WorkstationConfigName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncListWorkstations { + + public static void main(String[] args) throws Exception { + syncListWorkstations(); + } + + public static void syncListWorkstations() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + ListWorkstationsRequest request = + ListWorkstationsRequest.newBuilder() + .setParent( + WorkstationConfigName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Workstation element : workstationsClient.listWorkstations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END workstations_v1beta_generated_Workstations_ListWorkstations_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstations/SyncListWorkstationsString.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstations/SyncListWorkstationsString.java new file mode 100644 index 000000000000..0a47f5a734f2 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstations/SyncListWorkstationsString.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_ListWorkstations_String_sync] +import com.google.cloud.workstations.v1beta.Workstation; +import com.google.cloud.workstations.v1beta.WorkstationConfigName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncListWorkstationsString { + + public static void main(String[] args) throws Exception { + syncListWorkstationsString(); + } + + public static void syncListWorkstationsString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + String parent = + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]") + .toString(); + for (Workstation element : workstationsClient.listWorkstations(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END workstations_v1beta_generated_Workstations_ListWorkstations_String_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstations/SyncListWorkstationsWorkstationconfigname.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstations/SyncListWorkstationsWorkstationconfigname.java new file mode 100644 index 000000000000..f64d6af592ca --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/listworkstations/SyncListWorkstationsWorkstationconfigname.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_ListWorkstations_Workstationconfigname_sync] +import com.google.cloud.workstations.v1beta.Workstation; +import com.google.cloud.workstations.v1beta.WorkstationConfigName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncListWorkstationsWorkstationconfigname { + + public static void main(String[] args) throws Exception { + syncListWorkstationsWorkstationconfigname(); + } + + public static void syncListWorkstationsWorkstationconfigname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + WorkstationConfigName parent = + WorkstationConfigName.of( + "[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]"); + for (Workstation element : workstationsClient.listWorkstations(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END workstations_v1beta_generated_Workstations_ListWorkstations_Workstationconfigname_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/setiampolicy/AsyncSetIamPolicy.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/setiampolicy/AsyncSetIamPolicy.java new file mode 100644 index 000000000000..c855c86cb138 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/setiampolicy/AsyncSetIamPolicy.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_SetIamPolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.workstations.v1beta.WorkstationName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; + +public class AsyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncSetIamPolicy(); + } + + public static void asyncSetIamPolicy() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = workstationsClient.setIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_SetIamPolicy_async] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/setiampolicy/SyncSetIamPolicy.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/setiampolicy/SyncSetIamPolicy.java new file mode 100644 index 000000000000..0da36e92ea01 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/setiampolicy/SyncSetIamPolicy.java @@ -0,0 +1,56 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_SetIamPolicy_sync] +import com.google.cloud.workstations.v1beta.WorkstationName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; + +public class SyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + syncSetIamPolicy(); + } + + public static void syncSetIamPolicy() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + Policy response = workstationsClient.setIamPolicy(request); + } + } +} +// [END workstations_v1beta_generated_Workstations_SetIamPolicy_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/startworkstation/AsyncStartWorkstation.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/startworkstation/AsyncStartWorkstation.java new file mode 100644 index 000000000000..b3a985da1ca8 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/startworkstation/AsyncStartWorkstation.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_StartWorkstation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.workstations.v1beta.StartWorkstationRequest; +import com.google.cloud.workstations.v1beta.WorkstationName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; +import com.google.longrunning.Operation; + +public class AsyncStartWorkstation { + + public static void main(String[] args) throws Exception { + asyncStartWorkstation(); + } + + public static void asyncStartWorkstation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + StartWorkstationRequest request = + StartWorkstationRequest.newBuilder() + .setName( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setValidateOnly(true) + .setEtag("etag3123477") + .build(); + ApiFuture future = + workstationsClient.startWorkstationCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_StartWorkstation_async] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/startworkstation/AsyncStartWorkstationLRO.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/startworkstation/AsyncStartWorkstationLRO.java new file mode 100644 index 000000000000..49b9a8d81091 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/startworkstation/AsyncStartWorkstationLRO.java @@ -0,0 +1,60 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_StartWorkstation_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.workstations.v1beta.OperationMetadata; +import com.google.cloud.workstations.v1beta.StartWorkstationRequest; +import com.google.cloud.workstations.v1beta.Workstation; +import com.google.cloud.workstations.v1beta.WorkstationName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class AsyncStartWorkstationLRO { + + public static void main(String[] args) throws Exception { + asyncStartWorkstationLRO(); + } + + public static void asyncStartWorkstationLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + StartWorkstationRequest request = + StartWorkstationRequest.newBuilder() + .setName( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setValidateOnly(true) + .setEtag("etag3123477") + .build(); + OperationFuture future = + workstationsClient.startWorkstationOperationCallable().futureCall(request); + // Do something. + Workstation response = future.get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_StartWorkstation_LRO_async] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/startworkstation/SyncStartWorkstation.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/startworkstation/SyncStartWorkstation.java new file mode 100644 index 000000000000..d4b543e4c6ee --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/startworkstation/SyncStartWorkstation.java @@ -0,0 +1,55 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_StartWorkstation_sync] +import com.google.cloud.workstations.v1beta.StartWorkstationRequest; +import com.google.cloud.workstations.v1beta.Workstation; +import com.google.cloud.workstations.v1beta.WorkstationName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncStartWorkstation { + + public static void main(String[] args) throws Exception { + syncStartWorkstation(); + } + + public static void syncStartWorkstation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + StartWorkstationRequest request = + StartWorkstationRequest.newBuilder() + .setName( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setValidateOnly(true) + .setEtag("etag3123477") + .build(); + Workstation response = workstationsClient.startWorkstationAsync(request).get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_StartWorkstation_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/startworkstation/SyncStartWorkstationString.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/startworkstation/SyncStartWorkstationString.java new file mode 100644 index 000000000000..155b7e48f407 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/startworkstation/SyncStartWorkstationString.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_StartWorkstation_String_sync] +import com.google.cloud.workstations.v1beta.Workstation; +import com.google.cloud.workstations.v1beta.WorkstationName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncStartWorkstationString { + + public static void main(String[] args) throws Exception { + syncStartWorkstationString(); + } + + public static void syncStartWorkstationString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + String name = + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString(); + Workstation response = workstationsClient.startWorkstationAsync(name).get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_StartWorkstation_String_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/startworkstation/SyncStartWorkstationWorkstationname.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/startworkstation/SyncStartWorkstationWorkstationname.java new file mode 100644 index 000000000000..3df40cc3da27 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/startworkstation/SyncStartWorkstationWorkstationname.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_StartWorkstation_Workstationname_sync] +import com.google.cloud.workstations.v1beta.Workstation; +import com.google.cloud.workstations.v1beta.WorkstationName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncStartWorkstationWorkstationname { + + public static void main(String[] args) throws Exception { + syncStartWorkstationWorkstationname(); + } + + public static void syncStartWorkstationWorkstationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + WorkstationName name = + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]"); + Workstation response = workstationsClient.startWorkstationAsync(name).get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_StartWorkstation_Workstationname_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/stopworkstation/AsyncStopWorkstation.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/stopworkstation/AsyncStopWorkstation.java new file mode 100644 index 000000000000..cb66712205c8 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/stopworkstation/AsyncStopWorkstation.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_StopWorkstation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.workstations.v1beta.StopWorkstationRequest; +import com.google.cloud.workstations.v1beta.WorkstationName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; +import com.google.longrunning.Operation; + +public class AsyncStopWorkstation { + + public static void main(String[] args) throws Exception { + asyncStopWorkstation(); + } + + public static void asyncStopWorkstation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + StopWorkstationRequest request = + StopWorkstationRequest.newBuilder() + .setName( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setValidateOnly(true) + .setEtag("etag3123477") + .build(); + ApiFuture future = + workstationsClient.stopWorkstationCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_StopWorkstation_async] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/stopworkstation/AsyncStopWorkstationLRO.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/stopworkstation/AsyncStopWorkstationLRO.java new file mode 100644 index 000000000000..02b0d4547c75 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/stopworkstation/AsyncStopWorkstationLRO.java @@ -0,0 +1,60 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_StopWorkstation_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.workstations.v1beta.OperationMetadata; +import com.google.cloud.workstations.v1beta.StopWorkstationRequest; +import com.google.cloud.workstations.v1beta.Workstation; +import com.google.cloud.workstations.v1beta.WorkstationName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class AsyncStopWorkstationLRO { + + public static void main(String[] args) throws Exception { + asyncStopWorkstationLRO(); + } + + public static void asyncStopWorkstationLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + StopWorkstationRequest request = + StopWorkstationRequest.newBuilder() + .setName( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setValidateOnly(true) + .setEtag("etag3123477") + .build(); + OperationFuture future = + workstationsClient.stopWorkstationOperationCallable().futureCall(request); + // Do something. + Workstation response = future.get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_StopWorkstation_LRO_async] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/stopworkstation/SyncStopWorkstation.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/stopworkstation/SyncStopWorkstation.java new file mode 100644 index 000000000000..3002f532ab9f --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/stopworkstation/SyncStopWorkstation.java @@ -0,0 +1,55 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_StopWorkstation_sync] +import com.google.cloud.workstations.v1beta.StopWorkstationRequest; +import com.google.cloud.workstations.v1beta.Workstation; +import com.google.cloud.workstations.v1beta.WorkstationName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncStopWorkstation { + + public static void main(String[] args) throws Exception { + syncStopWorkstation(); + } + + public static void syncStopWorkstation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + StopWorkstationRequest request = + StopWorkstationRequest.newBuilder() + .setName( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .setValidateOnly(true) + .setEtag("etag3123477") + .build(); + Workstation response = workstationsClient.stopWorkstationAsync(request).get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_StopWorkstation_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/stopworkstation/SyncStopWorkstationString.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/stopworkstation/SyncStopWorkstationString.java new file mode 100644 index 000000000000..3fdbb66b1594 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/stopworkstation/SyncStopWorkstationString.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_StopWorkstation_String_sync] +import com.google.cloud.workstations.v1beta.Workstation; +import com.google.cloud.workstations.v1beta.WorkstationName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncStopWorkstationString { + + public static void main(String[] args) throws Exception { + syncStopWorkstationString(); + } + + public static void syncStopWorkstationString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + String name = + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString(); + Workstation response = workstationsClient.stopWorkstationAsync(name).get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_StopWorkstation_String_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/stopworkstation/SyncStopWorkstationWorkstationname.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/stopworkstation/SyncStopWorkstationWorkstationname.java new file mode 100644 index 000000000000..1b99a2b98e38 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/stopworkstation/SyncStopWorkstationWorkstationname.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_StopWorkstation_Workstationname_sync] +import com.google.cloud.workstations.v1beta.Workstation; +import com.google.cloud.workstations.v1beta.WorkstationName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; + +public class SyncStopWorkstationWorkstationname { + + public static void main(String[] args) throws Exception { + syncStopWorkstationWorkstationname(); + } + + public static void syncStopWorkstationWorkstationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + WorkstationName name = + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]"); + Workstation response = workstationsClient.stopWorkstationAsync(name).get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_StopWorkstation_Workstationname_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/testiampermissions/AsyncTestIamPermissions.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/testiampermissions/AsyncTestIamPermissions.java new file mode 100644 index 000000000000..153660d06946 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/testiampermissions/AsyncTestIamPermissions.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_TestIamPermissions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.workstations.v1beta.WorkstationName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.util.ArrayList; + +public class AsyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + asyncTestIamPermissions(); + } + + public static void asyncTestIamPermissions() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .addAllPermissions(new ArrayList()) + .build(); + ApiFuture future = + workstationsClient.testIamPermissionsCallable().futureCall(request); + // Do something. + TestIamPermissionsResponse response = future.get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_TestIamPermissions_async] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/testiampermissions/SyncTestIamPermissions.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/testiampermissions/SyncTestIamPermissions.java new file mode 100644 index 000000000000..3efa56e7d55e --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/testiampermissions/SyncTestIamPermissions.java @@ -0,0 +1,55 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_TestIamPermissions_sync] +import com.google.cloud.workstations.v1beta.WorkstationName; +import com.google.cloud.workstations.v1beta.WorkstationsClient; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.util.ArrayList; + +public class SyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + syncTestIamPermissions(); + } + + public static void syncTestIamPermissions() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource( + WorkstationName.of( + "[PROJECT]", + "[LOCATION]", + "[WORKSTATION_CLUSTER]", + "[WORKSTATION_CONFIG]", + "[WORKSTATION]") + .toString()) + .addAllPermissions(new ArrayList()) + .build(); + TestIamPermissionsResponse response = workstationsClient.testIamPermissions(request); + } + } +} +// [END workstations_v1beta_generated_Workstations_TestIamPermissions_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/updateworkstation/AsyncUpdateWorkstation.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/updateworkstation/AsyncUpdateWorkstation.java new file mode 100644 index 000000000000..992538a3959b --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/updateworkstation/AsyncUpdateWorkstation.java @@ -0,0 +1,54 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_UpdateWorkstation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.workstations.v1beta.UpdateWorkstationRequest; +import com.google.cloud.workstations.v1beta.Workstation; +import com.google.cloud.workstations.v1beta.WorkstationsClient; +import com.google.longrunning.Operation; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateWorkstation { + + public static void main(String[] args) throws Exception { + asyncUpdateWorkstation(); + } + + public static void asyncUpdateWorkstation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + UpdateWorkstationRequest request = + UpdateWorkstationRequest.newBuilder() + .setWorkstation(Workstation.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .setValidateOnly(true) + .setAllowMissing(true) + .build(); + ApiFuture future = + workstationsClient.updateWorkstationCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_UpdateWorkstation_async] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/updateworkstation/AsyncUpdateWorkstationLRO.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/updateworkstation/AsyncUpdateWorkstationLRO.java new file mode 100644 index 000000000000..db3c6dc6018a --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/updateworkstation/AsyncUpdateWorkstationLRO.java @@ -0,0 +1,54 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_UpdateWorkstation_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.workstations.v1beta.OperationMetadata; +import com.google.cloud.workstations.v1beta.UpdateWorkstationRequest; +import com.google.cloud.workstations.v1beta.Workstation; +import com.google.cloud.workstations.v1beta.WorkstationsClient; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateWorkstationLRO { + + public static void main(String[] args) throws Exception { + asyncUpdateWorkstationLRO(); + } + + public static void asyncUpdateWorkstationLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + UpdateWorkstationRequest request = + UpdateWorkstationRequest.newBuilder() + .setWorkstation(Workstation.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .setValidateOnly(true) + .setAllowMissing(true) + .build(); + OperationFuture future = + workstationsClient.updateWorkstationOperationCallable().futureCall(request); + // Do something. + Workstation response = future.get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_UpdateWorkstation_LRO_async] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/updateworkstation/SyncUpdateWorkstation.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/updateworkstation/SyncUpdateWorkstation.java new file mode 100644 index 000000000000..4e4c67d65c12 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/updateworkstation/SyncUpdateWorkstation.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_UpdateWorkstation_sync] +import com.google.cloud.workstations.v1beta.UpdateWorkstationRequest; +import com.google.cloud.workstations.v1beta.Workstation; +import com.google.cloud.workstations.v1beta.WorkstationsClient; +import com.google.protobuf.FieldMask; + +public class SyncUpdateWorkstation { + + public static void main(String[] args) throws Exception { + syncUpdateWorkstation(); + } + + public static void syncUpdateWorkstation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + UpdateWorkstationRequest request = + UpdateWorkstationRequest.newBuilder() + .setWorkstation(Workstation.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .setValidateOnly(true) + .setAllowMissing(true) + .build(); + Workstation response = workstationsClient.updateWorkstationAsync(request).get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_UpdateWorkstation_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/updateworkstation/SyncUpdateWorkstationWorkstationFieldmask.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/updateworkstation/SyncUpdateWorkstationWorkstationFieldmask.java new file mode 100644 index 000000000000..521f4b71b94d --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/updateworkstation/SyncUpdateWorkstationWorkstationFieldmask.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_UpdateWorkstation_WorkstationFieldmask_sync] +import com.google.cloud.workstations.v1beta.Workstation; +import com.google.cloud.workstations.v1beta.WorkstationsClient; +import com.google.protobuf.FieldMask; + +public class SyncUpdateWorkstationWorkstationFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateWorkstationWorkstationFieldmask(); + } + + public static void syncUpdateWorkstationWorkstationFieldmask() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + Workstation workstation = Workstation.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Workstation response = + workstationsClient.updateWorkstationAsync(workstation, updateMask).get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_UpdateWorkstation_WorkstationFieldmask_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/updateworkstationcluster/AsyncUpdateWorkstationCluster.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/updateworkstationcluster/AsyncUpdateWorkstationCluster.java new file mode 100644 index 000000000000..a5fccaa8773c --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/updateworkstationcluster/AsyncUpdateWorkstationCluster.java @@ -0,0 +1,54 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_UpdateWorkstationCluster_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest; +import com.google.cloud.workstations.v1beta.WorkstationCluster; +import com.google.cloud.workstations.v1beta.WorkstationsClient; +import com.google.longrunning.Operation; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateWorkstationCluster { + + public static void main(String[] args) throws Exception { + asyncUpdateWorkstationCluster(); + } + + public static void asyncUpdateWorkstationCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + UpdateWorkstationClusterRequest request = + UpdateWorkstationClusterRequest.newBuilder() + .setWorkstationCluster(WorkstationCluster.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .setValidateOnly(true) + .setAllowMissing(true) + .build(); + ApiFuture future = + workstationsClient.updateWorkstationClusterCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_UpdateWorkstationCluster_async] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/updateworkstationcluster/AsyncUpdateWorkstationClusterLRO.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/updateworkstationcluster/AsyncUpdateWorkstationClusterLRO.java new file mode 100644 index 000000000000..43beb9cf5a03 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/updateworkstationcluster/AsyncUpdateWorkstationClusterLRO.java @@ -0,0 +1,54 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_UpdateWorkstationCluster_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.workstations.v1beta.OperationMetadata; +import com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest; +import com.google.cloud.workstations.v1beta.WorkstationCluster; +import com.google.cloud.workstations.v1beta.WorkstationsClient; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateWorkstationClusterLRO { + + public static void main(String[] args) throws Exception { + asyncUpdateWorkstationClusterLRO(); + } + + public static void asyncUpdateWorkstationClusterLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + UpdateWorkstationClusterRequest request = + UpdateWorkstationClusterRequest.newBuilder() + .setWorkstationCluster(WorkstationCluster.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .setValidateOnly(true) + .setAllowMissing(true) + .build(); + OperationFuture future = + workstationsClient.updateWorkstationClusterOperationCallable().futureCall(request); + // Do something. + WorkstationCluster response = future.get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_UpdateWorkstationCluster_LRO_async] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/updateworkstationcluster/SyncUpdateWorkstationCluster.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/updateworkstationcluster/SyncUpdateWorkstationCluster.java new file mode 100644 index 000000000000..9b93c49979cc --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/updateworkstationcluster/SyncUpdateWorkstationCluster.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_UpdateWorkstationCluster_sync] +import com.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest; +import com.google.cloud.workstations.v1beta.WorkstationCluster; +import com.google.cloud.workstations.v1beta.WorkstationsClient; +import com.google.protobuf.FieldMask; + +public class SyncUpdateWorkstationCluster { + + public static void main(String[] args) throws Exception { + syncUpdateWorkstationCluster(); + } + + public static void syncUpdateWorkstationCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + UpdateWorkstationClusterRequest request = + UpdateWorkstationClusterRequest.newBuilder() + .setWorkstationCluster(WorkstationCluster.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .setValidateOnly(true) + .setAllowMissing(true) + .build(); + WorkstationCluster response = workstationsClient.updateWorkstationClusterAsync(request).get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_UpdateWorkstationCluster_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/updateworkstationcluster/SyncUpdateWorkstationClusterWorkstationclusterFieldmask.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/updateworkstationcluster/SyncUpdateWorkstationClusterWorkstationclusterFieldmask.java new file mode 100644 index 000000000000..b1b18b24680d --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/updateworkstationcluster/SyncUpdateWorkstationClusterWorkstationclusterFieldmask.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_UpdateWorkstationCluster_WorkstationclusterFieldmask_sync] +import com.google.cloud.workstations.v1beta.WorkstationCluster; +import com.google.cloud.workstations.v1beta.WorkstationsClient; +import com.google.protobuf.FieldMask; + +public class SyncUpdateWorkstationClusterWorkstationclusterFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateWorkstationClusterWorkstationclusterFieldmask(); + } + + public static void syncUpdateWorkstationClusterWorkstationclusterFieldmask() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + WorkstationCluster workstationCluster = WorkstationCluster.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + WorkstationCluster response = + workstationsClient.updateWorkstationClusterAsync(workstationCluster, updateMask).get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_UpdateWorkstationCluster_WorkstationclusterFieldmask_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/updateworkstationconfig/AsyncUpdateWorkstationConfig.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/updateworkstationconfig/AsyncUpdateWorkstationConfig.java new file mode 100644 index 000000000000..aa501f8231a6 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/updateworkstationconfig/AsyncUpdateWorkstationConfig.java @@ -0,0 +1,54 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_UpdateWorkstationConfig_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest; +import com.google.cloud.workstations.v1beta.WorkstationConfig; +import com.google.cloud.workstations.v1beta.WorkstationsClient; +import com.google.longrunning.Operation; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateWorkstationConfig { + + public static void main(String[] args) throws Exception { + asyncUpdateWorkstationConfig(); + } + + public static void asyncUpdateWorkstationConfig() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + UpdateWorkstationConfigRequest request = + UpdateWorkstationConfigRequest.newBuilder() + .setWorkstationConfig(WorkstationConfig.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .setValidateOnly(true) + .setAllowMissing(true) + .build(); + ApiFuture future = + workstationsClient.updateWorkstationConfigCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_UpdateWorkstationConfig_async] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/updateworkstationconfig/AsyncUpdateWorkstationConfigLRO.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/updateworkstationconfig/AsyncUpdateWorkstationConfigLRO.java new file mode 100644 index 000000000000..4601ad56fb22 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/updateworkstationconfig/AsyncUpdateWorkstationConfigLRO.java @@ -0,0 +1,54 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_UpdateWorkstationConfig_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.workstations.v1beta.OperationMetadata; +import com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest; +import com.google.cloud.workstations.v1beta.WorkstationConfig; +import com.google.cloud.workstations.v1beta.WorkstationsClient; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateWorkstationConfigLRO { + + public static void main(String[] args) throws Exception { + asyncUpdateWorkstationConfigLRO(); + } + + public static void asyncUpdateWorkstationConfigLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + UpdateWorkstationConfigRequest request = + UpdateWorkstationConfigRequest.newBuilder() + .setWorkstationConfig(WorkstationConfig.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .setValidateOnly(true) + .setAllowMissing(true) + .build(); + OperationFuture future = + workstationsClient.updateWorkstationConfigOperationCallable().futureCall(request); + // Do something. + WorkstationConfig response = future.get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_UpdateWorkstationConfig_LRO_async] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/updateworkstationconfig/SyncUpdateWorkstationConfig.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/updateworkstationconfig/SyncUpdateWorkstationConfig.java new file mode 100644 index 000000000000..283e52fabce7 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/updateworkstationconfig/SyncUpdateWorkstationConfig.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_UpdateWorkstationConfig_sync] +import com.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest; +import com.google.cloud.workstations.v1beta.WorkstationConfig; +import com.google.cloud.workstations.v1beta.WorkstationsClient; +import com.google.protobuf.FieldMask; + +public class SyncUpdateWorkstationConfig { + + public static void main(String[] args) throws Exception { + syncUpdateWorkstationConfig(); + } + + public static void syncUpdateWorkstationConfig() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + UpdateWorkstationConfigRequest request = + UpdateWorkstationConfigRequest.newBuilder() + .setWorkstationConfig(WorkstationConfig.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .setValidateOnly(true) + .setAllowMissing(true) + .build(); + WorkstationConfig response = workstationsClient.updateWorkstationConfigAsync(request).get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_UpdateWorkstationConfig_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/updateworkstationconfig/SyncUpdateWorkstationConfigWorkstationconfigFieldmask.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/updateworkstationconfig/SyncUpdateWorkstationConfigWorkstationconfigFieldmask.java new file mode 100644 index 000000000000..fbb0aaf1e7fd --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstations/updateworkstationconfig/SyncUpdateWorkstationConfigWorkstationconfigFieldmask.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_Workstations_UpdateWorkstationConfig_WorkstationconfigFieldmask_sync] +import com.google.cloud.workstations.v1beta.WorkstationConfig; +import com.google.cloud.workstations.v1beta.WorkstationsClient; +import com.google.protobuf.FieldMask; + +public class SyncUpdateWorkstationConfigWorkstationconfigFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateWorkstationConfigWorkstationconfigFieldmask(); + } + + public static void syncUpdateWorkstationConfigWorkstationconfigFieldmask() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (WorkstationsClient workstationsClient = WorkstationsClient.create()) { + WorkstationConfig workstationConfig = WorkstationConfig.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + WorkstationConfig response = + workstationsClient.updateWorkstationConfigAsync(workstationConfig, updateMask).get(); + } + } +} +// [END workstations_v1beta_generated_Workstations_UpdateWorkstationConfig_WorkstationconfigFieldmask_sync] diff --git a/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstationssettings/getworkstationcluster/SyncGetWorkstationCluster.java b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstationssettings/getworkstationcluster/SyncGetWorkstationCluster.java new file mode 100644 index 000000000000..448e4bedad17 --- /dev/null +++ b/java-workstations/samples/snippets/generated/com/google/cloud/workstations/v1beta/workstationssettings/getworkstationcluster/SyncGetWorkstationCluster.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 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.workstations.v1beta.samples; + +// [START workstations_v1beta_generated_WorkstationsSettings_GetWorkstationCluster_sync] +import com.google.cloud.workstations.v1beta.WorkstationsSettings; +import java.time.Duration; + +public class SyncGetWorkstationCluster { + + public static void main(String[] args) throws Exception { + syncGetWorkstationCluster(); + } + + public static void syncGetWorkstationCluster() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + WorkstationsSettings.Builder workstationsSettingsBuilder = WorkstationsSettings.newBuilder(); + workstationsSettingsBuilder + .getWorkstationClusterSettings() + .setRetrySettings( + workstationsSettingsBuilder + .getWorkstationClusterSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + WorkstationsSettings workstationsSettings = workstationsSettingsBuilder.build(); + } +} +// [END workstations_v1beta_generated_WorkstationsSettings_GetWorkstationCluster_sync] diff --git a/pom.xml b/pom.xml index 0d32610ff6eb..b323ef4ce0fd 100644 --- a/pom.xml +++ b/pom.xml @@ -165,6 +165,7 @@ java-websecurityscanner java-workflow-executions java-workflows + java-workstations diff --git a/versions.txt b/versions.txt index 16bd1ce7573a..100e3ab7fd8e 100644 --- a/versions.txt +++ b/versions.txt @@ -624,3 +624,6 @@ proto-google-cloud-alloydb-v1alpha:0.1.0:0.2.0-SNAPSHOT grpc-google-cloud-alloydb-v1beta:0.1.0:0.2.0-SNAPSHOT grpc-google-cloud-alloydb-v1:0.1.0:0.2.0-SNAPSHOT grpc-google-cloud-alloydb-v1alpha:0.1.0:0.2.0-SNAPSHOT +google-cloud-workstations:0.0.0:0.0.1-SNAPSHOT +proto-google-cloud-workstations-v1beta:0.0.0:0.0.1-SNAPSHOT +grpc-google-cloud-workstations-v1beta:0.0.0:0.0.1-SNAPSHOT