File tree 6 files changed +12
-6
lines changed
retail/interactive-tutorials/src/main/java/events
6 files changed +12
-6
lines changed Original file line number Diff line number Diff line change 21
21
package events ;
22
22
23
23
import com .google .api .gax .rpc .NotFoundException ;
24
+ import com .google .cloud .ServiceOptions ;
24
25
import com .google .cloud .bigquery .BigQueryException ;
25
26
import com .google .cloud .retail .v2 .BigQuerySource ;
26
27
import com .google .cloud .retail .v2 .ImportMetadata ;
@@ -38,7 +39,7 @@ public class ImportUserEventsBigQuery {
38
39
39
40
public static void main (String [] args ) throws IOException , InterruptedException {
40
41
// TODO(developer): Replace these variables before running the sample.
41
- String projectId = "your-project-id" ;
42
+ String projectId = ServiceOptions . getDefaultProjectId () ;
42
43
String defaultCatalog =
43
44
String .format ("projects/%s/locations/global/catalogs/default_catalog" , projectId );
44
45
// TO CHECK ERROR HANDLING PASTE THE INVALID CATALOG NAME HERE:
Original file line number Diff line number Diff line change 22
22
23
23
import com .google .api .gax .rpc .InvalidArgumentException ;
24
24
import com .google .api .gax .rpc .PermissionDeniedException ;
25
+ import com .google .cloud .ServiceOptions ;
25
26
import com .google .cloud .retail .v2 .GcsSource ;
26
27
import com .google .cloud .retail .v2 .ImportErrorsConfig ;
27
28
import com .google .cloud .retail .v2 .ImportMetadata ;
@@ -39,7 +40,7 @@ public class ImportUserEventsGcs {
39
40
40
41
public static void main (String [] args ) throws IOException , InterruptedException {
41
42
// TODO(developer): Replace these variables before running the sample.
42
- String projectId = "your-project-id" ;
43
+ String projectId = ServiceOptions . getDefaultProjectId () ;
43
44
String defaultCatalog =
44
45
String .format ("projects/%s/locations/global/catalogs/default_catalog" , projectId );
45
46
// TO CHECK ERROR HANDLING PASTE THE INVALID CATALOG NAME HERE:
Original file line number Diff line number Diff line change 21
21
package events ;
22
22
23
23
import com .google .api .gax .longrunning .OperationFuture ;
24
+ import com .google .cloud .ServiceOptions ;
24
25
import com .google .cloud .bigquery .BigQueryException ;
25
26
import com .google .cloud .retail .v2 .ImportMetadata ;
26
27
import com .google .cloud .retail .v2 .ImportUserEventsRequest ;
@@ -43,7 +44,7 @@ public class ImportUserEventsInline {
43
44
public static void main (String [] args )
44
45
throws IOException , ExecutionException , InterruptedException {
45
46
// TODO(developer): Replace these variables before running the sample.
46
- String projectId = "your-project-id" ;
47
+ String projectId = ServiceOptions . getDefaultProjectId () ;
47
48
String defaultCatalog =
48
49
String .format ("projects/%s/locations/global/catalogs/default_catalog" , projectId );
49
50
Original file line number Diff line number Diff line change 23
23
import static setup .SetupCleanup .writeUserEvent ;
24
24
25
25
import com .google .api .gax .longrunning .OperationFuture ;
26
+ import com .google .cloud .ServiceOptions ;
26
27
import com .google .cloud .retail .v2 .PurgeMetadata ;
27
28
import com .google .cloud .retail .v2 .PurgeUserEventsRequest ;
28
29
import com .google .cloud .retail .v2 .PurgeUserEventsResponse ;
@@ -36,7 +37,7 @@ public class PurgeUserEvent {
36
37
public static void main (String [] args )
37
38
throws IOException , ExecutionException , InterruptedException {
38
39
// TODO(developer): Replace these variables before running the sample.
39
- String projectId = "your-project-id" ;
40
+ String projectId = ServiceOptions . getDefaultProjectId () ;
40
41
String defaultCatalog =
41
42
String .format ("projects/%s/locations/global/catalogs/default_catalog" , projectId );
42
43
// visitorId generated randomly.
Original file line number Diff line number Diff line change 24
24
import static setup .SetupCleanup .writeUserEvent ;
25
25
26
26
import com .google .api .gax .longrunning .OperationFuture ;
27
+ import com .google .cloud .ServiceOptions ;
27
28
import com .google .cloud .retail .v2 .RejoinUserEventsMetadata ;
28
29
import com .google .cloud .retail .v2 .RejoinUserEventsRequest ;
29
30
import com .google .cloud .retail .v2 .RejoinUserEventsRequest .UserEventRejoinScope ;
@@ -38,7 +39,7 @@ public class RejoinUserEvent {
38
39
public static void main (String [] args )
39
40
throws IOException , ExecutionException , InterruptedException {
40
41
// TODO(developer): Replace these variables before running the sample.
41
- String projectId = "your-project-id" ;
42
+ String projectId = ServiceOptions . getDefaultProjectId () ;
42
43
String defaultCatalog =
43
44
String .format ("projects/%s/locations/global/catalogs/default_catalog" , projectId );
44
45
// visitorId generated randomly.
Original file line number Diff line number Diff line change 22
22
23
23
import static setup .SetupCleanup .purgeUserEvent ;
24
24
25
+ import com .google .cloud .ServiceOptions ;
25
26
import com .google .cloud .retail .v2 .UserEvent ;
26
27
import com .google .cloud .retail .v2 .UserEventServiceClient ;
27
28
import com .google .cloud .retail .v2 .WriteUserEventRequest ;
@@ -36,7 +37,7 @@ public class WriteUserEvent {
36
37
public static void main (String [] args )
37
38
throws IOException , ExecutionException , InterruptedException {
38
39
// TODO(developer): Replace these variables before running the sample.
39
- String projectId = "your-project-id" ;
40
+ String projectId = ServiceOptions . getDefaultProjectId () ;
40
41
String defaultCatalog =
41
42
String .format ("projects/%s/locations/global/catalogs/default_catalog" , projectId );
42
43
// visitorId generated randomly.
You can’t perform that action at this time.
0 commit comments