Skip to content

Commit

Permalink
[samplecode][2/3]Implemente Unary Paged RPC method's sample code (#576)
Browse files Browse the repository at this point in the history
  • Loading branch information
summer-ji-eng committed Dec 31, 2020
1 parent 68e15cf commit 47ef7e7
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/integration/goldens/logging/MetricsClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,17 @@ public MetricsServiceV2Stub getStub() {
/**
* Lists logs-based metrics.
*
* <p>Sample code:
*
* <pre>{@code
* try (MetricsClient metricsClient = MetricsClient.create()) {
* ProjectName parent = ProjectName.of("[PROJECT]");
* for (LogMetric element : metricsClient.listLogMetrics(parent).iterateAll()) {
* // doThingsWith(element);
* }
* }
* }</pre>
*
* @param parent Required. The name of the project containing the metrics:
* <p>"projects/[PROJECT_ID]"
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
Expand All @@ -168,6 +179,17 @@ public final ListLogMetricsPagedResponse listLogMetrics(ProjectName parent) {
/**
* Lists logs-based metrics.
*
* <p>Sample code:
*
* <pre>{@code
* try (MetricsClient metricsClient = MetricsClient.create()) {
* String parent = ProjectName.of("[PROJECT]").toString();
* for (LogMetric element : metricsClient.listLogMetrics(parent).iterateAll()) {
* // doThingsWith(element);
* }
* }
* }</pre>
*
* @param parent Required. The name of the project containing the metrics:
* <p>"projects/[PROJECT_ID]"
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
Expand Down

0 comments on commit 47ef7e7

Please sign in to comment.