Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regenerate monitoring client #4747

Merged
merged 1 commit into from
Mar 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ package google.monitoring.v3;
import "google/api/annotations.proto";

option go_package = "google.golang.org/genproto/googleapis/monitoring/v3;monitoring";
option java_multiple_files = true;
option java_outer_classname = "DroppedLabelsProto";
option java_package = "com.google.monitoring.v3";

// A set of (label, value) pairs which were dropped during aggregation, attached
// to google.api.Distribution.Exemplars in google.api.Distribution values during
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import com.google.monitoring.v3.ListUptimeCheckIpsResponse;
import com.google.monitoring.v3.UpdateUptimeCheckConfigRequest;
import com.google.monitoring.v3.UptimeCheckConfig;
import com.google.monitoring.v3.UptimeCheckConfigName;
import com.google.monitoring.v3.UptimeCheckIp;
import com.google.protobuf.Empty;
import java.io.IOException;
Expand All @@ -59,8 +60,8 @@
* <pre>
* <code>
* try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
* String formattedName = UptimeCheckConfigName.format("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
* UptimeCheckConfig response = uptimeCheckServiceClient.getUptimeCheckConfig(formattedName);
* UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
* UptimeCheckConfig response = uptimeCheckServiceClient.getUptimeCheckConfig(name);
* }
* </code>
* </pre>
Expand Down Expand Up @@ -289,8 +290,34 @@ public final ListUptimeCheckConfigsPagedResponse listUptimeCheckConfigs(
*
* <pre><code>
* try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
* String formattedName = UptimeCheckConfigName.format("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
* UptimeCheckConfig response = uptimeCheckServiceClient.getUptimeCheckConfig(formattedName);
* UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
* UptimeCheckConfig response = uptimeCheckServiceClient.getUptimeCheckConfig(name);
* }
* </code></pre>
*
* @param name The uptime check configuration to retrieve. The format is
* `projects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_ID]`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final UptimeCheckConfig getUptimeCheckConfig(UptimeCheckConfigName name) {

GetUptimeCheckConfigRequest request =
GetUptimeCheckConfigRequest.newBuilder()
.setName(name == null ? null : name.toString())
.build();
return getUptimeCheckConfig(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Gets a single uptime check configuration.
*
* <p>Sample code:
*
* <pre><code>
* try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
* UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
* UptimeCheckConfig response = uptimeCheckServiceClient.getUptimeCheckConfig(name.toString());
* }
* </code></pre>
*
Expand All @@ -313,9 +340,9 @@ public final UptimeCheckConfig getUptimeCheckConfig(String name) {
*
* <pre><code>
* try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
* String formattedName = UptimeCheckConfigName.format("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
* UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
* GetUptimeCheckConfigRequest request = GetUptimeCheckConfigRequest.newBuilder()
* .setName(formattedName)
* .setName(name.toString())
* .build();
* UptimeCheckConfig response = uptimeCheckServiceClient.getUptimeCheckConfig(request);
* }
Expand All @@ -336,9 +363,9 @@ public final UptimeCheckConfig getUptimeCheckConfig(GetUptimeCheckConfigRequest
*
* <pre><code>
* try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
* String formattedName = UptimeCheckConfigName.format("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
* UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
* GetUptimeCheckConfigRequest request = GetUptimeCheckConfigRequest.newBuilder()
* .setName(formattedName)
* .setName(name.toString())
* .build();
* ApiFuture&lt;UptimeCheckConfig&gt; future = uptimeCheckServiceClient.getUptimeCheckConfigCallable().futureCall(request);
* // Do something
Expand Down Expand Up @@ -523,8 +550,36 @@ public final UptimeCheckConfig updateUptimeCheckConfig(UpdateUptimeCheckConfigRe
*
* <pre><code>
* try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
* String formattedName = UptimeCheckConfigName.format("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
* uptimeCheckServiceClient.deleteUptimeCheckConfig(formattedName);
* UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
* uptimeCheckServiceClient.deleteUptimeCheckConfig(name);
* }
* </code></pre>
*
* @param name The uptime check configuration to delete. The format is
* `projects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_ID]`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final void deleteUptimeCheckConfig(UptimeCheckConfigName name) {

DeleteUptimeCheckConfigRequest request =
DeleteUptimeCheckConfigRequest.newBuilder()
.setName(name == null ? null : name.toString())
.build();
deleteUptimeCheckConfig(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Deletes an uptime check configuration. Note that this method will fail if the uptime check
* configuration is referenced by an alert policy or other dependent configs that would be
* rendered invalid by the deletion.
*
* <p>Sample code:
*
* <pre><code>
* try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
* UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
* uptimeCheckServiceClient.deleteUptimeCheckConfig(name.toString());
* }
* </code></pre>
*
Expand All @@ -549,9 +604,9 @@ public final void deleteUptimeCheckConfig(String name) {
*
* <pre><code>
* try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
* String formattedName = UptimeCheckConfigName.format("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
* UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
* DeleteUptimeCheckConfigRequest request = DeleteUptimeCheckConfigRequest.newBuilder()
* .setName(formattedName)
* .setName(name.toString())
* .build();
* uptimeCheckServiceClient.deleteUptimeCheckConfig(request);
* }
Expand All @@ -574,9 +629,9 @@ public final void deleteUptimeCheckConfig(DeleteUptimeCheckConfigRequest request
*
* <pre><code>
* try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
* String formattedName = UptimeCheckConfigName.format("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
* UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
* DeleteUptimeCheckConfigRequest request = DeleteUptimeCheckConfigRequest.newBuilder()
* .setName(formattedName)
* .setName(name.toString())
* .build();
* ApiFuture&lt;Void&gt; future = uptimeCheckServiceClient.deleteUptimeCheckConfigCallable().futureCall(request);
* // Do something
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@
* <pre>
* <code>
* try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
* String formattedName = UptimeCheckConfigName.format("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
* UptimeCheckConfig response = uptimeCheckServiceClient.getUptimeCheckConfig(formattedName);
* UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
* UptimeCheckConfig response = uptimeCheckServiceClient.getUptimeCheckConfig(name);
* }
* </code>
* </pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,16 +166,16 @@ public void getUptimeCheckConfigTest() {
.build();
mockUptimeCheckService.addResponse(expectedResponse);

String formattedName = UptimeCheckConfigName.format("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");

UptimeCheckConfig actualResponse = client.getUptimeCheckConfig(formattedName);
UptimeCheckConfig actualResponse = client.getUptimeCheckConfig(name);
Assert.assertEquals(expectedResponse, actualResponse);

List<GeneratedMessageV3> actualRequests = mockUptimeCheckService.getRequests();
Assert.assertEquals(1, actualRequests.size());
GetUptimeCheckConfigRequest actualRequest = (GetUptimeCheckConfigRequest) actualRequests.get(0);

Assert.assertEquals(formattedName, actualRequest.getName());
Assert.assertEquals(name, UptimeCheckConfigName.parse(actualRequest.getName()));
Assert.assertTrue(
channelProvider.isHeaderSent(
ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
Expand All @@ -189,9 +189,9 @@ public void getUptimeCheckConfigExceptionTest() throws Exception {
mockUptimeCheckService.addException(exception);

try {
String formattedName = UptimeCheckConfigName.format("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");

client.getUptimeCheckConfig(formattedName);
client.getUptimeCheckConfig(name);
Assert.fail("No exception raised");
} catch (InvalidArgumentException e) {
// Expected exception
Expand Down Expand Up @@ -302,16 +302,16 @@ public void deleteUptimeCheckConfigTest() {
Empty expectedResponse = Empty.newBuilder().build();
mockUptimeCheckService.addResponse(expectedResponse);

String formattedName = UptimeCheckConfigName.format("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");

client.deleteUptimeCheckConfig(formattedName);
client.deleteUptimeCheckConfig(name);

List<GeneratedMessageV3> actualRequests = mockUptimeCheckService.getRequests();
Assert.assertEquals(1, actualRequests.size());
DeleteUptimeCheckConfigRequest actualRequest =
(DeleteUptimeCheckConfigRequest) actualRequests.get(0);

Assert.assertEquals(formattedName, actualRequest.getName());
Assert.assertEquals(name, UptimeCheckConfigName.parse(actualRequest.getName()));
Assert.assertTrue(
channelProvider.isHeaderSent(
ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
Expand All @@ -325,9 +325,9 @@ public void deleteUptimeCheckConfigExceptionTest() throws Exception {
mockUptimeCheckService.addException(exception);

try {
String formattedName = UptimeCheckConfigName.format("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");

client.deleteUptimeCheckConfig(formattedName);
client.deleteUptimeCheckConfig(name);
Assert.fail("No exception raised");
} catch (InvalidArgumentException e) {
// Expected exception
Expand Down
10 changes: 5 additions & 5 deletions google-cloud-clients/google-cloud-monitoring/synth.metadata
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"updateTime": "2019-03-06T08:47:52.711546Z",
"updateTime": "2019-03-27T07:50:46.085733Z",
"sources": [
{
"generator": {
"name": "artman",
"version": "0.16.15",
"dockerImage": "googleapis/artman@sha256:9caadfa59d48224cba5f3217eb9d61a155b78ccf31e628abef385bc5b7ed3bd2"
"version": "0.16.19",
"dockerImage": "googleapis/artman@sha256:70ba28fda87e032ae44e6df41b7fc342c1b0cce1ed90658c4890eb4f613038c2"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "856117505ff9075b3e9c0b5674113667b6cf9e00",
"internalRef": "236931378"
"sha": "d4d57d766601105478c661132f2687e6984b92d5",
"internalRef": "240469931"
}
}
],
Expand Down