Skip to content

Commit 6cf614b

Browse files
authored
samples(fix): bug fix, wrong projectId. (#575)
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/java-retail/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) Fixes #<issue_number_goes_here> ☕️ If you write sample code, please follow the [samples format]( https://github.com/GoogleCloudPlatform/java-docs-samples/blob/main/SAMPLE_FORMAT.md).
1 parent 4d4633a commit 6cf614b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

java-retail/samples/interactive-tutorials/src/main/java/product/CrudProduct.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
package product;
2222

2323
import com.google.api.gax.rpc.NotFoundException;
24+
import com.google.cloud.ServiceOptions;
2425
import com.google.cloud.retail.v2.CreateProductRequest;
2526
import com.google.cloud.retail.v2.DeleteProductRequest;
2627
import com.google.cloud.retail.v2.GetProductRequest;
@@ -37,7 +38,7 @@ public class CrudProduct {
3738

3839
public static void main(String[] args) throws IOException {
3940
// TODO(developer): Set projectId to your Google Cloud Platform project ID.
40-
String projectId = "my-project";
41+
String projectId = ServiceOptions.getDefaultProjectId();
4142
String generatedProductId = UUID.randomUUID().toString();
4243
String branchName =
4344
String.format(

0 commit comments

Comments
 (0)