diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/ConfigSettings.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/ConfigSettings.java index 4d1c7aee2..a741361c3 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/ConfigSettings.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/ConfigSettings.java @@ -73,8 +73,12 @@ * * ConfigSettings.Builder configSettingsBuilder = * ConfigSettings.newBuilder(); - * configSettingsBuilder.getSinkSettings().getRetrySettings().toBuilder() - * .setTotalTimeout(Duration.ofSeconds(30)); + * configSettingsBuilder + * .getSinkSettings() + * .setRetrySettings( + * configSettingsBuilder.getSinkSettings().getRetrySettings().toBuilder() + * .setTotalTimeout(Duration.ofSeconds(30)) + * .build()); * ConfigSettings configSettings = configSettingsBuilder.build(); * * diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/LoggingSettings.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/LoggingSettings.java index 4545aec9f..e1f26543c 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/LoggingSettings.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/LoggingSettings.java @@ -67,8 +67,12 @@ * * LoggingSettings.Builder loggingSettingsBuilder = * LoggingSettings.newBuilder(); - * loggingSettingsBuilder.deleteLogSettings().getRetrySettings().toBuilder() - * .setTotalTimeout(Duration.ofSeconds(30)); + * loggingSettingsBuilder + * .deleteLogSettings() + * .setRetrySettings( + * loggingSettingsBuilder.deleteLogSettings().getRetrySettings().toBuilder() + * .setTotalTimeout(Duration.ofSeconds(30)) + * .build()); * LoggingSettings loggingSettings = loggingSettingsBuilder.build(); * * diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/MetricsSettings.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/MetricsSettings.java index f978adb6b..03341b0fc 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/MetricsSettings.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/MetricsSettings.java @@ -62,8 +62,12 @@ * * MetricsSettings.Builder metricsSettingsBuilder = * MetricsSettings.newBuilder(); - * metricsSettingsBuilder.getLogMetricSettings().getRetrySettings().toBuilder() - * .setTotalTimeout(Duration.ofSeconds(30)); + * metricsSettingsBuilder + * .getLogMetricSettings() + * .setRetrySettings( + * metricsSettingsBuilder.getLogMetricSettings().getRetrySettings().toBuilder() + * .setTotalTimeout(Duration.ofSeconds(30)) + * .build()); * MetricsSettings metricsSettings = metricsSettingsBuilder.build(); * * diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java index c3c170ee8..3953e3e5e 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java @@ -88,8 +88,12 @@ * * ConfigServiceV2StubSettings.Builder configSettingsBuilder = * ConfigServiceV2StubSettings.newBuilder(); - * configSettingsBuilder.getSinkSettings().getRetrySettings().toBuilder() - * .setTotalTimeout(Duration.ofSeconds(30)); + * configSettingsBuilder + * .getSinkSettings() + * .setRetrySettings( + * configSettingsBuilder.getSinkSettings().getRetrySettings().toBuilder() + * .setTotalTimeout(Duration.ofSeconds(30)) + * .build()); * ConfigServiceV2StubSettings configSettings = configSettingsBuilder.build(); * * diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java index c19f3beae..4a8777ba5 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java @@ -92,8 +92,12 @@ * * LoggingServiceV2StubSettings.Builder loggingSettingsBuilder = * LoggingServiceV2StubSettings.newBuilder(); - * loggingSettingsBuilder.deleteLogSettings().getRetrySettings().toBuilder() - * .setTotalTimeout(Duration.ofSeconds(30)); + * loggingSettingsBuilder + * .deleteLogSettings() + * .setRetrySettings( + * loggingSettingsBuilder.deleteLogSettings().getRetrySettings().toBuilder() + * .setTotalTimeout(Duration.ofSeconds(30)) + * .build()); * LoggingServiceV2StubSettings loggingSettings = loggingSettingsBuilder.build(); * * diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java index 046d704b1..5327a9d9d 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java @@ -77,8 +77,12 @@ * * MetricsServiceV2StubSettings.Builder metricsSettingsBuilder = * MetricsServiceV2StubSettings.newBuilder(); - * metricsSettingsBuilder.getLogMetricSettings().getRetrySettings().toBuilder() - * .setTotalTimeout(Duration.ofSeconds(30)); + * metricsSettingsBuilder + * .getLogMetricSettings() + * .setRetrySettings( + * metricsSettingsBuilder.getLogMetricSettings().getRetrySettings().toBuilder() + * .setTotalTimeout(Duration.ofSeconds(30)) + * .build()); * MetricsServiceV2StubSettings metricsSettings = metricsSettingsBuilder.build(); * * diff --git a/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/ConfigClientTest.java b/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/ConfigClientTest.java index fe91f2b1d..046c428bf 100644 --- a/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/ConfigClientTest.java +++ b/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/ConfigClientTest.java @@ -28,12 +28,14 @@ import com.google.api.resourcenames.ResourceName; import com.google.common.collect.Lists; import com.google.logging.v2.BillingName; +import com.google.logging.v2.CmekSettings; import com.google.logging.v2.CreateExclusionRequest; import com.google.logging.v2.CreateSinkRequest; import com.google.logging.v2.DeleteExclusionRequest; import com.google.logging.v2.DeleteSinkRequest; import com.google.logging.v2.ExclusionName; import com.google.logging.v2.ExclusionNames; +import com.google.logging.v2.GetCmekSettingsRequest; import com.google.logging.v2.GetExclusionRequest; import com.google.logging.v2.GetSinkRequest; import com.google.logging.v2.ListExclusionsRequest; @@ -49,6 +51,7 @@ import com.google.logging.v2.ProjectSinkName; import com.google.logging.v2.SinkName; import com.google.logging.v2.SinkNames; +import com.google.logging.v2.UpdateCmekSettingsRequest; import com.google.logging.v2.UpdateExclusionRequest; import com.google.logging.v2.UpdateSinkRequest; import com.google.protobuf.AbstractMessage; @@ -658,4 +661,94 @@ public void deleteExclusionExceptionTest() throws Exception { // Expected exception } } + + @Test + @SuppressWarnings("all") + public void getCmekSettingsTest() { + String name = "name3373707"; + String kmsKeyName = "kmsKeyName2094986649"; + String serviceAccountId = "serviceAccountId-111486921"; + CmekSettings expectedResponse = + CmekSettings.newBuilder() + .setName(name) + .setKmsKeyName(kmsKeyName) + .setServiceAccountId(serviceAccountId) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + GetCmekSettingsRequest request = GetCmekSettingsRequest.newBuilder().build(); + + CmekSettings actualResponse = client.getCmekSettings(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetCmekSettingsRequest actualRequest = (GetCmekSettingsRequest) actualRequests.get(0); + + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getCmekSettingsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + GetCmekSettingsRequest request = GetCmekSettingsRequest.newBuilder().build(); + + client.getCmekSettings(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateCmekSettingsTest() { + String name = "name3373707"; + String kmsKeyName = "kmsKeyName2094986649"; + String serviceAccountId = "serviceAccountId-111486921"; + CmekSettings expectedResponse = + CmekSettings.newBuilder() + .setName(name) + .setKmsKeyName(kmsKeyName) + .setServiceAccountId(serviceAccountId) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + UpdateCmekSettingsRequest request = UpdateCmekSettingsRequest.newBuilder().build(); + + CmekSettings actualResponse = client.updateCmekSettings(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateCmekSettingsRequest actualRequest = (UpdateCmekSettingsRequest) actualRequests.get(0); + + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateCmekSettingsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + UpdateCmekSettingsRequest request = UpdateCmekSettingsRequest.newBuilder().build(); + + client.updateCmekSettings(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } } diff --git a/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/LoggingClientTest.java b/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/LoggingClientTest.java index 278b7967c..d3bb71b2d 100644 --- a/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/LoggingClientTest.java +++ b/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/LoggingClientTest.java @@ -17,8 +17,10 @@ import static com.google.cloud.logging.v2.LoggingClient.ListLogEntriesPagedResponse; import static com.google.cloud.logging.v2.LoggingClient.ListLogsPagedResponse; +import static com.google.cloud.logging.v2.LoggingClient.ListMonitoredResourceDescriptorsPagedResponse; import com.google.api.MonitoredResource; +import com.google.api.MonitoredResourceDescriptor; import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.grpc.GaxGrpcProperties; import com.google.api.gax.grpc.testing.LocalChannelProvider; @@ -32,6 +34,8 @@ import com.google.logging.v2.ListLogEntriesResponse; import com.google.logging.v2.ListLogsRequest; import com.google.logging.v2.ListLogsResponse; +import com.google.logging.v2.ListMonitoredResourceDescriptorsRequest; +import com.google.logging.v2.ListMonitoredResourceDescriptorsResponse; import com.google.logging.v2.LogEntry; import com.google.logging.v2.LogName; import com.google.logging.v2.LogNames; @@ -243,6 +247,60 @@ public void listLogEntriesExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void listMonitoredResourceDescriptorsTest() { + String nextPageToken = ""; + MonitoredResourceDescriptor resourceDescriptorsElement = + MonitoredResourceDescriptor.newBuilder().build(); + List resourceDescriptors = + Arrays.asList(resourceDescriptorsElement); + ListMonitoredResourceDescriptorsResponse expectedResponse = + ListMonitoredResourceDescriptorsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllResourceDescriptors(resourceDescriptors) + .build(); + mockLoggingServiceV2.addResponse(expectedResponse); + + ListMonitoredResourceDescriptorsRequest request = + ListMonitoredResourceDescriptorsRequest.newBuilder().build(); + + ListMonitoredResourceDescriptorsPagedResponse pagedListResponse = + client.listMonitoredResourceDescriptors(request); + + List resources = + Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getResourceDescriptorsList().get(0), resources.get(0)); + + List actualRequests = mockLoggingServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListMonitoredResourceDescriptorsRequest actualRequest = + (ListMonitoredResourceDescriptorsRequest) actualRequests.get(0); + + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listMonitoredResourceDescriptorsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLoggingServiceV2.addException(exception); + + try { + ListMonitoredResourceDescriptorsRequest request = + ListMonitoredResourceDescriptorsRequest.newBuilder().build(); + + client.listMonitoredResourceDescriptors(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void listLogsTest() { diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingMetricsProto.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingMetricsProto.java index e468d1412..75211a542 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingMetricsProto.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingMetricsProto.java @@ -100,47 +100,47 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + ".v2.LogMetric\022\027\n\017next_page_token\030\002 \001(\t\"Q" + "\n\023GetLogMetricRequest\022:\n\013metric_name\030\001 \001" + "(\tB%\340A\002\372A\037\n\035logging.googleapis.com/Metri" - + "c\"\217\001\n\026CreateLogMetricRequest\022B\n\006parent\030\001" - + " \001(\tB2\340A\002\372A,\n*cloudresourcemanager.googl" - + "eapis.com/Metric\0221\n\006metric\030\002 \001(\0132\034.googl" - + "e.logging.v2.LogMetricB\003\340A\002\"\207\001\n\026UpdateLo" - + "gMetricRequest\022:\n\013metric_name\030\001 \001(\tB%\340A\002" - + "\372A\037\n\035logging.googleapis.com/Metric\0221\n\006me" - + "tric\030\002 \001(\0132\034.google.logging.v2.LogMetric" - + "B\003\340A\002\"T\n\026DeleteLogMetricRequest\022:\n\013metri" - + "c_name\030\001 \001(\tB%\340A\002\372A\037\n\035logging.googleapis" - + ".com/Metric2\256\010\n\020MetricsServiceV2\022\227\001\n\016Lis" - + "tLogMetrics\022(.google.logging.v2.ListLogM" - + "etricsRequest\032).google.logging.v2.ListLo" - + "gMetricsResponse\"0\202\323\344\223\002!\022\037/v2/{parent=pr" - + "ojects/*}/metrics\332A\006parent\022\222\001\n\014GetLogMet" - + "ric\022&.google.logging.v2.GetLogMetricRequ" - + "est\032\034.google.logging.v2.LogMetric\"<\202\323\344\223\002" - + "(\022&/v2/{metric_name=projects/*/metrics/*" - + "}\332A\013metric_name\022\233\001\n\017CreateLogMetric\022).go" - + "ogle.logging.v2.CreateLogMetricRequest\032\034" - + ".google.logging.v2.LogMetric\"?\202\323\344\223\002)\"\037/v" - + "2/{parent=projects/*}/metrics:\006metric\332A\r" - + "parent,metric\022\247\001\n\017UpdateLogMetric\022).goog" - + "le.logging.v2.UpdateLogMetricRequest\032\034.g" - + "oogle.logging.v2.LogMetric\"K\202\323\344\223\0020\032&/v2/" - + "{metric_name=projects/*/metrics/*}:\006metr" - + "ic\332A\022metric_name,metric\022\222\001\n\017DeleteLogMet" - + "ric\022).google.logging.v2.DeleteLogMetricR" - + "equest\032\026.google.protobuf.Empty\"<\202\323\344\223\002(*&" - + "/v2/{metric_name=projects/*/metrics/*}\332A" - + "\013metric_name\032\215\002\312A\026logging.googleapis.com" - + "\322A\360\001https://www.googleapis.com/auth/clou" - + "d-platform,https://www.googleapis.com/au" - + "th/cloud-platform.read-only,https://www." - + "googleapis.com/auth/logging.admin,https:" - + "//www.googleapis.com/auth/logging.read,h" - + "ttps://www.googleapis.com/auth/logging.w" - + "riteB\237\001\n\025com.google.logging.v2B\023LoggingM" - + "etricsProtoP\001Z8google.golang.org/genprot" - + "o/googleapis/logging/v2;logging\370\001\001\252\002\027Goo" - + "gle.Cloud.Logging.V2\312\002\027Google\\Cloud\\Logg" - + "ing\\V2b\006proto3" + + "c\"\202\001\n\026CreateLogMetricRequest\0225\n\006parent\030\001" + + " \001(\tB%\340A\002\372A\037\n\035logging.googleapis.com/Met" + + "ric\0221\n\006metric\030\002 \001(\0132\034.google.logging.v2." + + "LogMetricB\003\340A\002\"\207\001\n\026UpdateLogMetricReques" + + "t\022:\n\013metric_name\030\001 \001(\tB%\340A\002\372A\037\n\035logging." + + "googleapis.com/Metric\0221\n\006metric\030\002 \001(\0132\034." + + "google.logging.v2.LogMetricB\003\340A\002\"T\n\026Dele" + + "teLogMetricRequest\022:\n\013metric_name\030\001 \001(\tB" + + "%\340A\002\372A\037\n\035logging.googleapis.com/Metric2\256" + + "\010\n\020MetricsServiceV2\022\227\001\n\016ListLogMetrics\022(" + + ".google.logging.v2.ListLogMetricsRequest" + + "\032).google.logging.v2.ListLogMetricsRespo" + + "nse\"0\202\323\344\223\002!\022\037/v2/{parent=projects/*}/met" + + "rics\332A\006parent\022\222\001\n\014GetLogMetric\022&.google." + + "logging.v2.GetLogMetricRequest\032\034.google." + + "logging.v2.LogMetric\"<\202\323\344\223\002(\022&/v2/{metri" + + "c_name=projects/*/metrics/*}\332A\013metric_na" + + "me\022\233\001\n\017CreateLogMetric\022).google.logging." + + "v2.CreateLogMetricRequest\032\034.google.loggi" + + "ng.v2.LogMetric\"?\202\323\344\223\002)\"\037/v2/{parent=pro" + + "jects/*}/metrics:\006metric\332A\rparent,metric" + + "\022\247\001\n\017UpdateLogMetric\022).google.logging.v2" + + ".UpdateLogMetricRequest\032\034.google.logging" + + ".v2.LogMetric\"K\202\323\344\223\0020\032&/v2/{metric_name=" + + "projects/*/metrics/*}:\006metric\332A\022metric_n" + + "ame,metric\022\222\001\n\017DeleteLogMetric\022).google." + + "logging.v2.DeleteLogMetricRequest\032\026.goog" + + "le.protobuf.Empty\"<\202\323\344\223\002(*&/v2/{metric_n" + + "ame=projects/*/metrics/*}\332A\013metric_name\032" + + "\215\002\312A\026logging.googleapis.com\322A\360\001https://w" + + "ww.googleapis.com/auth/cloud-platform,ht" + + "tps://www.googleapis.com/auth/cloud-plat" + + "form.read-only,https://www.googleapis.co" + + "m/auth/logging.admin,https://www.googlea" + + "pis.com/auth/logging.read,https://www.go" + + "ogleapis.com/auth/logging.writeB\237\001\n\025com." + + "google.logging.v2B\023LoggingMetricsProtoP\001" + + "Z8google.golang.org/genproto/googleapis/" + + "logging/v2;logging\370\001\001\252\002\027Google.Cloud.Log" + + "ging.V2\312\002\027Google\\Cloud\\Logging\\V2b\006proto" + + "3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingProto.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingProto.java index 02be70b7f..79dc71528 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingProto.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingProto.java @@ -85,15 +85,15 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { "\n\037google/logging/v2/logging.proto\022\021googl" - + "e.logging.v2\032\027google/api/client.proto\032\037g" - + "oogle/api/field_behavior.proto\032#google/a" - + "pi/monitored_resource.proto\032\031google/api/" - + "resource.proto\032!google/logging/v2/log_en" - + "try.proto\032&google/logging/v2/logging_con" - + "fig.proto\032\036google/protobuf/duration.prot" - + "o\032\033google/protobuf/empty.proto\032\037google/p" - + "rotobuf/timestamp.proto\032\027google/rpc/stat" - + "us.proto\032\034google/api/annotations.proto\"H" + + "e.logging.v2\032\034google/api/annotations.pro" + + "to\032\027google/api/client.proto\032\037google/api/" + + "field_behavior.proto\032#google/api/monitor" + + "ed_resource.proto\032\031google/api/resource.p" + + "roto\032!google/logging/v2/log_entry.proto\032" + + "&google/logging/v2/logging_config.proto\032" + + "\036google/protobuf/duration.proto\032\033google/" + + "protobuf/empty.proto\032\037google/protobuf/ti" + + "mestamp.proto\032\027google/rpc/status.proto\"H" + "\n\020DeleteLogRequest\0224\n\010log_name\030\001 \001(\tB\"\340A" + "\002\372A\034\022\032logging.googleapis.com/Log\"\317\002\n\026Wri" + "teLogEntriesRequest\0221\n\010log_name\030\001 \001(\tB\037\372" @@ -126,7 +126,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "est\022/\n\006parent\030\001 \001(\tB\037\372A\034\022\032logging.google" + "apis.com/Log\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_" + "token\030\003 \001(\t\">\n\020ListLogsResponse\022\021\n\tlog_n" - + "ames\030\003 \003(\t\022\027\n\017next_page_token\030\002 \001(\t2\274\n\n\020" + + "ames\030\003 \003(\t\022\027\n\017next_page_token\030\002 \001(\t2\335\n\n\020" + "LoggingServiceV2\022\223\002\n\tDeleteLog\022#.google." + "logging.v2.DeleteLogRequest\032\026.google.pro" + "tobuf.Empty\"\310\001\202\323\344\223\002\266\001* /v2/{log_name=pro" @@ -138,38 +138,40 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "gle.logging.v2.WriteLogEntriesRequest\032*." + "google.logging.v2.WriteLogEntriesRespons" + "e\"?\202\323\344\223\002\026\"\021/v2/entries:write:\001*\332A log_na" - + "me,resource,labels,entries\022\202\001\n\016ListLogEn" + + "me,resource,labels,entries\022\243\001\n\016ListLogEn" + "tries\022(.google.logging.v2.ListLogEntries" + "Request\032).google.logging.v2.ListLogEntri" - + "esResponse\"\033\202\323\344\223\002\025\"\020/v2/entries:list:\001*\022" - + "\305\001\n ListMonitoredResourceDescriptors\022:.g" - + "oogle.logging.v2.ListMonitoredResourceDe" - + "scriptorsRequest\032;.google.logging.v2.Lis" - + "tMonitoredResourceDescriptorsResponse\"(\202" - + "\323\344\223\002\"\022 /v2/monitoredResourceDescriptors\022" - + "\210\002\n\010ListLogs\022\".google.logging.v2.ListLog" - + "sRequest\032#.google.logging.v2.ListLogsRes" - + "ponse\"\262\001\202\323\344\223\002\242\001\022\025/v2/{parent=*/*}/logsZ\036" - + "\022\034/v2/{parent=projects/*}/logsZ#\022!/v2/{p" - + "arent=organizations/*}/logsZ\035\022\033/v2/{pare" - + "nt=folders/*}/logsZ%\022#/v2/{parent=billin" - + "gAccounts/*}/logs\332A\006parent\032\215\002\312A\026logging." - + "googleapis.com\322A\360\001https://www.googleapis" - + ".com/auth/cloud-platform,https://www.goo" - + "gleapis.com/auth/cloud-platform.read-onl" - + "y,https://www.googleapis.com/auth/loggin" - + "g.admin,https://www.googleapis.com/auth/" - + "logging.read,https://www.googleapis.com/" - + "auth/logging.writeB\230\001\n\025com.google.loggin" - + "g.v2B\014LoggingProtoP\001Z8google.golang.org/" - + "genproto/googleapis/logging/v2;logging\370\001" - + "\001\252\002\027Google.Cloud.Logging.V2\312\002\027Google\\Clo" - + "ud\\Logging\\V2b\006proto3" + + "esResponse\"<\202\323\344\223\002\025\"\020/v2/entries:list:\001*\332" + + "A\036resource_names,filter,order_by\022\305\001\n Lis" + + "tMonitoredResourceDescriptors\022:.google.l" + + "ogging.v2.ListMonitoredResourceDescripto" + + "rsRequest\032;.google.logging.v2.ListMonito" + + "redResourceDescriptorsResponse\"(\202\323\344\223\002\"\022 " + + "/v2/monitoredResourceDescriptors\022\210\002\n\010Lis" + + "tLogs\022\".google.logging.v2.ListLogsReques" + + "t\032#.google.logging.v2.ListLogsResponse\"\262" + + "\001\202\323\344\223\002\242\001\022\025/v2/{parent=*/*}/logsZ\036\022\034/v2/{" + + "parent=projects/*}/logsZ#\022!/v2/{parent=o" + + "rganizations/*}/logsZ\035\022\033/v2/{parent=fold" + + "ers/*}/logsZ%\022#/v2/{parent=billingAccoun" + + "ts/*}/logs\332A\006parent\032\215\002\312A\026logging.googlea" + + "pis.com\322A\360\001https://www.googleapis.com/au" + + "th/cloud-platform,https://www.googleapis" + + ".com/auth/cloud-platform.read-only,https" + + "://www.googleapis.com/auth/logging.admin" + + ",https://www.googleapis.com/auth/logging" + + ".read,https://www.googleapis.com/auth/lo" + + "gging.writeB\230\001\n\025com.google.logging.v2B\014L" + + "oggingProtoP\001Z8google.golang.org/genprot" + + "o/googleapis/logging/v2;logging\370\001\001\252\002\027Goo" + + "gle.Cloud.Logging.V2\312\002\027Google\\Cloud\\Logg" + + "ing\\V2b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), com.google.api.ClientProto.getDescriptor(), com.google.api.FieldBehaviorProto.getDescriptor(), com.google.api.MonitoredResourceProto.getDescriptor(), @@ -180,7 +182,6 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.protobuf.EmptyProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), com.google.rpc.StatusProto.getDescriptor(), - com.google.api.AnnotationsProto.getDescriptor(), }); internal_static_google_logging_v2_DeleteLogRequest_descriptor = getDescriptor().getMessageTypes().get(0); @@ -288,6 +289,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { registry.add(com.google.api.ResourceProto.resourceReference); com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); com.google.api.ClientProto.getDescriptor(); com.google.api.FieldBehaviorProto.getDescriptor(); com.google.api.MonitoredResourceProto.getDescriptor(); @@ -298,7 +300,6 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.protobuf.EmptyProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); com.google.rpc.StatusProto.getDescriptor(); - com.google.api.AnnotationsProto.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/logging.proto b/proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/logging.proto index 415750610..c3a524633 100644 --- a/proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/logging.proto +++ b/proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/logging.proto @@ -17,6 +17,7 @@ syntax = "proto3"; package google.logging.v2; +import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/monitored_resource.proto"; @@ -27,7 +28,6 @@ import "google/protobuf/duration.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/timestamp.proto"; import "google/rpc/status.proto"; -import "google/api/annotations.proto"; option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.Logging.V2"; @@ -93,6 +93,7 @@ service LoggingServiceV2 { post: "/v2/entries:list" body: "*" }; + option (google.api.method_signature) = "resource_names,filter,order_by"; } // Lists the descriptors for monitored resource types used by Logging. diff --git a/proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/logging_metrics.proto b/proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/logging_metrics.proto index 41fe2ea88..582c067e6 100644 --- a/proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/logging_metrics.proto +++ b/proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/logging_metrics.proto @@ -277,7 +277,7 @@ message CreateLogMetricRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Metric" + type: "logging.googleapis.com/Metric" } ]; diff --git a/synth.metadata b/synth.metadata index 674a00805..17222a7dc 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,27 +1,27 @@ { - "updateTime": "2020-02-07T22:54:59.373577Z", + "updateTime": "2020-02-10T22:51:49.312299Z", "sources": [ { "generator": { "name": "artman", - "version": "0.44.4", - "dockerImage": "googleapis/artman@sha256:19e945954fc960a4bdfee6cb34695898ab21a8cf0bac063ee39b91f00a1faec8" + "version": "0.45.0", + "dockerImage": "googleapis/artman@sha256:6aec9c34db0e4be221cdaf6faba27bdc07cfea846808b3d3b964dfce3a9a0f9b" } }, { "generator": { "name": "artman", - "version": "0.44.4", - "dockerImage": "googleapis/artman@sha256:19e945954fc960a4bdfee6cb34695898ab21a8cf0bac063ee39b91f00a1faec8" + "version": "0.45.0", + "dockerImage": "googleapis/artman@sha256:6aec9c34db0e4be221cdaf6faba27bdc07cfea846808b3d3b964dfce3a9a0f9b" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "1b83c92462b14d67a7644e2980f723112472e03a", - "internalRef": "293893514", - "log": "1b83c92462b14d67a7644e2980f723112472e03a\nPublish annotations and grpc service config for Logging API.\n\nPiperOrigin-RevId: 293893514\n\ne46f761cd6ec15a9e3d5ed4ff321a4bcba8e8585\nGenerate the Bazel build file for recommendengine public api\n\nPiperOrigin-RevId: 293710856\n\n68477017c4173c98addac0373950c6aa9d7b375f\nMake `language_code` optional for UpdateIntentRequest and BatchUpdateIntentsRequest.\n\nThe comments and proto annotations describe this parameter as optional.\n\nPiperOrigin-RevId: 293703548\n\n16f823f578bca4e845a19b88bb9bc5870ea71ab2\nAdd BUILD.bazel files for managedidentities API\n\nPiperOrigin-RevId: 293698246\n\n2f53fd8178c9a9de4ad10fae8dd17a7ba36133f2\nAdd v1p1beta1 config file\n\nPiperOrigin-RevId: 293696729\n\n052b274138fce2be80f97b6dcb83ab343c7c8812\nAdd source field for user event and add field behavior annotations\n\nPiperOrigin-RevId: 293693115\n\n1e89732b2d69151b1b3418fff3d4cc0434f0dded\ndatacatalog: v1beta1 add three new RPCs to gapic v1beta1 config\n\nPiperOrigin-RevId: 293692823\n\n9c8bd09bbdc7c4160a44f1fbab279b73cd7a2337\nchange the name of AccessApproval service to AccessApprovalAdmin\n\nPiperOrigin-RevId: 293690934\n\n2e23b8fbc45f5d9e200572ca662fe1271bcd6760\nAdd ListEntryGroups method, add http bindings to support entry group tagging, and update some comments.\n\nPiperOrigin-RevId: 293666452\n\n0275e38a4ca03a13d3f47a9613aac8c8b0d3f1f2\nAdd proto_package field to managedidentities API. It is needed for APIs that still depend on artman generation.\n\nPiperOrigin-RevId: 293643323\n\n4cdfe8278cb6f308106580d70648001c9146e759\nRegenerating public protos for Data Catalog to add new Custom Type Entry feature.\n\nPiperOrigin-RevId: 293614782\n\n45d2a569ab526a1fad3720f95eefb1c7330eaada\nEnable client generation for v1 ManagedIdentities API.\n\nPiperOrigin-RevId: 293515675\n\n2c17086b77e6f3bcf04a1f65758dfb0c3da1568f\nAdd the Actions on Google common types (//google/actions/type/*).\n\nPiperOrigin-RevId: 293478245\n\n781aadb932e64a12fb6ead7cd842698d99588433\nDialogflow weekly v2/v2beta1 library update:\n- Documentation updates\nImportant updates are also posted at\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 293443396\n\ne2602608c9138c2fca24162720e67f9307c30b95\nDialogflow weekly v2/v2beta1 library update:\n- Documentation updates\nImportant updates are also posted at\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 293442964\n\nc8aef82028d06b7992278fa9294c18570dc86c3d\nAdd cc_proto_library and cc_grpc_library targets for Bigtable protos.\n\nAlso fix indentation of cc_grpc_library targets in Spanner and IAM protos.\n\nPiperOrigin-RevId: 293440538\n\ne2faab04f4cb7f9755072330866689b1943a16e9\ncloudtasks: v2 replace non-standard retry params in gapic config v2\n\nPiperOrigin-RevId: 293424055\n\ndfb4097ea628a8470292c6590a4313aee0c675bd\nerrorreporting: v1beta1 add legacy artman config for php\n\nPiperOrigin-RevId: 293423790\n\nb18aed55b45bfe5b62476292c72759e6c3e573c6\nasset: v1p1beta1 updated comment for `page_size` limit.\n\nPiperOrigin-RevId: 293421386\n\nc9ef36b7956d9859a2fc86ad35fcaa16958ab44f\nbazel: Refactor CI build scripts\n\nPiperOrigin-RevId: 293387911\n\na8ed9d921fdddc61d8467bfd7c1668f0ad90435c\nfix: set Ruby module name for OrgPolicy\n\nPiperOrigin-RevId: 293257997\n\n6c7d28509bd8315de8af0889688ee20099594269\nredis: v1beta1 add UpgradeInstance and connect_mode field to Instance\n\nPiperOrigin-RevId: 293242878\n\nae0abed4fcb4c21f5cb67a82349a049524c4ef68\nredis: v1 add connect_mode field to Instance\n\nPiperOrigin-RevId: 293241914\n\n3f7a0d29b28ee9365771da2b66edf7fa2b4e9c56\nAdds service config definition for bigqueryreservation v1beta1\n\nPiperOrigin-RevId: 293234418\n\n0c88168d5ed6fe353a8cf8cbdc6bf084f6bb66a5\naddition of BUILD & configuration for accessapproval v1\n\nPiperOrigin-RevId: 293219198\n\n39bedc2e30f4778ce81193f6ba1fec56107bcfc4\naccessapproval: v1 publish protos\n\nPiperOrigin-RevId: 293167048\n\n69d9945330a5721cd679f17331a78850e2618226\nAdd file-level `Session` resource definition\n\nPiperOrigin-RevId: 293080182\n\nf6a1a6b417f39694275ca286110bc3c1ca4db0dc\nAdd file-level `Session` resource definition\n\nPiperOrigin-RevId: 293080178\n\n29d40b78e3dc1579b0b209463fbcb76e5767f72a\nExpose managedidentities/v1beta1/ API for client library usage.\n\nPiperOrigin-RevId: 292979741\n\na22129a1fb6e18056d576dfb7717aef74b63734a\nExpose managedidentities/v1/ API for client library usage.\n\nPiperOrigin-RevId: 292968186\n\n" + "sha": "fcc86bee0e84dc11e9abbff8d7c3529c0626f390", + "internalRef": "294264582", + "log": "fcc86bee0e84dc11e9abbff8d7c3529c0626f390\nfix: Bigtable Admin v2\n\nChange LRO metadata from PartialUpdateInstanceMetadata\nto UpdateInstanceMetadata. (Otherwise, it will not build.)\n\nPiperOrigin-RevId: 294264582\n\n6d9361eae2ebb3f42d8c7ce5baf4bab966fee7c0\nrefactor: Add annotations to Bigtable Admin v2.\n\nPiperOrigin-RevId: 294243406\n\nad7616f3fc8e123451c8b3a7987bc91cea9e6913\nFix: Resource type in CreateLogMetricRequest should use logging.googleapis.com.\nFix: ListLogEntries should have a method signature for convenience of calling it.\n\nPiperOrigin-RevId: 294222165\n\n63796fcbb08712676069e20a3e455c9f7aa21026\nFix: Remove extraneous resource definition for cloudkms.googleapis.com/CryptoKey.\n\nPiperOrigin-RevId: 294176658\n\ne7d8a694f4559201e6913f6610069cb08b39274e\nDepend on the latest gapic-generator and resource names plugin.\n\nThis fixes the very old an very annoying bug: https://github.com/googleapis/gapic-generator/pull/3087\n\nPiperOrigin-RevId: 293903652\n\n806b2854a966d55374ee26bb0cef4e30eda17b58\nfix: correct capitalization of Ruby namespaces in SecurityCenter V1p1beta1\n\nPiperOrigin-RevId: 293903613\n\n" } }, {