Skip to content

Commit 6deddff

Browse files
committed
Fix javadoc on all samples
1 parent c547336 commit 6deddff

28 files changed

Lines changed: 479 additions & 433 deletions

google-analytics-admin/src/main/java/com/google/analytics/admin/samples/QuickstartSample.java

Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -16,46 +16,47 @@
1616

1717
package com.google.analytics.admin.samples;
1818

19-
/* This application demonstrates the usage of the Analytics Admin API using
20-
service account credentials. For more information on service accounts, see
21-
https://cloud.google.com/iam/docs/understanding-service-accounts
22-
23-
The following document provides instructions on setting service account
24-
credentials for your application:
25-
https://cloud.google.com/docs/authentication/production
26-
27-
In a nutshell, you need to:
28-
29-
1. Create a service account and download the key JSON file.
30-
https://cloud.google.com/docs/authentication/production#creating_a_service_account
31-
32-
2. Provide service account credentials using one of the following options:
33-
- set the GOOGLE_APPLICATION_CREDENTIALS environment variable, the API
34-
client will use the value of this variable to find the service account key
35-
JSON file.
36-
37-
https://cloud.google.com/docs/authentication/production#setting_the_environment_variable
38-
39-
OR
40-
41-
- manually pass the path to the service account key JSON file to the API client
42-
by specifying the keyFilename parameter in the constructor.
43-
https://cloud.google.com/docs/authentication/production#passing_the_path_to_the_service_account_key_in_code
44-
45-
To run this sample using Maven:
46-
cd java-analytics-admin/samples/snippets
47-
mvn install
48-
mvn exec:java -Dexec.mainClass="com.example.analytics.QuickstartSample"
49-
*/
50-
5119
// [START analytics_admin_quickstart]
52-
5320
import com.google.analytics.admin.v1beta.Account;
5421
import com.google.analytics.admin.v1beta.AnalyticsAdminServiceClient;
5522
import com.google.analytics.admin.v1beta.AnalyticsAdminServiceClient.ListAccountsPage;
5623
import com.google.analytics.admin.v1beta.AnalyticsAdminServiceClient.ListAccountsPagedResponse;
5724
import com.google.analytics.admin.v1beta.ListAccountsRequest;
5825

