diff --git a/samples/interactive-tutorials/src/main/java/events/ImportUserEventsBigQuery.java b/samples/interactive-tutorials/src/main/java/events/ImportUserEventsBigQuery.java index 73c98d75..e3630e13 100644 --- a/samples/interactive-tutorials/src/main/java/events/ImportUserEventsBigQuery.java +++ b/samples/interactive-tutorials/src/main/java/events/ImportUserEventsBigQuery.java @@ -21,6 +21,7 @@ package events; import com.google.api.gax.rpc.NotFoundException; +import com.google.cloud.ServiceOptions; import com.google.cloud.bigquery.BigQueryException; import com.google.cloud.retail.v2.BigQuerySource; import com.google.cloud.retail.v2.ImportMetadata; @@ -38,7 +39,7 @@ public class ImportUserEventsBigQuery { public static void main(String[] args) throws IOException, InterruptedException { // TODO(developer): Replace these variables before running the sample. - String projectId = "your-project-id"; + String projectId = ServiceOptions.getDefaultProjectId(); String defaultCatalog = String.format("projects/%s/locations/global/catalogs/default_catalog", projectId); // TO CHECK ERROR HANDLING PASTE THE INVALID CATALOG NAME HERE: diff --git a/samples/interactive-tutorials/src/main/java/events/ImportUserEventsGcs.java b/samples/interactive-tutorials/src/main/java/events/ImportUserEventsGcs.java index 6abb57bd..3128f9ba 100644 --- a/samples/interactive-tutorials/src/main/java/events/ImportUserEventsGcs.java +++ b/samples/interactive-tutorials/src/main/java/events/ImportUserEventsGcs.java @@ -22,6 +22,7 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.PermissionDeniedException; +import com.google.cloud.ServiceOptions; import com.google.cloud.retail.v2.GcsSource; import com.google.cloud.retail.v2.ImportErrorsConfig; import com.google.cloud.retail.v2.ImportMetadata; @@ -39,7 +40,7 @@ public class ImportUserEventsGcs { public static void main(String[] args) throws IOException, InterruptedException { // TODO(developer): Replace these variables before running the sample. - String projectId = "your-project-id"; + String projectId = ServiceOptions.getDefaultProjectId(); String defaultCatalog = String.format("projects/%s/locations/global/catalogs/default_catalog", projectId); // TO CHECK ERROR HANDLING PASTE THE INVALID CATALOG NAME HERE: diff --git a/samples/interactive-tutorials/src/main/java/events/ImportUserEventsInline.java b/samples/interactive-tutorials/src/main/java/events/ImportUserEventsInline.java index 44cf661e..d7e88229 100644 --- a/samples/interactive-tutorials/src/main/java/events/ImportUserEventsInline.java +++ b/samples/interactive-tutorials/src/main/java/events/ImportUserEventsInline.java @@ -21,6 +21,7 @@ package events; import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.ServiceOptions; import com.google.cloud.bigquery.BigQueryException; import com.google.cloud.retail.v2.ImportMetadata; import com.google.cloud.retail.v2.ImportUserEventsRequest; @@ -43,7 +44,7 @@ public class ImportUserEventsInline { public static void main(String[] args) throws IOException, ExecutionException, InterruptedException { // TODO(developer): Replace these variables before running the sample. - String projectId = "your-project-id"; + String projectId = ServiceOptions.getDefaultProjectId(); String defaultCatalog = String.format("projects/%s/locations/global/catalogs/default_catalog", projectId); diff --git a/samples/interactive-tutorials/src/main/java/events/PurgeUserEvent.java b/samples/interactive-tutorials/src/main/java/events/PurgeUserEvent.java index 31e3d680..2dc99f29 100644 --- a/samples/interactive-tutorials/src/main/java/events/PurgeUserEvent.java +++ b/samples/interactive-tutorials/src/main/java/events/PurgeUserEvent.java @@ -23,6 +23,7 @@ import static setup.SetupCleanup.writeUserEvent; import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.ServiceOptions; import com.google.cloud.retail.v2.PurgeMetadata; import com.google.cloud.retail.v2.PurgeUserEventsRequest; import com.google.cloud.retail.v2.PurgeUserEventsResponse; @@ -36,7 +37,7 @@ public class PurgeUserEvent { public static void main(String[] args) throws IOException, ExecutionException, InterruptedException { // TODO(developer): Replace these variables before running the sample. - String projectId = "your-project-id"; + String projectId = ServiceOptions.getDefaultProjectId(); String defaultCatalog = String.format("projects/%s/locations/global/catalogs/default_catalog", projectId); // visitorId generated randomly. diff --git a/samples/interactive-tutorials/src/main/java/events/RejoinUserEvent.java b/samples/interactive-tutorials/src/main/java/events/RejoinUserEvent.java index d97cb8fd..b695b707 100644 --- a/samples/interactive-tutorials/src/main/java/events/RejoinUserEvent.java +++ b/samples/interactive-tutorials/src/main/java/events/RejoinUserEvent.java @@ -24,6 +24,7 @@ import static setup.SetupCleanup.writeUserEvent; import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.ServiceOptions; import com.google.cloud.retail.v2.RejoinUserEventsMetadata; import com.google.cloud.retail.v2.RejoinUserEventsRequest; import com.google.cloud.retail.v2.RejoinUserEventsRequest.UserEventRejoinScope; @@ -38,7 +39,7 @@ public class RejoinUserEvent { public static void main(String[] args) throws IOException, ExecutionException, InterruptedException { // TODO(developer): Replace these variables before running the sample. - String projectId = "your-project-id"; + String projectId = ServiceOptions.getDefaultProjectId(); String defaultCatalog = String.format("projects/%s/locations/global/catalogs/default_catalog", projectId); // visitorId generated randomly. diff --git a/samples/interactive-tutorials/src/main/java/events/WriteUserEvent.java b/samples/interactive-tutorials/src/main/java/events/WriteUserEvent.java index b4b20a59..aa32b87e 100644 --- a/samples/interactive-tutorials/src/main/java/events/WriteUserEvent.java +++ b/samples/interactive-tutorials/src/main/java/events/WriteUserEvent.java @@ -22,6 +22,7 @@ import static setup.SetupCleanup.purgeUserEvent; +import com.google.cloud.ServiceOptions; import com.google.cloud.retail.v2.UserEvent; import com.google.cloud.retail.v2.UserEventServiceClient; import com.google.cloud.retail.v2.WriteUserEventRequest; @@ -36,7 +37,7 @@ public class WriteUserEvent { public static void main(String[] args) throws IOException, ExecutionException, InterruptedException { // TODO(developer): Replace these variables before running the sample. - String projectId = "your-project-id"; + String projectId = ServiceOptions.getDefaultProjectId(); String defaultCatalog = String.format("projects/%s/locations/global/catalogs/default_catalog", projectId); // visitorId generated randomly.