From da606a0ab9bf24438e4c481357a161da509bcf49 Mon Sep 17 00:00:00 2001
From: "release-please[bot]"
<55107282+release-please[bot]@users.noreply.github.com>
Date: Tue, 29 Mar 2022 19:16:11 +0000
Subject: [PATCH 01/13] chore(main): release 0.1.2-SNAPSHOT (#19)
:robot: I have created a release *beep* *boop*
---
### Updating meta-information for bleeding-edge SNAPSHOT release.
---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
---
google-cloud-optimization-bom/pom.xml | 8 ++++----
google-cloud-optimization/pom.xml | 4 ++--
grpc-google-cloud-optimization-v1/pom.xml | 4 ++--
pom.xml | 8 ++++----
proto-google-cloud-optimization-v1/pom.xml | 4 ++--
samples/snapshot/pom.xml | 2 +-
versions.txt | 6 +++---
7 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/google-cloud-optimization-bom/pom.xml b/google-cloud-optimization-bom/pom.xml
index 028d064..07b45fc 100644
--- a/google-cloud-optimization-bom/pom.xml
+++ b/google-cloud-optimization-bom/pom.xml
@@ -3,7 +3,7 @@
4.0.0
com.google.cloud
google-cloud-optimization-bom
- 0.1.1
+ 0.1.2-SNAPSHOT
pom
com.google.cloud
@@ -65,17 +65,17 @@
com.google.cloud
google-cloud-optimization
- 0.1.1
+ 0.1.2-SNAPSHOT
com.google.api.grpc
grpc-google-cloud-optimization-v1
- 0.1.1
+ 0.1.2-SNAPSHOT
com.google.api.grpc
proto-google-cloud-optimization-v1
- 0.1.1
+ 0.1.2-SNAPSHOT
diff --git a/google-cloud-optimization/pom.xml b/google-cloud-optimization/pom.xml
index c705779..b44b1de 100644
--- a/google-cloud-optimization/pom.xml
+++ b/google-cloud-optimization/pom.xml
@@ -3,7 +3,7 @@
4.0.0
com.google.cloud
google-cloud-optimization
- 0.1.1
+ 0.1.2-SNAPSHOT
jar
Google Cloud Fleet Routing
https://github.com/googleapis/java-optimization
@@ -11,7 +11,7 @@
com.google.cloud
google-cloud-optimization-parent
- 0.1.1
+ 0.1.2-SNAPSHOT
google-cloud-optimization
diff --git a/grpc-google-cloud-optimization-v1/pom.xml b/grpc-google-cloud-optimization-v1/pom.xml
index bd42740..172996b 100644
--- a/grpc-google-cloud-optimization-v1/pom.xml
+++ b/grpc-google-cloud-optimization-v1/pom.xml
@@ -4,13 +4,13 @@
4.0.0
com.google.api.grpc
grpc-google-cloud-optimization-v1
- 0.1.1
+ 0.1.2-SNAPSHOT
grpc-google-cloud-optimization-v1
GRPC library for google-cloud-optimization
com.google.cloud
google-cloud-optimization-parent
- 0.1.1
+ 0.1.2-SNAPSHOT
diff --git a/pom.xml b/pom.xml
index 2b38751..a60aa16 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
com.google.cloud
google-cloud-optimization-parent
pom
- 0.1.1
+ 0.1.2-SNAPSHOT
Google Cloud Fleet Routing Parent
https://github.com/googleapis/java-optimization
@@ -69,17 +69,17 @@
com.google.cloud
google-cloud-optimization
- 0.1.1
+ 0.1.2-SNAPSHOT
com.google.api.grpc
grpc-google-cloud-optimization-v1
- 0.1.1
+ 0.1.2-SNAPSHOT
com.google.api.grpc
proto-google-cloud-optimization-v1
- 0.1.1
+ 0.1.2-SNAPSHOT
diff --git a/proto-google-cloud-optimization-v1/pom.xml b/proto-google-cloud-optimization-v1/pom.xml
index 77a00fe..bd42e59 100644
--- a/proto-google-cloud-optimization-v1/pom.xml
+++ b/proto-google-cloud-optimization-v1/pom.xml
@@ -4,13 +4,13 @@
4.0.0
com.google.api.grpc
proto-google-cloud-optimization-v1
- 0.1.1
+ 0.1.2-SNAPSHOT
proto-google-cloud-optimization-v1
Proto library for google-cloud-optimization
com.google.cloud
google-cloud-optimization-parent
- 0.1.1
+ 0.1.2-SNAPSHOT
diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml
index 5c13175..1f67e12 100644
--- a/samples/snapshot/pom.xml
+++ b/samples/snapshot/pom.xml
@@ -28,7 +28,7 @@
com.google.cloud
google-cloud-optimization
- 0.1.1
+ 0.1.2-SNAPSHOT
diff --git a/versions.txt b/versions.txt
index d9a95c1..55d37e6 100644
--- a/versions.txt
+++ b/versions.txt
@@ -1,6 +1,6 @@
# Format:
# module:released-version:current-version
-google-cloud-optimization:0.1.1:0.1.1
-proto-google-cloud-optimization-v1:0.1.1:0.1.1
-grpc-google-cloud-optimization-v1:0.1.1:0.1.1
+google-cloud-optimization:0.1.1:0.1.2-SNAPSHOT
+proto-google-cloud-optimization-v1:0.1.1:0.1.2-SNAPSHOT
+grpc-google-cloud-optimization-v1:0.1.1:0.1.2-SNAPSHOT
From 4fb9ddcc20653b7b7e1d2011570d2b85533c6665 Mon Sep 17 00:00:00 2001
From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com>
Date: Mon, 4 Apr 2022 17:04:24 +0000
Subject: [PATCH 02/13] chore(deps): update dependency
org.sonatype.plugins:nexus-staging-maven-plugin to v1.6.12 (#1388) (#20)
Co-authored-by: Neenu Shaji
Source-Link: https://github.com/googleapis/synthtool/commit/4c770a0c6ef46b8462608c485735801b65be65ea
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:029f8a2fcd20ab09808e4a5cf5f3866f5976b6635197c764679f9b22591aab58
---
.github/.OwlBot.lock.yaml | 5 +++--
README.md | 6 +++---
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml
index bdbf465..0598f87 100644
--- a/.github/.OwlBot.lock.yaml
+++ b/.github/.OwlBot.lock.yaml
@@ -12,5 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
docker:
- digest: sha256:b0b1c1c89570e229b1026372a2b8989ba31495007055b8d30178b7648503eefa
- image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest
\ No newline at end of file
+ image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest
+ digest: sha256:029f8a2fcd20ab09808e4a5cf5f3866f5976b6635197c764679f9b22591aab58
+# created: 2022-04-01T19:51:01.017179449Z
diff --git a/README.md b/README.md
index 05c9fc8..c284101 100644
--- a/README.md
+++ b/README.md
@@ -22,20 +22,20 @@ If you are using Maven, add this to your pom.xml file:
com.google.cloud
google-cloud-optimization
- 0.1.0
+ 0.1.1
```
If you are using Gradle without BOM, add this to your dependencies
```Groovy
-implementation 'com.google.cloud:google-cloud-optimization:0.1.0'
+implementation 'com.google.cloud:google-cloud-optimization:0.1.1'
```
If you are using SBT, add this to your dependencies
```Scala
-libraryDependencies += "com.google.cloud" % "google-cloud-optimization" % "0.1.0"
+libraryDependencies += "com.google.cloud" % "google-cloud-optimization" % "0.1.1"
```
## Authentication
From 35e204954b50ce084cc485b71df9667ad3f16fad Mon Sep 17 00:00:00 2001
From: WhiteSource Renovate
Date: Mon, 4 Apr 2022 21:06:12 +0200
Subject: [PATCH 03/13] chore(deps): update dependency
com.google.cloud:google-cloud-optimization to v0.1.0 (#15)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[](https://renovatebot.com)
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:google-cloud-optimization](https://togithub.com/googleapis/java-optimization) | `0.0.0` -> `0.1.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) |
---
### Configuration
📅 **Schedule**: At any time (no schedule defined).
🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.
â™» **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found.
🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] If you want to rebase/retry this PR, click this checkbox.
---
This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-optimization).
---
samples/install-without-bom/pom.xml | 2 +-
samples/snippets/pom.xml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml
index 3a535f5..069a82c 100644
--- a/samples/install-without-bom/pom.xml
+++ b/samples/install-without-bom/pom.xml
@@ -29,7 +29,7 @@
com.google.cloud
google-cloud-optimization
- 0.0.0
+ 0.1.0
diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml
index 5e36cb5..ffbce96 100644
--- a/samples/snippets/pom.xml
+++ b/samples/snippets/pom.xml
@@ -28,7 +28,7 @@
com.google.cloud
google-cloud-optimization
- 0.0.0
+ 0.1.0
From 3ea6b661e3b2d25a6325c6a50efe0137e42302da Mon Sep 17 00:00:00 2001
From: WhiteSource Renovate
Date: Wed, 6 Apr 2022 18:12:21 +0200
Subject: [PATCH 04/13] chore(deps): update dependency
com.google.cloud:google-cloud-optimization to v0.1.1 (#22)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[](https://renovatebot.com)
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:google-cloud-optimization](https://togithub.com/googleapis/java-optimization) | `0.1.0` -> `0.1.1` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) |
---
### Release Notes
googleapis/java-optimization
### [`v0.1.1`](https://togithub.com/googleapis/java-optimization/blob/HEAD/CHANGELOG.md#011-httpsgithubcomgoogleapisjava-optimizationcomparev010v011-2022-03-29)
[Compare Source](https://togithub.com/googleapis/java-optimization/compare/v0.1.0...v0.1.1)
---
### Configuration
📅 **Schedule**: At any time (no schedule defined).
🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.
â™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] If you want to rebase/retry this PR, click this checkbox.
---
This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-optimization).
---
samples/install-without-bom/pom.xml | 2 +-
samples/snippets/pom.xml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml
index 069a82c..1ba7f30 100644
--- a/samples/install-without-bom/pom.xml
+++ b/samples/install-without-bom/pom.xml
@@ -29,7 +29,7 @@
com.google.cloud
google-cloud-optimization
- 0.1.0
+ 0.1.1
diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml
index ffbce96..dae97ee 100644
--- a/samples/snippets/pom.xml
+++ b/samples/snippets/pom.xml
@@ -28,7 +28,7 @@
com.google.cloud
google-cloud-optimization
- 0.1.0
+ 0.1.1
From accae7d29b97d12fa89db7be22f1132e30c7eb07 Mon Sep 17 00:00:00 2001
From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com>
Date: Wed, 6 Apr 2022 16:44:27 +0000
Subject: [PATCH 05/13] chore: upgrade black in noxfile.py to 22.3.0 (#1377)
(#21)
* chore: upgrade black to 22.3.0
* update lint also
* run blacken session
* ci: use click>8.0 for blacken/lint sessions
* chore: fix typo
Co-authored-by: nicain
* rebase error
Co-authored-by: nicain
Source-Link: https://github.com/googleapis/synthtool/commit/0dcf73928241fa27d7768e14c435e3d9f526beac
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:4a8d2d787ea374ba929e37c39c4b16d2498044e24ef123077125b946cac2dcdc
---
.github/.OwlBot.lock.yaml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml
index 0598f87..e0e0b1b 100644
--- a/.github/.OwlBot.lock.yaml
+++ b/.github/.OwlBot.lock.yaml
@@ -13,5 +13,5 @@
# limitations under the License.
docker:
image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest
- digest: sha256:029f8a2fcd20ab09808e4a5cf5f3866f5976b6635197c764679f9b22591aab58
-# created: 2022-04-01T19:51:01.017179449Z
+ digest: sha256:4a8d2d787ea374ba929e37c39c4b16d2498044e24ef123077125b946cac2dcdc
+# created: 2022-04-01T22:15:20.641398017Z
\ No newline at end of file
From 3063725ae41458cc2c4fd80c9ef87e3ea3cb516a Mon Sep 17 00:00:00 2001
From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com>
Date: Thu, 7 Apr 2022 17:07:39 -0700
Subject: [PATCH 06/13] chore: Enable Size-Label bot in all googleapis Java
repositories (#1381) (#23)
* chore: Enable Size-Label bot in all googleapis Java repositories
Auto-label T-shirt size indicator should be assigned on every new pull request in all googleapis Java repositories
* Remove product
Remove product since it is by default true
* add license header
Co-authored-by: Neenu Shaji
Source-Link: https://github.com/googleapis/synthtool/commit/54b2c6ac75370a4a3582431b4a3080f777ba1f11
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:fc52b202aa298a50a12c64efd04fea3884d867947effe2fa85382a246c09e813
Co-authored-by: Owl Bot
Co-authored-by: Neenu Shaji
Co-authored-by: Emily Ball
---
.github/.OwlBot.lock.yaml | 4 ++--
.github/auto-label.yaml | 15 +++++++++++++++
2 files changed, 17 insertions(+), 2 deletions(-)
create mode 100644 .github/auto-label.yaml
diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml
index e0e0b1b..f60d774 100644
--- a/.github/.OwlBot.lock.yaml
+++ b/.github/.OwlBot.lock.yaml
@@ -13,5 +13,5 @@
# limitations under the License.
docker:
image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest
- digest: sha256:4a8d2d787ea374ba929e37c39c4b16d2498044e24ef123077125b946cac2dcdc
-# created: 2022-04-01T22:15:20.641398017Z
\ No newline at end of file
+ digest: sha256:fc52b202aa298a50a12c64efd04fea3884d867947effe2fa85382a246c09e813
+# created: 2022-04-06T16:30:03.627422514Z
diff --git a/.github/auto-label.yaml b/.github/auto-label.yaml
new file mode 100644
index 0000000..4caef68
--- /dev/null
+++ b/.github/auto-label.yaml
@@ -0,0 +1,15 @@
+# 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
+#
+# 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.
+requestsize:
+ enabled: true
From fb23c17de88919609cff8e1e20d2a57ddd120d05 Mon Sep 17 00:00:00 2001
From: changsongd <101151583+changsongd@users.noreply.github.com>
Date: Fri, 8 Apr 2022 09:39:27 -0700
Subject: [PATCH 07/13] docs: add async api code snippet (#25)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* docs: add async api code snippet
* fix lint
* fix lint
* use dataformat
* fix import order
* rename to inputUri
* add pom
* update gitignore
* add pom in snapshot and install-without-bom
* add indentation
* reduce buckeet name length
* 🦉 Updates from OwlBot post-processor
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
* rm region tag in test
Co-authored-by: Owl Bot
---
README.md | 9 ++
samples/install-without-bom/pom.xml | 8 +-
samples/pom.xml | 4 +-
samples/snapshot/pom.xml | 7 +-
samples/snippets/pom.xml | 31 +++++--
.../com/example/optimizationai/AsyncApi.java | 85 +++++++++++++++++
.../example/optimizationai/AsyncApiTest.java | 93 +++++++++++++++++++
7 files changed, 226 insertions(+), 11 deletions(-)
create mode 100644 samples/snippets/src/main/java/com/example/optimizationai/AsyncApi.java
create mode 100644 samples/snippets/src/test/java/com/example/optimizationai/AsyncApiTest.java
diff --git a/README.md b/README.md
index c284101..555c43d 100644
--- a/README.md
+++ b/README.md
@@ -73,6 +73,15 @@ use this Cloud Fleet Routing Client Library.
+## Samples
+
+Samples are in the [`samples/`](https://github.com/googleapis/java-optimization/tree/main/samples) directory.
+
+| Sample | Source Code | Try it |
+| --------------------------- | --------------------------------- | ------ |
+| Async Api | [source code](https://github.com/googleapis/java-optimization/blob/main/samples/snippets/src/main/java/com/example/optimizationai/AsyncApi.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-optimization&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/optimizationai/AsyncApi.java) |
+
+
## Troubleshooting
diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml
index 1ba7f30..9119592 100644
--- a/samples/install-without-bom/pom.xml
+++ b/samples/install-without-bom/pom.xml
@@ -32,7 +32,11 @@
0.1.1
-
+
+ com.google.cloud
+ google-cloud-storage
+ 2.6.0
+
junit
junit
@@ -81,4 +85,4 @@
-
+
\ No newline at end of file
diff --git a/samples/pom.xml b/samples/pom.xml
index 1ac0e01..bfb97b8 100644
--- a/samples/pom.xml
+++ b/samples/pom.xml
@@ -3,7 +3,7 @@
4.0.0
com.google.cloud
google-cloud--samples
- 0.0.1-SNAPSHOT
+ 0.0.1-SNAPSHOT
pom
Google Cloud Fleet Routing Samples Parent
https://github.com/googleapis/java-optimization
@@ -53,4 +53,4 @@
-
+
\ No newline at end of file
diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml
index 1f67e12..8a7fac1 100644
--- a/samples/snapshot/pom.xml
+++ b/samples/snapshot/pom.xml
@@ -32,6 +32,11 @@
+
+ com.google.cloud
+ google-cloud-storage
+ 2.6.0
+
junit
junit
@@ -80,4 +85,4 @@
-
+
\ No newline at end of file
diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml
index dae97ee..b843131 100644
--- a/samples/snippets/pom.xml
+++ b/samples/snippets/pom.xml
@@ -2,10 +2,13 @@
4.0.0
com.google.cloud
- -snippets
- jar
- Google Cloud Fleet Routing Snippets
+ optimization-ai-snippets
+ pom
+ Google Cloud Fleet Routing Samples Parent
https://github.com/googleapis/java-optimization
+
+ Java idiomatic client for Google Cloud Platform services.
+
+
+
+
+ com.google.cloud
+ libraries-bom
+ 25.1.0
+ pom
+ import
+
+
+
+
-
com.google.cloud
google-cloud-optimization
0.1.1
-
+
+
+ com.google.cloud
+ google-cloud-storage
+
junit
junit
@@ -44,4 +63,4 @@
test
-
+
\ No newline at end of file
diff --git a/samples/snippets/src/main/java/com/example/optimizationai/AsyncApi.java b/samples/snippets/src/main/java/com/example/optimizationai/AsyncApi.java
new file mode 100644
index 0000000..97430d3
--- /dev/null
+++ b/samples/snippets/src/main/java/com/example/optimizationai/AsyncApi.java
@@ -0,0 +1,85 @@
+/*
+ * 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.
+ */
+
+package com.optimizationai;
+
+// [START cloudoptimization_async_api]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.optimization.v1.AsyncModelMetadata;
+import com.google.cloud.optimization.v1.BatchOptimizeToursRequest;
+import com.google.cloud.optimization.v1.BatchOptimizeToursRequest.AsyncModelConfig;
+import com.google.cloud.optimization.v1.BatchOptimizeToursResponse;
+import com.google.cloud.optimization.v1.DataFormat;
+import com.google.cloud.optimization.v1.FleetRoutingClient;
+import com.google.cloud.optimization.v1.GcsDestination;
+import com.google.cloud.optimization.v1.GcsSource;
+import com.google.cloud.optimization.v1.InputConfig;
+import com.google.cloud.optimization.v1.OutputConfig;
+
+/**
+ * This is an example to send a request to Cloud Fleet Routing asynchronous API via Java API Client.
+ * A sample async_request_java.textproto file and a sample request_model_java.json file can be found
+ * in the resources folder.
+ */
+public class AsyncApi {
+ public static void callAsyncApi() throws Exception {
+ // TODO(developer): Replace these variables before running the sample.
+ String projectParent = "projects/{YOUR_GCP_PROJECT_ID}";
+ String inputUri = "gs://YOUR_GCS_PATH";
+ String outputUri = "gs://YOUR_SOLUTION_PATH";
+ callAsyncApi(projectParent, inputUri, outputUri);
+ }
+
+ public static void callAsyncApi(String projectParent, String inputUri, String outputUri)
+ throws Exception {
+ GcsSource gcsSource = GcsSource.newBuilder().setUri(inputUri).build();
+ InputConfig inputConfig =
+ InputConfig.newBuilder().setGcsSource(gcsSource).setDataFormat(DataFormat.JSON).build();
+ GcsDestination gcsDestination = GcsDestination.newBuilder().setUri(outputUri).build();
+ OutputConfig outputConfig =
+ OutputConfig.newBuilder()
+ .setGcsDestination(gcsDestination)
+ .setDataFormat(DataFormat.JSON)
+ .build();
+
+ AsyncModelConfig asyncModelConfig =
+ AsyncModelConfig.newBuilder()
+ .setInputConfig(inputConfig)
+ .setOutputConfig(outputConfig)
+ .build();
+ BatchOptimizeToursRequest request =
+ BatchOptimizeToursRequest.newBuilder()
+ .setParent(projectParent)
+ .addModelConfigs(asyncModelConfig)
+ .build();
+
+ FleetRoutingClient fleetRoutingClient = FleetRoutingClient.create();
+ OperationFuture response =
+ fleetRoutingClient.batchOptimizeToursAsync(request);
+ System.out.format("the response name: %s\n", response.getInitialFuture().get().getName());
+
+ // Block to wait for the job to finish.
+ response.getPollingFuture().get();
+ if (response.getMetadata().get().getState() == AsyncModelMetadata.State.SUCCEEDED) {
+ // Code to do your stuff
+ System.out.println("Job finished successfully.");
+ } else {
+ System.out.println(
+ "Job failed with message:" + response.getPollingFuture().get().getErrorMessage());
+ }
+ }
+}
+// [END cloudoptimization_async_api]
diff --git a/samples/snippets/src/test/java/com/example/optimizationai/AsyncApiTest.java b/samples/snippets/src/test/java/com/example/optimizationai/AsyncApiTest.java
new file mode 100644
index 0000000..058b46a
--- /dev/null
+++ b/samples/snippets/src/test/java/com/example/optimizationai/AsyncApiTest.java
@@ -0,0 +1,93 @@
+/*
+ * 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.
+ */
+
+package com.optimizationai;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import com.google.api.gax.paging.Page;
+import com.google.cloud.storage.Blob;
+import com.google.cloud.storage.BucketInfo;
+import com.google.cloud.storage.Storage;
+import com.google.cloud.storage.StorageOptions;
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+import java.util.UUID;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/** Tests for AsyncApi sample. */
+public class AsyncApiTest {
+ private static final String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT");
+ private static final String PROJECT_PARENT = String.format("projects/%s", PROJECT_ID);
+ private static final String BUCKET_NAME =
+ String.format("optimizationai-test-%s", UUID.randomUUID());
+ private static final String INPUT_URI =
+ "gs://cloud-samples-data/optimization-ai/async_request_model.json";
+ private static final String BATCH_OUTPUT_URI =
+ String.format("gs://%s/code_snippets_test_output.json", BUCKET_NAME);
+
+ private ByteArrayOutputStream bout;
+ private PrintStream out;
+ private PrintStream originalPrintStream;
+
+ private static void cleanUpBucket() {
+ Storage storage = StorageOptions.getDefaultInstance().getService();
+ Page blobs = storage.list(BUCKET_NAME, Storage.BlobListOption.currentDirectory());
+
+ deleteDirectory(storage, blobs);
+ }
+
+ private static void deleteDirectory(Storage storage, Page blobs) {
+ for (Blob blob : blobs.iterateAll()) {
+ if (!blob.delete()) {
+ Page subBlobs =
+ storage.list(
+ BUCKET_NAME,
+ Storage.BlobListOption.currentDirectory(),
+ Storage.BlobListOption.prefix(blob.getName()));
+
+ deleteDirectory(storage, subBlobs);
+ }
+ }
+ }
+
+ @Before
+ public void setUp() {
+ bout = new ByteArrayOutputStream();
+ out = new PrintStream(bout);
+ originalPrintStream = System.out;
+ System.setOut(out);
+
+ Storage storage = StorageOptions.getDefaultInstance().getService();
+ storage.create(BucketInfo.of(BUCKET_NAME));
+ }
+
+ @After
+ public void tearDown() {
+ cleanUpBucket();
+ System.out.flush();
+ System.setOut(originalPrintStream);
+ }
+
+ @Test
+ public void testAsyncApi() throws Exception {
+ AsyncApi.callAsyncApi(PROJECT_PARENT, INPUT_URI, BATCH_OUTPUT_URI);
+ String got = bout.toString();
+ assertThat(got).contains("Job");
+ }
+}
From 4dc1dd8072e41823751a01904c56cf8a0dc41978 Mon Sep 17 00:00:00 2001
From: changsongd <101151583+changsongd@users.noreply.github.com>
Date: Fri, 8 Apr 2022 10:30:12 -0700
Subject: [PATCH 08/13] docs: add a code snippet for the sync api (#24)
* Added a sync api code snippet
---
README.md | 1 +
.../resources/sync_request.textproto | 64 +++++++++++++++++++
.../snapshot/resources/sync_request.textproto | 64 +++++++++++++++++++
samples/snippets/pom.xml | 3 +-
.../snippets/resources/sync_request.textproto | 64 +++++++++++++++++++
.../com/example/optimizationai/SyncApi.java | 57 +++++++++++++++++
.../example/optimizationai/SyncApiTest.java | 57 +++++++++++++++++
7 files changed, 308 insertions(+), 2 deletions(-)
create mode 100644 samples/install-without-bom/resources/sync_request.textproto
create mode 100644 samples/snapshot/resources/sync_request.textproto
create mode 100644 samples/snippets/resources/sync_request.textproto
create mode 100644 samples/snippets/src/main/java/com/example/optimizationai/SyncApi.java
create mode 100644 samples/snippets/src/test/java/com/example/optimizationai/SyncApiTest.java
diff --git a/README.md b/README.md
index 555c43d..6a77641 100644
--- a/README.md
+++ b/README.md
@@ -80,6 +80,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/java-optimization/
| Sample | Source Code | Try it |
| --------------------------- | --------------------------------- | ------ |
| Async Api | [source code](https://github.com/googleapis/java-optimization/blob/main/samples/snippets/src/main/java/com/example/optimizationai/AsyncApi.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-optimization&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/optimizationai/AsyncApi.java) |
+| Sync Api | [source code](https://github.com/googleapis/java-optimization/blob/main/samples/snippets/src/main/java/com/example/optimizationai/SyncApi.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-optimization&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/optimizationai/SyncApi.java) |
diff --git a/samples/install-without-bom/resources/sync_request.textproto b/samples/install-without-bom/resources/sync_request.textproto
new file mode 100644
index 0000000..d1026f9
--- /dev/null
+++ b/samples/install-without-bom/resources/sync_request.textproto
@@ -0,0 +1,64 @@
+# proto-file: google3/google/cloud/optimization/v1/fleet_routing.proto
+# proto-message: OptimizeToursRequest
+model {
+ shipments {
+ pickups {
+ arrival_location { latitude: 48.874507 longitude: 2.30361 }
+ time_windows {
+ start_time { seconds: 1000 }
+ end_time { seconds: 2000 }
+ }
+ duration { seconds: 150 }
+ }
+ deliveries {
+ arrival_location { latitude: 48.880942 longitude: 2.323866 }
+ time_windows {
+ start_time { seconds: 3000 }
+ end_time { seconds: 4000 }
+ }
+ duration: { seconds: 250 }
+ }
+ load_demands {
+ key: "weight"
+ value: { amount: 10 }
+ }
+ }
+ shipments {
+ pickups {
+ arrival_location { latitude: 48.880943 longitude: 2.323867 }
+ time_windows {
+ start_time { seconds: 1001 }
+ end_time { seconds: 2001 }
+ }
+ duration { seconds: 151 }
+ }
+ deliveries {
+ arrival_location { latitude: 48.880940 longitude: 2.323844 }
+ time_windows {
+ start_time { seconds: 3001 }
+ end_time { seconds: 4001 }
+ }
+ duration { seconds: 251 }
+ }
+ load_demands {
+ key: "weight"
+ value: { amount: 20 }
+ }
+ }
+ vehicles {
+ start_location { latitude: 48.863102 longitude: 2.341204 }
+ end_location { latitude: 48.863110 longitude: 2.341205 }
+ load_limits {
+ key: "weight"
+ value: { max_load: 50 }
+ }
+ }
+ vehicles {
+ start_location { latitude: 48.863112 longitude: 2.341214 }
+ end_location { latitude: 48.863120 longitude: 2.341215 }
+ load_limits {
+ key: "weight"
+ value: { max_load: 60 }
+ }
+ }
+ }
\ No newline at end of file
diff --git a/samples/snapshot/resources/sync_request.textproto b/samples/snapshot/resources/sync_request.textproto
new file mode 100644
index 0000000..d1026f9
--- /dev/null
+++ b/samples/snapshot/resources/sync_request.textproto
@@ -0,0 +1,64 @@
+# proto-file: google3/google/cloud/optimization/v1/fleet_routing.proto
+# proto-message: OptimizeToursRequest
+model {
+ shipments {
+ pickups {
+ arrival_location { latitude: 48.874507 longitude: 2.30361 }
+ time_windows {
+ start_time { seconds: 1000 }
+ end_time { seconds: 2000 }
+ }
+ duration { seconds: 150 }
+ }
+ deliveries {
+ arrival_location { latitude: 48.880942 longitude: 2.323866 }
+ time_windows {
+ start_time { seconds: 3000 }
+ end_time { seconds: 4000 }
+ }
+ duration: { seconds: 250 }
+ }
+ load_demands {
+ key: "weight"
+ value: { amount: 10 }
+ }
+ }
+ shipments {
+ pickups {
+ arrival_location { latitude: 48.880943 longitude: 2.323867 }
+ time_windows {
+ start_time { seconds: 1001 }
+ end_time { seconds: 2001 }
+ }
+ duration { seconds: 151 }
+ }
+ deliveries {
+ arrival_location { latitude: 48.880940 longitude: 2.323844 }
+ time_windows {
+ start_time { seconds: 3001 }
+ end_time { seconds: 4001 }
+ }
+ duration { seconds: 251 }
+ }
+ load_demands {
+ key: "weight"
+ value: { amount: 20 }
+ }
+ }
+ vehicles {
+ start_location { latitude: 48.863102 longitude: 2.341204 }
+ end_location { latitude: 48.863110 longitude: 2.341205 }
+ load_limits {
+ key: "weight"
+ value: { max_load: 50 }
+ }
+ }
+ vehicles {
+ start_location { latitude: 48.863112 longitude: 2.341214 }
+ end_location { latitude: 48.863120 longitude: 2.341215 }
+ load_limits {
+ key: "weight"
+ value: { max_load: 60 }
+ }
+ }
+ }
\ No newline at end of file
diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml
index b843131..06cfa0f 100644
--- a/samples/snippets/pom.xml
+++ b/samples/snippets/pom.xml
@@ -26,7 +26,7 @@
UTF-8
-
+
@@ -45,7 +45,6 @@
google-cloud-optimization
0.1.1
-
com.google.cloud
google-cloud-storage
diff --git a/samples/snippets/resources/sync_request.textproto b/samples/snippets/resources/sync_request.textproto
new file mode 100644
index 0000000..d1026f9
--- /dev/null
+++ b/samples/snippets/resources/sync_request.textproto
@@ -0,0 +1,64 @@
+# proto-file: google3/google/cloud/optimization/v1/fleet_routing.proto
+# proto-message: OptimizeToursRequest
+model {
+ shipments {
+ pickups {
+ arrival_location { latitude: 48.874507 longitude: 2.30361 }
+ time_windows {
+ start_time { seconds: 1000 }
+ end_time { seconds: 2000 }
+ }
+ duration { seconds: 150 }
+ }
+ deliveries {
+ arrival_location { latitude: 48.880942 longitude: 2.323866 }
+ time_windows {
+ start_time { seconds: 3000 }
+ end_time { seconds: 4000 }
+ }
+ duration: { seconds: 250 }
+ }
+ load_demands {
+ key: "weight"
+ value: { amount: 10 }
+ }
+ }
+ shipments {
+ pickups {
+ arrival_location { latitude: 48.880943 longitude: 2.323867 }
+ time_windows {
+ start_time { seconds: 1001 }
+ end_time { seconds: 2001 }
+ }
+ duration { seconds: 151 }
+ }
+ deliveries {
+ arrival_location { latitude: 48.880940 longitude: 2.323844 }
+ time_windows {
+ start_time { seconds: 3001 }
+ end_time { seconds: 4001 }
+ }
+ duration { seconds: 251 }
+ }
+ load_demands {
+ key: "weight"
+ value: { amount: 20 }
+ }
+ }
+ vehicles {
+ start_location { latitude: 48.863102 longitude: 2.341204 }
+ end_location { latitude: 48.863110 longitude: 2.341205 }
+ load_limits {
+ key: "weight"
+ value: { max_load: 50 }
+ }
+ }
+ vehicles {
+ start_location { latitude: 48.863112 longitude: 2.341214 }
+ end_location { latitude: 48.863120 longitude: 2.341215 }
+ load_limits {
+ key: "weight"
+ value: { max_load: 60 }
+ }
+ }
+ }
\ No newline at end of file
diff --git a/samples/snippets/src/main/java/com/example/optimizationai/SyncApi.java b/samples/snippets/src/main/java/com/example/optimizationai/SyncApi.java
new file mode 100644
index 0000000..5e73344
--- /dev/null
+++ b/samples/snippets/src/main/java/com/example/optimizationai/SyncApi.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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.optimizationai;
+
+// [START cloudoptimization_sync_api]
+
+import com.google.cloud.optimization.v1.FleetRoutingClient;
+import com.google.cloud.optimization.v1.OptimizeToursRequest;
+import com.google.cloud.optimization.v1.OptimizeToursResponse;
+import com.google.protobuf.Duration;
+import com.google.protobuf.TextFormat;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+
+/**
+ * This is an example to send a request to Cloud Fleet Routing synchronous API via Java API Client.
+ * A sample sync_request.textproto file can be found in the resources folder.
+ */
+public class SyncApi {
+ public static void callSyncApi() throws Exception {
+ // TODO(developer): Replace these variables before running the sample.
+ String projectParent = "projects/{YOUR_GCP_PROJECT_ID}";
+ String modelPath = "YOUR_MODEL_PATH";
+ callSyncApi(projectParent, modelPath);
+ }
+
+ public static void callSyncApi(String projectParent, String modelPath) throws Exception {
+ int timeoutSeconds = 100;
+ InputStream modelInputstream = new FileInputStream(modelPath);
+ Reader modelInputStreamReader = new InputStreamReader(modelInputstream);
+ OptimizeToursRequest.Builder requestBuilder =
+ OptimizeToursRequest.newBuilder()
+ .setTimeout(Duration.newBuilder().setSeconds(timeoutSeconds).build())
+ .setParent(projectParent);
+ TextFormat.getParser().merge(modelInputStreamReader, requestBuilder);
+ FleetRoutingClient fleetRoutingClient = FleetRoutingClient.create();
+ OptimizeToursResponse response = fleetRoutingClient.optimizeTours(requestBuilder.build());
+ System.out.println(response.toString());
+ }
+}
+// [END cloudoptimization_sync_api]
diff --git a/samples/snippets/src/test/java/com/example/optimizationai/SyncApiTest.java b/samples/snippets/src/test/java/com/example/optimizationai/SyncApiTest.java
new file mode 100644
index 0000000..e663a92
--- /dev/null
+++ b/samples/snippets/src/test/java/com/example/optimizationai/SyncApiTest.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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.optimizationai;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/** Tests for SyncApi sample. */
+public class SyncApiTest {
+ private static final String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT");
+ private static final String PROJECT_PARENT = String.format("projects/%s", PROJECT_ID);
+ private static final String MODEL_PATH = "resources/sync_request.textproto";
+
+ private ByteArrayOutputStream bout;
+ private PrintStream out;
+ private PrintStream originalPrintStream;
+
+ @Before
+ public void setUp() {
+ bout = new ByteArrayOutputStream();
+ out = new PrintStream(bout);
+ originalPrintStream = System.out;
+ System.setOut(out);
+ }
+
+ @After
+ public void tearDown() {
+ System.out.flush();
+ System.setOut(originalPrintStream);
+ }
+
+ @Test
+ public void testSyncApi() throws Exception {
+ SyncApi.callSyncApi(PROJECT_PARENT, MODEL_PATH);
+ String got = bout.toString();
+ assertThat(got).contains("routes");
+ }
+}
From bf07a2f3d7bbd8b51874b08847ac812a527da768 Mon Sep 17 00:00:00 2001
From: changsongd <101151583+changsongd@users.noreply.github.com>
Date: Mon, 11 Apr 2022 14:12:38 -0700
Subject: [PATCH 09/13] samples: add long timeout sample (#27)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* docs: add long timeout sample
* fix lint
* rm unused variable
* fix package
* 🦉 Updates from OwlBot post-processor
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
Co-authored-by: Owl Bot
---
README.md | 1 +
.../SyncApiWithLongTimeout.java | 66 +++++++++++++++++++
.../SyncApiWithLongTimeoutTest.java | 57 ++++++++++++++++
3 files changed, 124 insertions(+)
create mode 100644 samples/snippets/src/main/java/com/example/optimizationai/SyncApiWithLongTimeout.java
create mode 100644 samples/snippets/src/test/java/com/example/optimizationai/SyncApiWithLongTimeoutTest.java
diff --git a/README.md b/README.md
index 6a77641..7e99721 100644
--- a/README.md
+++ b/README.md
@@ -81,6 +81,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/java-optimization/
| --------------------------- | --------------------------------- | ------ |
| Async Api | [source code](https://github.com/googleapis/java-optimization/blob/main/samples/snippets/src/main/java/com/example/optimizationai/AsyncApi.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-optimization&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/optimizationai/AsyncApi.java) |
| Sync Api | [source code](https://github.com/googleapis/java-optimization/blob/main/samples/snippets/src/main/java/com/example/optimizationai/SyncApi.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-optimization&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/optimizationai/SyncApi.java) |
+| Sync Api With Long Timeout | [source code](https://github.com/googleapis/java-optimization/blob/main/samples/snippets/src/main/java/com/example/optimizationai/SyncApiWithLongTimeout.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-optimization&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/optimizationai/SyncApiWithLongTimeout.java) |
diff --git a/samples/snippets/src/main/java/com/example/optimizationai/SyncApiWithLongTimeout.java b/samples/snippets/src/main/java/com/example/optimizationai/SyncApiWithLongTimeout.java
new file mode 100644
index 0000000..152fd08
--- /dev/null
+++ b/samples/snippets/src/main/java/com/example/optimizationai/SyncApiWithLongTimeout.java
@@ -0,0 +1,66 @@
+/*
+ * 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.
+ */
+
+package com.example.optimizationai;
+
+// [START cloudoptimization_long_timeout]
+
+import com.google.cloud.optimization.v1.FleetRoutingClient;
+import com.google.cloud.optimization.v1.FleetRoutingSettings;
+import com.google.cloud.optimization.v1.OptimizeToursRequest;
+import com.google.cloud.optimization.v1.OptimizeToursResponse;
+import com.google.protobuf.Duration;
+import com.google.protobuf.TextFormat;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+
+/**
+ * This is an example to send a request to Cloud Fleet Routing synchronous API via Java API Client.
+ */
+public class SyncApiWithLongTimeout {
+ public static void longTimeout() throws Exception {
+ // TODO(developer): Replace these variables before running the sample.
+ String projectParent = "projects/{YOUR_GCP_PROJECT_ID}";
+ String modelPath = "YOUR_MODEL_PATH";
+ longTimeout(projectParent, modelPath);
+ }
+
+ public static void longTimeout(String projectParent, String modelPath) throws Exception {
+ int timeoutSeconds = 100;
+ InputStream modelInputstream = new FileInputStream(modelPath);
+ Reader modelInputStreamReader = new InputStreamReader(modelInputstream);
+ OptimizeToursRequest.Builder requestBuilder =
+ OptimizeToursRequest.newBuilder()
+ .setTimeout(Duration.newBuilder().setSeconds(timeoutSeconds).build())
+ .setParent(projectParent);
+ TextFormat.getParser().merge(modelInputStreamReader, requestBuilder);
+
+ // Checks the gRPC connection every 5 mins and keeps it alive.
+ FleetRoutingClient fleetRoutingClientClient =
+ FleetRoutingClient.create(
+ FleetRoutingSettings.newBuilder()
+ .setTransportChannelProvider(
+ FleetRoutingSettings.defaultGrpcTransportProviderBuilder()
+ .setKeepAliveTime(org.threeten.bp.Duration.ofSeconds(300))
+ .build())
+ .build());
+ OptimizeToursResponse response = fleetRoutingClientClient.optimizeTours(requestBuilder.build());
+ System.out.println(response.toString());
+ }
+}
+// [END cloudoptimization_long_timeout]
diff --git a/samples/snippets/src/test/java/com/example/optimizationai/SyncApiWithLongTimeoutTest.java b/samples/snippets/src/test/java/com/example/optimizationai/SyncApiWithLongTimeoutTest.java
new file mode 100644
index 0000000..0dc7b11
--- /dev/null
+++ b/samples/snippets/src/test/java/com/example/optimizationai/SyncApiWithLongTimeoutTest.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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.optimizationai;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/** Tests for SyncApiWithLongTimeout sample. */
+public class SyncApiWithLongTimeoutTest {
+ private static final String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT");
+ private static final String PROJECT_PARENT = String.format("projects/%s", PROJECT_ID);
+ private static final String MODEL_PATH = "resources/sync_request.textproto";
+
+ private ByteArrayOutputStream bout;
+ private PrintStream out;
+ private PrintStream originalPrintStream;
+
+ @Before
+ public void setUp() {
+ bout = new ByteArrayOutputStream();
+ out = new PrintStream(bout);
+ originalPrintStream = System.out;
+ System.setOut(out);
+ }
+
+ @After
+ public void tearDown() {
+ System.out.flush();
+ System.setOut(originalPrintStream);
+ }
+
+ @Test
+ public void testSyncApi() throws Exception {
+ SyncApiWithLongTimeout.longTimeout(PROJECT_PARENT, MODEL_PATH);
+ String got = bout.toString();
+ assertThat(got).contains("routes");
+ }
+}
From 9f23fe2b38291764c95909a8fa6e65ef4f7d8711 Mon Sep 17 00:00:00 2001
From: changsongd <101151583+changsongd@users.noreply.github.com>
Date: Tue, 12 Apr 2022 09:56:39 -0700
Subject: [PATCH 10/13] docs: add get operation code snippet (#28)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* docs: add get operation code snippet
* add batch import
* fix int
* fix lint
* fix import
* rename method
* add operation import
* fix symbol
* add multiline
* 🦉 Updates from OwlBot post-processor
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
Co-authored-by: Owl Bot
---
README.md | 1 +
.../example/optimizationai/GetOperation.java | 57 ++++++++++++++++
.../optimizationai/GetOperationTest.java | 67 +++++++++++++++++++
3 files changed, 125 insertions(+)
create mode 100644 samples/snippets/src/main/java/com/example/optimizationai/GetOperation.java
create mode 100644 samples/snippets/src/test/java/com/example/optimizationai/GetOperationTest.java
diff --git a/README.md b/README.md
index 7e99721..144d88c 100644
--- a/README.md
+++ b/README.md
@@ -80,6 +80,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/java-optimization/
| Sample | Source Code | Try it |
| --------------------------- | --------------------------------- | ------ |
| Async Api | [source code](https://github.com/googleapis/java-optimization/blob/main/samples/snippets/src/main/java/com/example/optimizationai/AsyncApi.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-optimization&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/optimizationai/AsyncApi.java) |
+| Get Operation | [source code](https://github.com/googleapis/java-optimization/blob/main/samples/snippets/src/main/java/com/example/optimizationai/GetOperation.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-optimization&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/optimizationai/GetOperation.java) |
| Sync Api | [source code](https://github.com/googleapis/java-optimization/blob/main/samples/snippets/src/main/java/com/example/optimizationai/SyncApi.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-optimization&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/optimizationai/SyncApi.java) |
| Sync Api With Long Timeout | [source code](https://github.com/googleapis/java-optimization/blob/main/samples/snippets/src/main/java/com/example/optimizationai/SyncApiWithLongTimeout.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-optimization&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/optimizationai/SyncApiWithLongTimeout.java) |
diff --git a/samples/snippets/src/main/java/com/example/optimizationai/GetOperation.java b/samples/snippets/src/main/java/com/example/optimizationai/GetOperation.java
new file mode 100644
index 0000000..6a6e8fd
--- /dev/null
+++ b/samples/snippets/src/main/java/com/example/optimizationai/GetOperation.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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.optimizationai;
+
+// [START cloudoptimization_get_operation]
+import com.google.cloud.optimization.v1.FleetRoutingClient;
+import com.google.longrunning.Operation;
+import java.io.IOException;
+
+class GetOperation {
+
+ static void getOperation() throws IOException {
+ // TODO(developer): Replace these variables before running the sample.
+ String operationFullId = "projects/[projectId]/operations/[operationId]";
+ getOperation(operationFullId);
+ }
+
+ // Get the status of an operation
+ static void getOperation(String operationFullId) throws IOException {
+ // Initialize client that will be used to send requests. This client only needs to be created
+ // once, and can be reused for multiple requests. After completing all of your requests, call
+ // the "close" method on the client to safely clean up any remaining background resources.
+ try (FleetRoutingClient client = FleetRoutingClient.create()) {
+ // Get the latest state of a long-running operation.
+ Operation operation = client.getOperationsClient().getOperation(operationFullId);
+
+ // Display operation details.
+ System.out.println("Operation details:");
+ System.out.format("\tName: %s\n", operation.getName());
+ System.out.format("\tMetadata Type Url: %s\n", operation.getMetadata().getTypeUrl());
+ System.out.format("\tDone: %s\n", operation.getDone());
+ if (operation.hasResponse()) {
+ System.out.format("\tResponse Type Url: %s\n", operation.getResponse().getTypeUrl());
+ }
+ if (operation.hasError()) {
+ System.out.println("\tResponse:");
+ System.out.format("\t\tError code: %s\n", operation.getError().getCode());
+ System.out.format("\t\tError message: %s\n", operation.getError().getMessage());
+ }
+ }
+ }
+}
+// [END cloudoptimization_get_operation]
diff --git a/samples/snippets/src/test/java/com/example/optimizationai/GetOperationTest.java b/samples/snippets/src/test/java/com/example/optimizationai/GetOperationTest.java
new file mode 100644
index 0000000..32ef2cb
--- /dev/null
+++ b/samples/snippets/src/test/java/com/example/optimizationai/GetOperationTest.java
@@ -0,0 +1,67 @@
+/*
+ * 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.
+ */
+
+package com.example.optimizationai;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.optimization.v1.AsyncModelMetadata;
+import com.google.cloud.optimization.v1.BatchOptimizeToursRequest;
+import com.google.cloud.optimization.v1.BatchOptimizeToursResponse;
+import com.google.cloud.optimization.v1.FleetRoutingClient;
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/** Tests for GetOperation sample. */
+public class GetOperationTest {
+ private static final String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT");
+ private static final String PROJECT_PARENT = String.format("projects/%s", PROJECT_ID);
+
+ private ByteArrayOutputStream bout;
+ private PrintStream out;
+ private PrintStream originalPrintStream;
+
+ @Before
+ public void setUp() {
+ bout = new ByteArrayOutputStream();
+ out = new PrintStream(bout);
+ originalPrintStream = System.out;
+ System.setOut(out);
+ }
+
+ @After
+ public void tearDown() {
+ System.out.flush();
+ System.setOut(originalPrintStream);
+ }
+
+ @Test
+ public void testSyncApi() throws Exception {
+ FleetRoutingClient fleetRoutingClient = FleetRoutingClient.create();
+ BatchOptimizeToursRequest request =
+ BatchOptimizeToursRequest.newBuilder().setParent(PROJECT_PARENT).build();
+ OperationFuture response =
+ fleetRoutingClient.batchOptimizeToursAsync(request);
+
+ GetOperation.getOperation(response.getInitialFuture().get().getName());
+ String got = bout.toString();
+ assertThat(got).contains("operations");
+ }
+}
From 4db5464b2d11f45d568fd598b318f24240d2e61d Mon Sep 17 00:00:00 2001
From: WhiteSource Renovate
Date: Fri, 15 Apr 2022 21:32:11 +0200
Subject: [PATCH 11/13] deps: update dependency
com.google.cloud:google-cloud-shared-dependencies to v2.10.0 (#29)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[](https://renovatebot.com)
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/java-shared-dependencies) | `2.9.0` -> `2.10.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) |
---
### Release Notes
googleapis/java-shared-dependencies
### [`v2.10.0`](https://togithub.com/googleapis/java-shared-dependencies/blob/HEAD/CHANGELOG.md#2100-httpsgithubcomgoogleapisjava-shared-dependenciescomparev290v2100-2022-04-15)
[Compare Source](https://togithub.com/googleapis/java-shared-dependencies/compare/v2.9.0...v2.10.0)
##### Dependencies
- google-cloud-core 2.6.0 ([#668](https://togithub.com/googleapis/java-shared-dependencies/issues/668)) ([22f4d18](https://togithub.com/googleapis/java-shared-dependencies/commit/22f4d1809cbb9848174b3569ab527e4bef00d443))
- reverting protobuf to 3.19.4 ([#657](https://togithub.com/googleapis/java-shared-dependencies/issues/657)) ([8501e6d](https://togithub.com/googleapis/java-shared-dependencies/commit/8501e6d842c10d2370bbd5d5246070134336bddd))
- update dependency com.fasterxml.jackson:jackson-bom to v2.13.2.20220328 ([#646](https://togithub.com/googleapis/java-shared-dependencies/issues/646)) ([7bfd6d7](https://togithub.com/googleapis/java-shared-dependencies/commit/7bfd6d7073859d1955b91b368c6713a72ffa14b6))
- update dependency com.google.api-client:google-api-client-bom to v1.34.0 ([#662](https://togithub.com/googleapis/java-shared-dependencies/issues/662)) ([1b8e378](https://togithub.com/googleapis/java-shared-dependencies/commit/1b8e378fe0ccf2a28c759868caaf5ba593a95728))
- update dependency com.google.errorprone:error_prone_annotations to v2.12.1 ([#652](https://togithub.com/googleapis/java-shared-dependencies/issues/652)) ([1cc80ee](https://togithub.com/googleapis/java-shared-dependencies/commit/1cc80ee984ebcad9bc2a95e2f28c0a49fe924b37))
- update dependency com.google.errorprone:error_prone_annotations to v2.13.0 ([#669](https://togithub.com/googleapis/java-shared-dependencies/issues/669)) ([61b7834](https://togithub.com/googleapis/java-shared-dependencies/commit/61b78341b34a251722be4805a6bdd895cd64836c))
- update dependency com.google.http-client:google-http-client-bom to v1.41.6 ([#654](https://togithub.com/googleapis/java-shared-dependencies/issues/654)) ([140ef40](https://togithub.com/googleapis/java-shared-dependencies/commit/140ef405bc17ed83f5ce177df59affca14fbe49c))
- update dependency com.google.http-client:google-http-client-bom to v1.41.7 ([#658](https://togithub.com/googleapis/java-shared-dependencies/issues/658)) ([f6f93e5](https://togithub.com/googleapis/java-shared-dependencies/commit/f6f93e5b9172c9684623c4c148e4a8fe2fae1e94))
- update dependency com.google.oauth-client:google-oauth-client-bom to v1.33.2 ([#655](https://togithub.com/googleapis/java-shared-dependencies/issues/655)) ([20cd9ed](https://togithub.com/googleapis/java-shared-dependencies/commit/20cd9eda112c96836a5ab7485a4247ed2bc0edb8))
- update dependency com.google.oauth-client:google-oauth-client-bom to v1.33.3 ([#663](https://togithub.com/googleapis/java-shared-dependencies/issues/663)) ([f011a46](https://togithub.com/googleapis/java-shared-dependencies/commit/f011a46c551dba16851b4f8c919c40452fc5d5c3))
- update dependency com.google.protobuf:protobuf-bom to v3.20.0 ([#651](https://togithub.com/googleapis/java-shared-dependencies/issues/651)) ([ad2ff73](https://togithub.com/googleapis/java-shared-dependencies/commit/ad2ff73207dd6493321c77d8eca0022baf13b4ce))
- update dependency io.grpc:grpc-bom to v1.45.1 ([#647](https://togithub.com/googleapis/java-shared-dependencies/issues/647)) ([38e46fc](https://togithub.com/googleapis/java-shared-dependencies/commit/38e46fc4f03af0a02f30ce4a2fa222c71797ae15))
- update dependency org.checkerframework:checker-qual to v3.21.4 ([#650](https://togithub.com/googleapis/java-shared-dependencies/issues/650)) ([125e80a](https://togithub.com/googleapis/java-shared-dependencies/commit/125e80ab2c3225a00c03f5ff5de94872ebb94303))
- update gax.version to v2.15.0 ([#649](https://togithub.com/googleapis/java-shared-dependencies/issues/649)) ([c7f32a6](https://togithub.com/googleapis/java-shared-dependencies/commit/c7f32a68b14520104432282ac9598643700162eb))
- update gax.version to v2.16.0 ([#664](https://togithub.com/googleapis/java-shared-dependencies/issues/664)) ([caaf941](https://togithub.com/googleapis/java-shared-dependencies/commit/caaf941643af04295f5527a0144587d7bf040862))
- update google.common-protos.version to v2.8.1 ([#656](https://togithub.com/googleapis/java-shared-dependencies/issues/656)) ([df4a4a2](https://togithub.com/googleapis/java-shared-dependencies/commit/df4a4a2130a3cdb2965ea42962d1ea6a85506ba7))
- update google.common-protos.version to v2.8.2 ([#659](https://togithub.com/googleapis/java-shared-dependencies/issues/659)) ([b499e2b](https://togithub.com/googleapis/java-shared-dependencies/commit/b499e2bc99506d48d26e35bf6e68c09409ce8b11))
- update google.common-protos.version to v2.8.3 ([#660](https://togithub.com/googleapis/java-shared-dependencies/issues/660)) ([461081c](https://togithub.com/googleapis/java-shared-dependencies/commit/461081c0cf73057c1f6e07fc573453ad467a60ae))
- update iam.version to v1.3.0 ([#648](https://togithub.com/googleapis/java-shared-dependencies/issues/648)) ([6670c4f](https://togithub.com/googleapis/java-shared-dependencies/commit/6670c4f61fcf075c543bfd148eea49796e0662ce))
- update iam.version to v1.3.1 ([#661](https://togithub.com/googleapis/java-shared-dependencies/issues/661)) ([cc8fbe6](https://togithub.com/googleapis/java-shared-dependencies/commit/cc8fbe6eae03341c2ece7d3356febc843a74a812))
---
### Configuration
📅 **Schedule**: At any time (no schedule defined).
🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.
â™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] If you want to rebase/retry this PR, click this checkbox.
---
This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-optimization).
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index a60aa16..6360597 100644
--- a/pom.xml
+++ b/pom.xml
@@ -85,7 +85,7 @@
com.google.cloud
google-cloud-shared-dependencies
- 2.9.0
+ 2.10.0
pom
import
From faf4a156ee95fce53c29c860d120079089329236 Mon Sep 17 00:00:00 2001
From: WhiteSource Renovate
Date: Mon, 18 Apr 2022 23:14:12 +0200
Subject: [PATCH 12/13] deps: update dependency
com.google.cloud:google-cloud-storage to v2.6.1 (#30)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[](https://renovatebot.com)
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:google-cloud-storage](https://togithub.com/googleapis/java-storage) | `2.6.0` -> `2.6.1` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) |
---
### Release Notes
googleapis/java-storage
### [`v2.6.1`](https://togithub.com/googleapis/java-storage/blob/HEAD/CHANGELOG.md#261-httpsgithubcomgoogleapisjava-storagecomparev260v261-2022-04-15)
[Compare Source](https://togithub.com/googleapis/java-storage/compare/v2.6.0...v2.6.1)
---
### Configuration
📅 **Schedule**: At any time (no schedule defined).
🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.
â™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] If you want to rebase/retry this PR, click this checkbox.
---
This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-optimization).
---
samples/install-without-bom/pom.xml | 2 +-
samples/snapshot/pom.xml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml
index 9119592..6d2dbea 100644
--- a/samples/install-without-bom/pom.xml
+++ b/samples/install-without-bom/pom.xml
@@ -35,7 +35,7 @@
com.google.cloud
google-cloud-storage
- 2.6.0
+ 2.6.1
junit
diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml
index 8a7fac1..6bcb23c 100644
--- a/samples/snapshot/pom.xml
+++ b/samples/snapshot/pom.xml
@@ -35,7 +35,7 @@
com.google.cloud
google-cloud-storage
- 2.6.0
+ 2.6.1
junit
From 0691f25447bd301797212917b4742cdbaf23c849 Mon Sep 17 00:00:00 2001
From: "release-please[bot]"
<55107282+release-please[bot]@users.noreply.github.com>
Date: Tue, 19 Apr 2022 18:04:18 +0000
Subject: [PATCH 13/13] chore(main): release 0.1.2 (#26)
:robot: I have created a release *beep* *boop*
---
### [0.1.2](https://github.com/googleapis/java-optimization/compare/v0.1.1...v0.1.2) (2022-04-18)
### Documentation
* add a code snippet for the sync api ([#24](https://github.com/googleapis/java-optimization/issues/24)) ([4dc1dd8](https://github.com/googleapis/java-optimization/commit/4dc1dd8072e41823751a01904c56cf8a0dc41978))
* add async api code snippet ([#25](https://github.com/googleapis/java-optimization/issues/25)) ([fb23c17](https://github.com/googleapis/java-optimization/commit/fb23c17de88919609cff8e1e20d2a57ddd120d05))
* add get operation code snippet ([#28](https://github.com/googleapis/java-optimization/issues/28)) ([9f23fe2](https://github.com/googleapis/java-optimization/commit/9f23fe2b38291764c95909a8fa6e65ef4f7d8711))
### Dependencies
* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.10.0 ([#29](https://github.com/googleapis/java-optimization/issues/29)) ([4db5464](https://github.com/googleapis/java-optimization/commit/4db5464b2d11f45d568fd598b318f24240d2e61d))
* update dependency com.google.cloud:google-cloud-storage to v2.6.1 ([#30](https://github.com/googleapis/java-optimization/issues/30)) ([faf4a15](https://github.com/googleapis/java-optimization/commit/faf4a156ee95fce53c29c860d120079089329236))
---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
---
CHANGELOG.md | 15 +++++++++++++++
google-cloud-optimization-bom/pom.xml | 8 ++++----
google-cloud-optimization/pom.xml | 4 ++--
grpc-google-cloud-optimization-v1/pom.xml | 4 ++--
pom.xml | 8 ++++----
proto-google-cloud-optimization-v1/pom.xml | 4 ++--
samples/snapshot/pom.xml | 2 +-
versions.txt | 6 +++---
8 files changed, 33 insertions(+), 18 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c1ab16d..b70d9b5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,20 @@
# Changelog
+### [0.1.2](https://github.com/googleapis/java-optimization/compare/v0.1.1...v0.1.2) (2022-04-18)
+
+
+### Documentation
+
+* add a code snippet for the sync api ([#24](https://github.com/googleapis/java-optimization/issues/24)) ([4dc1dd8](https://github.com/googleapis/java-optimization/commit/4dc1dd8072e41823751a01904c56cf8a0dc41978))
+* add async api code snippet ([#25](https://github.com/googleapis/java-optimization/issues/25)) ([fb23c17](https://github.com/googleapis/java-optimization/commit/fb23c17de88919609cff8e1e20d2a57ddd120d05))
+* add get operation code snippet ([#28](https://github.com/googleapis/java-optimization/issues/28)) ([9f23fe2](https://github.com/googleapis/java-optimization/commit/9f23fe2b38291764c95909a8fa6e65ef4f7d8711))
+
+
+### Dependencies
+
+* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.10.0 ([#29](https://github.com/googleapis/java-optimization/issues/29)) ([4db5464](https://github.com/googleapis/java-optimization/commit/4db5464b2d11f45d568fd598b318f24240d2e61d))
+* update dependency com.google.cloud:google-cloud-storage to v2.6.1 ([#30](https://github.com/googleapis/java-optimization/issues/30)) ([faf4a15](https://github.com/googleapis/java-optimization/commit/faf4a156ee95fce53c29c860d120079089329236))
+
### [0.1.1](https://github.com/googleapis/java-optimization/compare/v0.1.0...v0.1.1) (2022-03-29)
diff --git a/google-cloud-optimization-bom/pom.xml b/google-cloud-optimization-bom/pom.xml
index 07b45fc..4d3d51e 100644
--- a/google-cloud-optimization-bom/pom.xml
+++ b/google-cloud-optimization-bom/pom.xml
@@ -3,7 +3,7 @@
4.0.0
com.google.cloud
google-cloud-optimization-bom
- 0.1.2-SNAPSHOT
+ 0.1.2
pom
com.google.cloud
@@ -65,17 +65,17 @@
com.google.cloud
google-cloud-optimization
- 0.1.2-SNAPSHOT
+ 0.1.2
com.google.api.grpc
grpc-google-cloud-optimization-v1
- 0.1.2-SNAPSHOT
+ 0.1.2
com.google.api.grpc
proto-google-cloud-optimization-v1
- 0.1.2-SNAPSHOT
+ 0.1.2
diff --git a/google-cloud-optimization/pom.xml b/google-cloud-optimization/pom.xml
index b44b1de..9123b50 100644
--- a/google-cloud-optimization/pom.xml
+++ b/google-cloud-optimization/pom.xml
@@ -3,7 +3,7 @@
4.0.0
com.google.cloud
google-cloud-optimization
- 0.1.2-SNAPSHOT
+ 0.1.2
jar
Google Cloud Fleet Routing
https://github.com/googleapis/java-optimization
@@ -11,7 +11,7 @@
com.google.cloud
google-cloud-optimization-parent
- 0.1.2-SNAPSHOT
+ 0.1.2
google-cloud-optimization
diff --git a/grpc-google-cloud-optimization-v1/pom.xml b/grpc-google-cloud-optimization-v1/pom.xml
index 172996b..896d958 100644
--- a/grpc-google-cloud-optimization-v1/pom.xml
+++ b/grpc-google-cloud-optimization-v1/pom.xml
@@ -4,13 +4,13 @@
4.0.0
com.google.api.grpc
grpc-google-cloud-optimization-v1
- 0.1.2-SNAPSHOT
+ 0.1.2
grpc-google-cloud-optimization-v1
GRPC library for google-cloud-optimization
com.google.cloud
google-cloud-optimization-parent
- 0.1.2-SNAPSHOT
+ 0.1.2
diff --git a/pom.xml b/pom.xml
index 6360597..5eb858f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
com.google.cloud
google-cloud-optimization-parent
pom
- 0.1.2-SNAPSHOT
+ 0.1.2
Google Cloud Fleet Routing Parent
https://github.com/googleapis/java-optimization
@@ -69,17 +69,17 @@
com.google.cloud
google-cloud-optimization
- 0.1.2-SNAPSHOT
+ 0.1.2
com.google.api.grpc
grpc-google-cloud-optimization-v1
- 0.1.2-SNAPSHOT
+ 0.1.2
com.google.api.grpc
proto-google-cloud-optimization-v1
- 0.1.2-SNAPSHOT
+ 0.1.2
diff --git a/proto-google-cloud-optimization-v1/pom.xml b/proto-google-cloud-optimization-v1/pom.xml
index bd42e59..8d53637 100644
--- a/proto-google-cloud-optimization-v1/pom.xml
+++ b/proto-google-cloud-optimization-v1/pom.xml
@@ -4,13 +4,13 @@
4.0.0
com.google.api.grpc
proto-google-cloud-optimization-v1
- 0.1.2-SNAPSHOT
+ 0.1.2
proto-google-cloud-optimization-v1
Proto library for google-cloud-optimization
com.google.cloud
google-cloud-optimization-parent
- 0.1.2-SNAPSHOT
+ 0.1.2
diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml
index 6bcb23c..4f14088 100644
--- a/samples/snapshot/pom.xml
+++ b/samples/snapshot/pom.xml
@@ -28,7 +28,7 @@
com.google.cloud
google-cloud-optimization
- 0.1.2-SNAPSHOT
+ 0.1.2
diff --git a/versions.txt b/versions.txt
index 55d37e6..4462adf 100644
--- a/versions.txt
+++ b/versions.txt
@@ -1,6 +1,6 @@
# Format:
# module:released-version:current-version
-google-cloud-optimization:0.1.1:0.1.2-SNAPSHOT
-proto-google-cloud-optimization-v1:0.1.1:0.1.2-SNAPSHOT
-grpc-google-cloud-optimization-v1:0.1.1:0.1.2-SNAPSHOT
+google-cloud-optimization:0.1.2:0.1.2
+proto-google-cloud-optimization-v1:0.1.2:0.1.2
+grpc-google-cloud-optimization-v1:0.1.2:0.1.2