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 Jan 15, 2021
1 parent b1aab99 commit 4585dc1
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 @@ -151,6 +151,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 @@ -167,6 +178,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 4585dc1

Please sign in to comment.