Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit aada00d

Browse files
committed
[samplecode][1/3]Implement Pure Unary RPC sample code (#573)
1 parent 18f9a63 commit aada00d

File tree

1 file changed

+6
-94
lines changed

1 file changed

+6
-94
lines changed

test/integration/goldens/logging/MetricsClient.java

Lines changed: 6 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -151,17 +151,6 @@ public MetricsServiceV2Stub getStub() {
151151
/**
152152
* Lists logs-based metrics.
153153
*
154-
* <p>Sample code:
155-
*
156-
* <pre>{@code
157-
* try (MetricsClient metricsClient = MetricsClient.create()) {
158-
* ProjectName parent = ProjectName.of("[PROJECT]");
159-
* for (LogMetric element : metricsClient.listLogMetrics(parent).iterateAll()) {
160-
* // doThingsWith(element);
161-
* }
162-
* }
163-
* }</pre>
164-
*
165154
* @param parent Required. The name of the project containing the metrics:
166155
* <p>"projects/[PROJECT_ID]"
167156
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -178,17 +167,6 @@ public final ListLogMetricsPagedResponse listLogMetrics(ProjectName parent) {
178167
/**
179168
* Lists logs-based metrics.
180169
*
181-
* <p>Sample code:
182-
*
183-
* <pre>{@code
184-
* try (MetricsClient metricsClient = MetricsClient.create()) {
185-
* String parent = ProjectName.of("[PROJECT]").toString();
186-
* for (LogMetric element : metricsClient.listLogMetrics(parent).iterateAll()) {
187-
* // doThingsWith(element);
188-
* }
189-
* }
190-
* }</pre>
191-
*
192170
* @param parent Required. The name of the project containing the metrics:
193171
* <p>"projects/[PROJECT_ID]"
194172
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -202,22 +180,6 @@ public final ListLogMetricsPagedResponse listLogMetrics(String parent) {
202180
/**
203181
* Lists logs-based metrics.
204182
*
205-
* <p>Sample code:
206-
*
207-
* <pre>{@code
208-
* try (MetricsClient metricsClient = MetricsClient.create()) {
209-
* ListLogMetricsRequest request =
210-
* ListLogMetricsRequest.newBuilder()
211-
* .setParent(ProjectName.of("[PROJECT]").toString())
212-
* .setPageToken("pageToken873572522")
213-
* .setPageSize(883849137)
214-
* .build();
215-
* for (LogMetric element : metricsClient.listLogMetrics(request).iterateAll()) {
216-
* // doThingsWith(element);
217-
* }
218-
* }
219-
* }</pre>
220-
*
221183
* @param request The request object containing all of the parameters for the API call.
222184
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
223185
*/
@@ -276,7 +238,7 @@ public final ListLogMetricsPagedResponse listLogMetrics(ListLogMetricsRequest re
276238
* }
277239
* }</pre>
278240
*
279-
* @param metricName Required. The resource name of the desired metric:
241+
* @param metric_name Required. The resource name of the desired metric:
280242
* <p>"projects/[PROJECT_ID]/metrics/[METRIC_ID]"
281243
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
282244
*/
@@ -301,7 +263,7 @@ public final LogMetric getLogMetric(LogMetricName metricName) {
301263
* }
302264
* }</pre>
303265
*
304-
* @param metricName Required. The resource name of the desired metric:
266+
* @param metric_name Required. The resource name of the desired metric:
305267
* <p>"projects/[PROJECT_ID]/metrics/[METRIC_ID]"
306268
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
307269
*/
@@ -315,18 +277,6 @@ public final LogMetric getLogMetric(String metricName) {
315277
/**
316278
* Gets a logs-based metric.
317279
*
318-
* <p>Sample code:
319-
*
320-
* <pre>{@code
321-
* try (MetricsClient metricsClient = MetricsClient.create()) {
322-
* GetLogMetricRequest request =
323-
* GetLogMetricRequest.newBuilder()
324-
* .setMetricName(LogMetricName.of("[PROJECT]", "[METRIC]").toString())
325-
* .build();
326-
* LogMetric response = metricsClient.getLogMetric(request);
327-
* }
328-
* }</pre>
329-
*
330280
* @param request The request object containing all of the parameters for the API call.
331281
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
332282
*/
@@ -405,19 +355,6 @@ public final LogMetric createLogMetric(String parent, LogMetric metric) {
405355
/**
406356
* Creates a logs-based metric.
407357
*
408-
* <p>Sample code:
409-
*
410-
* <pre>{@code
411-
* try (MetricsClient metricsClient = MetricsClient.create()) {
412-
* CreateLogMetricRequest request =
413-
* CreateLogMetricRequest.newBuilder()
414-
* .setParent(LogMetricName.of("[PROJECT]", "[METRIC]").toString())
415-
* .setMetric(LogMetric.newBuilder().build())
416-
* .build();
417-
* LogMetric response = metricsClient.createLogMetric(request);
418-
* }
419-
* }</pre>
420-
*
421358
* @param request The request object containing all of the parameters for the API call.
422359
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
423360
*/
@@ -449,7 +386,7 @@ public final UnaryCallable<CreateLogMetricRequest, LogMetric> createLogMetricCal
449386
* }
450387
* }</pre>
451388
*
452-
* @param metricName Required. The resource name of the metric to update:
389+
* @param metric_name Required. The resource name of the metric to update:
453390
* <p>"projects/[PROJECT_ID]/metrics/[METRIC_ID]"
454391
* <p>The updated metric must be provided in the request and it's `name` field must be the
455392
* same as `[METRIC_ID]` If the metric does not exist in `[PROJECT_ID]`, then a new metric is
@@ -480,7 +417,7 @@ public final LogMetric updateLogMetric(LogMetricName metricName, LogMetric metri
480417
* }
481418
* }</pre>
482419
*
483-
* @param metricName Required. The resource name of the metric to update:
420+
* @param metric_name Required. The resource name of the metric to update:
484421
* <p>"projects/[PROJECT_ID]/metrics/[METRIC_ID]"
485422
* <p>The updated metric must be provided in the request and it's `name` field must be the
486423
* same as `[METRIC_ID]` If the metric does not exist in `[PROJECT_ID]`, then a new metric is
@@ -498,19 +435,6 @@ public final LogMetric updateLogMetric(String metricName, LogMetric metric) {
498435
/**
499436
* Creates or updates a logs-based metric.
500437
*
501-
* <p>Sample code:
502-
*
503-
* <pre>{@code
504-
* try (MetricsClient metricsClient = MetricsClient.create()) {
505-
* UpdateLogMetricRequest request =
506-
* UpdateLogMetricRequest.newBuilder()
507-
* .setMetricName(LogMetricName.of("[PROJECT]", "[METRIC]").toString())
508-
* .setMetric(LogMetric.newBuilder().build())
509-
* .build();
510-
* LogMetric response = metricsClient.updateLogMetric(request);
511-
* }
512-
* }</pre>
513-
*
514438
* @param request The request object containing all of the parameters for the API call.
515439
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
516440
*/
@@ -541,7 +465,7 @@ public final UnaryCallable<UpdateLogMetricRequest, LogMetric> updateLogMetricCal
541465
* }
542466
* }</pre>
543467
*
544-
* @param metricName Required. The resource name of the metric to delete:
468+
* @param metric_name Required. The resource name of the metric to delete:
545469
* <p>"projects/[PROJECT_ID]/metrics/[METRIC_ID]"
546470
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
547471
*/
@@ -566,7 +490,7 @@ public final void deleteLogMetric(LogMetricName metricName) {
566490
* }
567491
* }</pre>
568492
*
569-
* @param metricName Required. The resource name of the metric to delete:
493+
* @param metric_name Required. The resource name of the metric to delete:
570494
* <p>"projects/[PROJECT_ID]/metrics/[METRIC_ID]"
571495
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
572496
*/
@@ -580,18 +504,6 @@ public final void deleteLogMetric(String metricName) {
580504
/**
581505
* Deletes a logs-based metric.
582506
*
583-
* <p>Sample code:
584-
*
585-
* <pre>{@code
586-
* try (MetricsClient metricsClient = MetricsClient.create()) {
587-
* DeleteLogMetricRequest request =
588-
* DeleteLogMetricRequest.newBuilder()
589-
* .setMetricName(LogMetricName.of("[PROJECT]", "[METRIC]").toString())
590-
* .build();
591-
* metricsClient.deleteLogMetric(request);
592-
* }
593-
* }</pre>
594-
*
595507
* @param request The request object containing all of the parameters for the API call.
596508
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
597509
*/

0 commit comments

Comments
 (0)