diff --git a/google-cloud-monitoring-dashboard/src/main/java/com/google/cloud/monitoring/dashboard/v1/DashboardsServiceClient.java b/google-cloud-monitoring-dashboard/src/main/java/com/google/cloud/monitoring/dashboard/v1/DashboardsServiceClient.java index 30e600ed..8a58a9b6 100644 --- a/google-cloud-monitoring-dashboard/src/main/java/com/google/cloud/monitoring/dashboard/v1/DashboardsServiceClient.java +++ b/google-cloud-monitoring-dashboard/src/main/java/com/google/cloud/monitoring/dashboard/v1/DashboardsServiceClient.java @@ -50,6 +50,17 @@ *
This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *
{@code + * try (DashboardsServiceClient dashboardsServiceClient = DashboardsServiceClient.create()) { + * CreateDashboardRequest request = + * CreateDashboardRequest.newBuilder() + * .setParent("parent-995424086") + * .setDashboard(Dashboard.newBuilder().build()) + * .build(); + * Dashboard response = dashboardsServiceClient.createDashboard(request); + * } + * }+ * *
Note: close() needs to be called on the DashboardsServiceClient object to clean up resources * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). @@ -159,6 +170,19 @@ public DashboardsServiceStub getStub() { *
This method requires the `monitoring.dashboards.create` permission on the specified project. * For more information, see [Google Cloud IAM](https://cloud.google.com/iam). * + *
Sample code: + * + *
{@code + * try (DashboardsServiceClient dashboardsServiceClient = DashboardsServiceClient.create()) { + * CreateDashboardRequest request = + * CreateDashboardRequest.newBuilder() + * .setParent("parent-995424086") + * .setDashboard(Dashboard.newBuilder().build()) + * .build(); + * Dashboard response = dashboardsServiceClient.createDashboard(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -174,6 +198,20 @@ public final Dashboard createDashboard(CreateDashboardRequest request) { * For more information, see [Google Cloud IAM](https://cloud.google.com/iam). * *
Sample code: + * + *
{@code + * try (DashboardsServiceClient dashboardsServiceClient = DashboardsServiceClient.create()) { + * CreateDashboardRequest request = + * CreateDashboardRequest.newBuilder() + * .setParent("parent-995424086") + * .setDashboard(Dashboard.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dashboardsServiceClient.createDashboardCallable().futureCall(request); + * // Do something. + * Dashboard response = future.get(); + * } + * }
This method requires the `monitoring.dashboards.list` permission on the specified project. * For more information, see [Google Cloud IAM](https://cloud.google.com/iam). * + *
Sample code: + * + *
{@code + * try (DashboardsServiceClient dashboardsServiceClient = DashboardsServiceClient.create()) { + * ListDashboardsRequest request = + * ListDashboardsRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (Dashboard element : dashboardsServiceClient.listDashboards(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -201,6 +255,23 @@ public final ListDashboardsPagedResponse listDashboards(ListDashboardsRequest re * For more information, see [Google Cloud IAM](https://cloud.google.com/iam). * *
Sample code: + * + *
{@code + * try (DashboardsServiceClient dashboardsServiceClient = DashboardsServiceClient.create()) { + * ListDashboardsRequest request = + * ListDashboardsRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dashboardsServiceClient.listDashboardsPagedCallable().futureCall(request); + * // Do something. + * for (Dashboard element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (DashboardsServiceClient dashboardsServiceClient = DashboardsServiceClient.create()) { + * while (true) { + * ListDashboardsResponse response = + * dashboardsServiceClient.listDashboardsCallable().call(request); + * for (Dashboard element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
This method requires the `monitoring.dashboards.get` permission on the specified dashboard. * For more information, see [Google Cloud IAM](https://cloud.google.com/iam). * + *
Sample code: + * + *
{@code + * try (DashboardsServiceClient dashboardsServiceClient = DashboardsServiceClient.create()) { + * GetDashboardRequest request = + * GetDashboardRequest.newBuilder() + * .setName(DashboardName.of("[PROJECT]", "[DASHBOARD]").toString()) + * .build(); + * Dashboard response = dashboardsServiceClient.getDashboard(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -243,6 +344,19 @@ public final Dashboard getDashboard(GetDashboardRequest request) { * For more information, see [Google Cloud IAM](https://cloud.google.com/iam). * *
Sample code: + * + *
{@code + * try (DashboardsServiceClient dashboardsServiceClient = DashboardsServiceClient.create()) { + * GetDashboardRequest request = + * GetDashboardRequest.newBuilder() + * .setName(DashboardName.of("[PROJECT]", "[DASHBOARD]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dashboardsServiceClient.getDashboardCallable().futureCall(request); + * // Do something. + * Dashboard response = future.get(); + * } + * }
This method requires the `monitoring.dashboards.delete` permission on the specified * dashboard. For more information, see [Google Cloud IAM](https://cloud.google.com/iam). * + *
Sample code: + * + *
{@code + * try (DashboardsServiceClient dashboardsServiceClient = DashboardsServiceClient.create()) { + * DeleteDashboardRequest request = + * DeleteDashboardRequest.newBuilder() + * .setName(DashboardName.of("[PROJECT]", "[DASHBOARD]").toString()) + * .build(); + * dashboardsServiceClient.deleteDashboard(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -270,6 +396,19 @@ public final void deleteDashboard(DeleteDashboardRequest request) { * dashboard. For more information, see [Google Cloud IAM](https://cloud.google.com/iam). * *
Sample code: + * + *
{@code + * try (DashboardsServiceClient dashboardsServiceClient = DashboardsServiceClient.create()) { + * DeleteDashboardRequest request = + * DeleteDashboardRequest.newBuilder() + * .setName(DashboardName.of("[PROJECT]", "[DASHBOARD]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dashboardsServiceClient.deleteDashboardCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
This method requires the `monitoring.dashboards.update` permission on the specified * dashboard. For more information, see [Google Cloud IAM](https://cloud.google.com/iam). * + *
Sample code: + * + *
{@code + * try (DashboardsServiceClient dashboardsServiceClient = DashboardsServiceClient.create()) { + * UpdateDashboardRequest request = + * UpdateDashboardRequest.newBuilder().setDashboard(Dashboard.newBuilder().build()).build(); + * Dashboard response = dashboardsServiceClient.updateDashboard(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -297,6 +446,17 @@ public final Dashboard updateDashboard(UpdateDashboardRequest request) { * dashboard. For more information, see [Google Cloud IAM](https://cloud.google.com/iam). * *
Sample code: + * + *
{@code + * try (DashboardsServiceClient dashboardsServiceClient = DashboardsServiceClient.create()) { + * UpdateDashboardRequest request = + * UpdateDashboardRequest.newBuilder().setDashboard(Dashboard.newBuilder().build()).build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dashboardsServiceClient.updateDashboardCallable().futureCall(request); + * // Do something. + * Dashboard response = future.get(); + * } + * }
Sample for DashboardsServiceClient: + * + *
{@code + * try (DashboardsServiceClient dashboardsServiceClient = DashboardsServiceClient.create()) { + * CreateDashboardRequest request = + * CreateDashboardRequest.newBuilder() + * .setParent("parent-995424086") + * .setDashboard(Dashboard.newBuilder().build()) + * .build(); + * Dashboard response = dashboardsServiceClient.createDashboard(request); + * } + * }*/ @Generated("by gapic-generator-java") package com.google.cloud.monitoring.dashboard.v1; diff --git a/synth.metadata b/synth.metadata index e56e2368..09488560 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-monitoring-dashboards.git", - "sha": "50c2bfcff3d439211e2e1f44d1903afc487aa5a4" + "sha": "dbdb5dcd94cd94953a768a228b5e4d9a4c840d72" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "91e206bcfeaf8948ea03fe3cb1b7616108496cd3", - "internalRef": "350949863" + "sha": "8d8c008e56f1af31d57f75561e0f1848ffb29eeb", + "internalRef": "356341083" } }, {