26+
/**
27+
* This application demonstrates the usage of the Analytics Admin API using service account
28+
* credentials. For more information on service accounts, see
29+
* https://cloud.google.com/iam/docs/understanding-service-accounts.
30+
*
31+
* <p>The following document provides instructions on setting service account credentials for your
32+
* application: https://cloud.google.com/docs/authentication/production
33+
*
34+
* <p>In a nutshell, you need to:
35+
*
36+
* <ol>
37+
* <li>Create a service account and download the key JSON file as described at
38+
* https://cloud.google.com/docs/authentication/production#creating_a_service_account.
39+
* <li>Provide service account credentials using one of the following options:
40+
* <ul>
41+
* <li>Set the {@code GOOGLE_APPLICATION_CREDENTIALS} environment variable. The API client
42+
* will use the value of this variable to find the service account key JSON file. See
43+
* https://cloud.google.com/docs/authentication/production#setting_the_environment_variable
44+
* for more information.
45+
* <p>OR
46+
* <li>Manually pass the path to the service account key JSON file to the API client by
47+
* specifying the {@code keyFilename} parameter in the constructor. See
48+
* https://cloud.google.com/docs/authentication/production#passing_the_path_to_the_service_account_key_in_code
49+
* for more information.
50+
* </ul>
51+
* </ol>
52+
*
53+
* <p>To run this sample using Maven:
54+
*
55+
* <pre>{@code
56+
* cd google-analytics-data
57+
* mvn compile exec:java -Dexec.mainClass="com.google.analytics.admin.samples.QuickstartSample"
58+
* }</pre>
59+
*/
5960
public class QuickstartSample {
6061

6162
public static void main(String... args) throws Exception {

google-analytics-data/src/main/java/com/google/analytics/data/samples/GetCommonMetadataSample.java

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,27 @@
1616

1717
package com.google.analytics.data.samples;
1818

19-
/* Google Analytics Data API sample application retrieving dimension and metrics
20-
metadata.
21-
22-
See https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties/getMetadata
23-
for more information.
24-
25-
To run this sample using Maven:
26-
cd google-analytics-data
27-
mvn compile
28-
mvn exec:java -Dexec.mainClass="com.example.analytics.GetCommonMetadataSample"
29-
*/
30-
3119
// [START analyticsdata_get_common_metadata]
32-
3320
import com.google.analytics.data.v1beta.BetaAnalyticsDataClient;
3421
import com.google.analytics.data.v1beta.DimensionMetadata;
3522
import com.google.analytics.data.v1beta.GetMetadataRequest;
3623
import com.google.analytics.data.v1beta.Metadata;
3724
import com.google.analytics.data.v1beta.MetricMetadata;
3825

26+
/**
27+
* Google Analytics Data API sample application retrieving dimension and metrics metadata.
28+
*
29+
* <p>See
30+
* https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties/getMetadata
31+
* for more information.
32+
*
33+
* <p>To run this sample using Maven:
34+
*
35+
* <pre>{@code
36+
* cd google-analytics-data
37+
* mvn compile exec:java -Dexec.mainClass="com.google.analytics.data.samples.GetCommonMetadataSample"
38+
* }</pre>
39+
*/
3940
public class GetCommonMetadataSample {
4041

4142
public static void main(String... args) throws Exception {

google-analytics-data/src/main/java/com/google/analytics/data/samples/GetMetadataByPropertyIdSample.java

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,25 @@
1616

1717
package com.google.analytics.data.samples;
1818

19-
/* Google Analytics Data API sample application retrieving dimension and metrics
20-
metadata.
21-
22-
See https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties/getMetadata
23-
for more information.
24-
25-
To run this sample using Maven:
26-
cd google-analytics-data
27-
mvn compile
28-
mvn exec:java -Dexec.mainClass="com.example.analytics.GetMetadataByPropertyIdSample"
29-
*/
30-
3119
// [START analyticsdata_get_metadata_by_property_id]
32-
3320
import com.google.analytics.data.v1beta.BetaAnalyticsDataClient;
3421
import com.google.analytics.data.v1beta.GetMetadataRequest;
3522
import com.google.analytics.data.v1beta.Metadata;
3623

24+
/**
25+
* Google Analytics Data API sample application retrieving dimension and metrics metadata.
26+
*
27+
* <p>See
28+
* https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties/getMetadata
29+
* for more information.
30+
*
31+
* <p>To run this sample using Maven:
32+
*
33+
* <pre>{@code
34+
* cd google-analytics-data
35+
* mvn compile exec:java -Dexec.mainClass="com.google.analytics.data.samples.GetMetadataByPropertyIdSample"
36+
* }</pre>
37+
*/
3738
public class GetMetadataByPropertyIdSample {
3839

3940
public static void main(String... args) throws Exception {

google-analytics-data/src/main/java/com/google/analytics/data/samples/QuickstartJsonCredentialsSample.java

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,6 @@
1616

1717
package com.google.analytics.data.samples;
1818

19-
/* Google Analytics Data API sample quickstart application.
20-
21-
This application demonstrates the usage of the Analytics Data API using
22-
service account credentials from a JSON file downloaded from
23-
the Google Cloud Console.
24-
25-
Before you start the application, please review the comments starting with
26-
"TODO(developer)" and update the code to use correct values.
27-
28-
To run this sample using Maven:
29-
cd google-analytics-data
30-
mvn compile
31-
mvn exec:java -Dexec.mainClass="com.example.analytics.QuickstartJsonCredentialsSample"
32-
*/
33-
3419
// [START analyticsdata_json_credentials_quickstart]
3520
import com.google.analytics.data.v1beta.BetaAnalyticsDataClient;
3621
import com.google.analytics.data.v1beta.BetaAnalyticsDataSettings;
@@ -44,6 +29,22 @@
4429
import com.google.auth.oauth2.GoogleCredentials;
4530
import java.io.FileInputStream;
4631

32+
/**
33+
* Google Analytics Data API sample quickstart application.
34+
*
35+
* <p>This application demonstrates the usage of the Analytics Data API using service account
36+
* credentials from a JSON file downloaded from the Google Cloud Console.
37+
*
38+
* <p>Before you start the application, please review the comments starting with "TODO(developer)"
39+
* and update the code to use correct values.
40+
*
41+
* <p>To run this sample using Maven:
42+
*
43+
* <pre>{@code
44+
* cd google-analytics-data
45+
* mvn compile exec:java -Dexec.mainClass="com.google.analytics.data.samples.QuickstartJsonCredentialsSample"
46+
* }</pre>
47+
*/
4748
public class QuickstartJsonCredentialsSample {
4849

4950
public static void main(String... args) throws Exception {

google-analytics-data/src/main/java/com/google/analytics/data/samples/QuickstartOAuth2Sample.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,10 @@
6060
*
6161
* <p>To run this sample using Maven:
6262
*
63-
* <pre>
63+
* <pre>{@code
6464
* cd google-analytics-data
65-
* mvn compile
66-
* mvn exec:java -Dexec.mainClass="com.example.analytics.QuickstartOAuth2Sample"
67-
* </pre>
65+
* mvn compile exec:java -Dexec.mainClass="com.google.analytics.data.samples.QuickstartOAuth2Sample"
66+
* }</pre>
6867
*/
6968
// [START analyticsdata_quickstart_oauth2]
7069
public class QuickstartOAuth2Sample {

google-analytics-data/src/main/java/com/google/analytics/data/samples/QuickstartSample.java

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,6 @@
1616

1717
package com.google.analytics.data.samples;
1818

19-
/* Google Analytics Data API sample quickstart application.
20-
21-
This application demonstrates the usage of the Analytics Data API using service account credentials.
22-
23-
Before you start the application, please review the comments starting with
24-
"TODO(developer)" and update the code to use correct values.
25-
26-
To run this sample using Maven:
27-
cd google-analytics-data
28-
mvn compile
29-
mvn exec:java -Dexec.mainClass="com.example.analytics.QuickstartSample"
30-
*/
31-
3219
// [START analyticsdata_quickstart]
3320
import com.google.analytics.data.v1beta.BetaAnalyticsDataClient;
3421
import com.google.analytics.data.v1beta.DateRange;
@@ -38,6 +25,22 @@
3825
import com.google.analytics.data.v1beta.RunReportRequest;
3926
import com.google.analytics.data.v1beta.RunReportResponse;
4027

28+
/**
29+
* Google Analytics Data API sample quickstart application.
30+
*
31+
* <p>This application demonstrates the usage of the Analytics Data API using service account
32+
* credentials.
33+
*
34+
* <p>Before you start the application, please review the comments starting with "TODO(developer)"
35+
* and update the code to use correct values.
36+
*
37+
* <p>To run this sample using Maven:
38+
*
39+
* <pre>{@code
40+
* cd google-analytics-data
41+
* mvn compile exec:java -Dexec.mainClass="com.google.analytics.data.samples.QuickstartSample"
42+
* }</pre>
43+
*/
4144
public class QuickstartSample {
4245

4346
public static void main(String... args) throws Exception {

google-analytics-data/src/main/java/com/google/analytics/data/samples/RunBatchReportSample.java

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,6 @@
1616

1717
package com.google.analytics.data.samples;
1818

19-
/* Google Analytics Data API sample application demonstrating the batch creation
20-
of multiple reports.
21-
22-
See
23-
https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties/batchRunReports
24-
for more information.
25-
26-
Before you start the application, please review the comments starting with
27-
"TODO(developer)" and update the code to use correct values.
28-
29-
To run this sample using Maven:
30-
cd google-analytics-data
31-
mvn compile
32-
mvn exec:java -Dexec.mainClass="com.example.analytics.RunBatchReportSample"
33-
*/
34-
3519
// [START analyticsdata_run_batch_report]
3620

3721
import com.google.analytics.data.v1beta.BatchRunReportsRequest;
@@ -43,6 +27,24 @@
4327
import com.google.analytics.data.v1beta.RunReportRequest;
4428
import com.google.analytics.data.v1beta.RunReportResponse;
4529

30+
/**
31+
* Google Analytics Data API sample application demonstrating the batch creation of multiple
32+
* reports.
33+
*
34+
* <p>See
35+
* https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties/batchRunReports
36+
* for more information.
37+
*
38+
* <p>Before you start the application, please review the comments starting with "TODO(developer)"
39+
* and update the code to use correct values.
40+
*
41+
* <p>To run this sample using Maven:
42+
*
43+
* <pre>{@code
44+
* cd google-analytics-data
45+
* mvn compile exec:java -Dexec.mainClass="com.google.analytics.data.samples.RunBatchReportSample"
46+
* }</pre>
47+
*/
4648
public class RunBatchReportSample {
4749

4850
public static void main(String... args) throws Exception {

google-analytics-data/src/main/java/com/google/analytics/data/samples/RunFunnelReportSample.java

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,22 @@
3636
import com.google.analytics.data.v1alpha.StringFilter;
3737
import com.google.analytics.data.v1alpha.StringFilter.MatchType;
3838

39-
/* Google Analytics Data API sample application demonstrating the creation
40-
of a funnel report.
41-
42-
See https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties/runFunnelReport
43-
for more information.
44-
45-
Before you start the application, please review the comments starting with
46-
"TODO(developer)" and update the code to use correct values.
47-
48-
To run this sample using Maven:
49-
cd google-analytics-data
50-
mvn compile
51-
mvn exec:java -Dexec.mainClass="com.example.analytics.RunFunnelReportSample"
39+
/**
40+
* Google Analytics Data API sample application demonstrating the creation of a funnel report.
41+
*
42+
* <p>See
43+
* https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties/runFunnelReport
44+
* for more information.
45+
*
46+
* <p>Before you start the application, please review the comments starting with "TODO(developer)"
47+
* and update the code to use correct values.
48+
*
49+
* <p>To run this sample using Maven:
50+
*
51+
* <pre>{@code
52+
* cd google-analytics-data
53+
* mvn compile exec:java -Dexec.mainClass="com.google.analytics.data.samples.RunFunnelReportSample"
54+
* }</pre>
5255
*/
5356
public class RunFunnelReportSample {
5457

google-analytics-data/src/main/java/com/google/analytics/data/samples/RunPivotReportSample.java

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,6 @@
1616

1717
package com.google.analytics.data.samples;
1818

19-
/* Google Analytics Data API sample application demonstrating the creation of
20-
a pivot report.
21-
22-
See
23-
https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties/runPivotReport
24-
for more information.
25-
26-
Before you start the application, please review the comments starting with
27-
"TODO(developer)" and update the code to use correct values.
28-
29-
To run this sample using Maven:
30-
cd google-analytics-data
31-
mvn compile
32-
mvn exec:java -Dexec.mainClass="com.example.analytics.RunPivotReportSample"
33-
*/
34-
3519
// [START analyticsdata_run_pivot_report]
3620

3721
import com.google.analytics.data.v1beta.BetaAnalyticsDataClient;
@@ -46,6 +30,23 @@
4630
import com.google.analytics.data.v1beta.RunPivotReportRequest;
4731
import com.google.analytics.data.v1beta.RunPivotReportResponse;
4832

33+
/**
34+
* Google Analytics Data API sample application demonstrating the creation of a pivot report.
35+
*
36+
* <p>See
37+
* https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties/runPivotReport
38+
* for more information.
39+
*
40+
* <p>Before you start the application, please review the comments starting with "TODO(developer)"
41+
* and update the code to use correct values.
42+
*
43+
* <p>To run this sample using Maven:
44+
*
45+
* <pre>{@code
46+
* cd google-analytics-data
47+
* mvn compile exec:java -Dexec.mainClass="com.google.analytics.data.samples.RunPivotReportSample"
48+
* }</pre>
49+
*/
4950
public class RunPivotReportSample {
5051

5152
public static void main(String... args) throws Exception {

0 commit comments

Comments
 (0)