From 084830c09e807ea08ea924dfa1ad41bb9dcfe710 Mon Sep 17 00:00:00 2001 From: Arie Date: Tue, 17 Feb 2015 09:26:49 -0800 Subject: [PATCH 0001/1629] Create LICENSE --- LICENSE | 201 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 201 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000000..4eedc0116add --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. From 5a11507f0fba93ae788863bc4776444d46b2c112 Mon Sep 17 00:00:00 2001 From: Jisha Abubaker Date: Tue, 23 May 2017 12:01:55 -0700 Subject: [PATCH 0002/1629] Cloud logging logback appender (#2045) Logback support for google-cloud-logging --- .../google-cloud-logging-logback/README.md | 135 ++++++++++ .../google-cloud-logging-logback/pom.xml | 49 ++++ .../logging/logback/LoggingAppender.java | 255 ++++++++++++++++++ .../enhancers/AnotherTestLoggingEnhancer.java | 28 ++ .../enhancers/TestLoggingEnhancer.java | 28 ++ .../logging/logback/LoggingAppenderTest.java | 192 +++++++++++++ 6 files changed, 687 insertions(+) create mode 100644 google-cloud-contrib/google-cloud-logging-logback/README.md create mode 100644 google-cloud-contrib/google-cloud-logging-logback/pom.xml create mode 100644 google-cloud-contrib/google-cloud-logging-logback/src/main/java/com/google/cloud/logging/logback/LoggingAppender.java create mode 100644 google-cloud-contrib/google-cloud-logging-logback/src/test/java/com/example/enhancers/AnotherTestLoggingEnhancer.java create mode 100644 google-cloud-contrib/google-cloud-logging-logback/src/test/java/com/example/enhancers/TestLoggingEnhancer.java create mode 100644 google-cloud-contrib/google-cloud-logging-logback/src/test/java/com/google/cloud/logging/logback/LoggingAppenderTest.java diff --git a/google-cloud-contrib/google-cloud-logging-logback/README.md b/google-cloud-contrib/google-cloud-logging-logback/README.md new file mode 100644 index 000000000000..e69b8edaecf0 --- /dev/null +++ b/google-cloud-contrib/google-cloud-logging-logback/README.md @@ -0,0 +1,135 @@ +Logback Appender for Google Cloud Logging +========================================= + +Logback appender `com.google.cloud.logging.logback.LoggingAppender` for +[Google Cloud Logging](https://cloud.google.com/logging/). + +This library allows you to use [Logback](https://logback.qos.ch/) configuration and the [Slf4j](https://www.slf4j.org/) interface to log via Google Cloud logging. + +- [Homepage](https://googlecloudplatform.github.io/google-cloud-java/) +- [API Documentation](https://googlecloudplatform.github.io/google-cloud-java/apidocs/index.html?com/google/cloud/logging/logback/LoggingAppender.html) + +> Note: This client is a work-in-progress, and may occasionally +> make backwards-incompatible changes. + +Quickstart +---------- +If you are using Maven, add this to your pom.xml file +```xml + + com.google.cloud + google-cloud-logging-logback + 0.18.0-alpha + +``` +If you are using Gradle, add this to your dependencies +```Groovy +compile 'com.google.cloud:google-cloud-logging-logback:0.18.0-alpha' +``` +If you are using SBT, add this to your dependencies +```Scala +libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.18.0-alpha" +``` + +Usage +----- + +Add the appender to your [Logback configuration](https://logback.qos.ch/manual/configuration.html) `logback.xml`. +See [Logback filters](https://logback.qos.ch/manual/filters.html#thresholdFilter) for information on filtering log output and + [encoders](https://logback.qos.ch/manual/encoders.html) for information on formatting. + + +```xml + + + + + INFO + + application.log + com.example.enhancers.TestLoggingEnhancer + com.example.enhancers.AnotherEnhancer + WARN + + + + + + +``` + +In your code : + +```java +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TestLogger { + private final Logger logger = LoggerFactory.getLogger(TestLogger.class); + + public void log(String name) { + logger.info("This is a test"); + } + + public static void main(String[] args) { + TestLogger testLogger = new TestLogger(); + testLogger.log("test"); + } +} +``` + + +Authentication +-------------- + +See the [Authentication](https://github.com/GoogleCloudPlatform/google-cloud-java#authentication) +section in the base directory's README. + + +Limitations +----------- + +This library is usable, but not yet complete. +Open issues [here](https://github.com/GoogleCloudPlatform/google-cloud-java/issues?q=is%3Aissue+is%3Aopen+label%3A%22logging-logback%22). + + +Java Versions +------------- + +Java 7 or above is required for using this client. + +Versioning +---------- + +This library follows [Semantic Versioning](http://semver.org/). + +It is currently in major version zero (``0.y.z``), which means that anything +may change at any time and the public API should not be considered +stable. + +Contributing +------------ + +Contributions to this library are always welcome and highly encouraged. + +See `google-cloud`'s [CONTRIBUTING] documentation and the +[shared documentation](https://github.com/GoogleCloudPlatform/gcloud-common/blob/master/contributing/readme.md#how-to-contribute-to-gcloud) +for more information on how to get started. + +Please note that this project is released with a Contributor Code of Conduct. +By participating in this project you agree to abide by its terms. See +[Code of Conduct][code-of-conduct] for more information. + +License +------- +Apache 2.0 - See [LICENSE] for more information. + + +[CONTRIBUTING]:https://github.com/GoogleCloudPlatform/google-cloud-java/blob/master/CONTRIBUTING.md +[code-of-conduct]:https://github.com/GoogleCloudPlatform/google-cloud-java/blob/master/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[LICENSE]: https://github.com/GoogleCloudPlatform/google-cloud-java/blob/master/LICENSE +[TESTING]: https://github.com/GoogleCloudPlatform/google-cloud-java/blob/master/TESTING.md#testing-code-that-uses-storage +[cloud-platform]: https://cloud.google.com/ + +[cloud-logging]: https://cloud.google.com/logging/ +[cloud-logging-docs]: https://cloud.google.com/logging/docs/overview diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml new file mode 100644 index 000000000000..1c99617f1af0 --- /dev/null +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -0,0 +1,49 @@ + + + 4.0.0 + + google-cloud-logging-logback + 0.18.1-alpha-SNAPSHOT + jar + Google Cloud Logging Logback Appender + https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback + + Logback support for Google Cloud Logging + + + + 1.2.3 + + + + com.google.cloud + google-cloud-contrib + 0.18.1-alpha-SNAPSHOT + + + + ch.qos.logback + logback-classic + ${logback.version} + + + com.google.cloud + google-cloud-logging + + + + org.easymock + easymock + 3.4 + test + + + junit + junit + 4.12 + test + + + diff --git a/google-cloud-contrib/google-cloud-logging-logback/src/main/java/com/google/cloud/logging/logback/LoggingAppender.java b/google-cloud-contrib/google-cloud-logging-logback/src/main/java/com/google/cloud/logging/logback/LoggingAppender.java new file mode 100644 index 000000000000..4f6a38f1b081 --- /dev/null +++ b/google-cloud-contrib/google-cloud-logging-logback/src/main/java/com/google/cloud/logging/logback/LoggingAppender.java @@ -0,0 +1,255 @@ +/* + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.logback; + +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.spi.ILoggingEvent; +import ch.qos.logback.core.UnsynchronizedAppenderBase; +import com.google.cloud.MonitoredResource; +import com.google.cloud.logging.LogEntry; +import com.google.cloud.logging.Logging; +import com.google.cloud.logging.Logging.WriteOption; +import com.google.cloud.logging.LoggingEnhancer; +import com.google.cloud.logging.LoggingOptions; +import com.google.cloud.logging.MonitoredResourceUtil; +import com.google.cloud.logging.Payload; +import com.google.cloud.logging.Severity; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * Logback appender for StackDriver Cloud Logging. + * + *

Appender configuration in logback.xml: + * + *

+ */ +public class LoggingAppender extends UnsynchronizedAppenderBase { + + private static final String LEVEL_NAME_KEY = "levelName"; + private static final String LEVEL_VALUE_KEY = "levelValue"; + + private volatile Logging logging; + private List loggingEnhancers; + private WriteOption[] defaultWriteOptions; + + private Level flushLevel; + private String log; + private String resourceType; + private Set enhancerClassNames = new HashSet<>(); + + /** + * Batched logging requests get immediately flushed for logs at or above this level. + * + *

Defaults to Error if not set. + * + * @param flushLevel Logback log level + */ + public void setFlushLevel(Level flushLevel) { + this.flushLevel = flushLevel; + } + + /** + * Sets the log filename. + * + * @param log filename + */ + public void setLog(String log) { + this.log = log; + } + + /** + * Sets the name of the monitored resource (Optional). + * + *

Must be a supported + * resource type. gae_app, gce_instance and container are auto-detected. + * + *

Defaults to "global" + * + * @param resourceType name of the monitored resource + */ + public void setResourceType(String resourceType) { + this.resourceType = resourceType; + } + + /** + * Add extra labels using classes that implement {@link LoggingEnhancer}. + */ + public void addEnhancer(String enhancerClassName) { + this.enhancerClassNames.add(enhancerClassName); + } + + Level getFlushLevel() { + return (flushLevel != null) ? flushLevel : Level.ERROR; + } + + String getLogName() { + return (log != null) ? log : "java.log"; + } + + MonitoredResource getMonitoredResource(String projectId) { + return MonitoredResourceUtil.getResource(projectId, resourceType); + } + + List getLoggingEnhancers() { + List loggingEnhancers = new ArrayList<>(); + if (enhancerClassNames != null) { + for (String enhancerClassName : enhancerClassNames) { + if (enhancerClassName != null) { + LoggingEnhancer enhancer = getEnhancer(enhancerClassName); + if (enhancer != null) { + loggingEnhancers.add(enhancer); + } + } + } + } + return loggingEnhancers; + } + + private LoggingEnhancer getEnhancer(String enhancerClassName) { + try { + Class clz = + (Class) + ClassLoader.getSystemClassLoader().loadClass(enhancerClassName.trim()); + return clz.newInstance(); + } catch (Exception ex) { + // If we cannot create the enhancer we fallback to null + } + return null; + } + + /** + * Initialize and configure the cloud logging service. + */ + @Override + public synchronized void start() { + if (isStarted()) { + return; + } + MonitoredResource resource = getMonitoredResource(getProjectId()); + defaultWriteOptions = + new WriteOption[]{WriteOption.logName(getLogName()), WriteOption.resource(resource)}; + getLogging().setFlushSeverity(severityFor(getFlushLevel())); + loggingEnhancers = new ArrayList<>(); + List resourceEnhancers = MonitoredResourceUtil.getResourceEnhancers(); + loggingEnhancers.addAll(resourceEnhancers); + loggingEnhancers.addAll(getLoggingEnhancers()); + super.start(); + } + + String getProjectId() { + return LoggingOptions.getDefaultInstance().getProjectId(); + } + + @Override + protected void append(ILoggingEvent e) { + LogEntry logEntry = logEntryFor(e); + getLogging().write(Collections.singleton(logEntry), defaultWriteOptions); + } + + @Override + public synchronized void stop() { + if (logging != null) { + try { + logging.close(); + } catch (Exception ex) { + // ignore + } + } + logging = null; + super.stop(); + } + + Logging getLogging() { + if (logging == null) { + synchronized (this) { + if (logging == null) { + logging = LoggingOptions.getDefaultInstance().getService(); + } + } + } + return logging; + } + + private LogEntry logEntryFor(ILoggingEvent e) { + String payload = e.getFormattedMessage(); + Level level = e.getLevel(); + LogEntry.Builder builder = + LogEntry.newBuilder(Payload.StringPayload.of(payload)) + .setTimestamp(e.getTimeStamp()) + .setSeverity(severityFor(level)); + + builder + .addLabel(LEVEL_NAME_KEY, level.toString()) + .addLabel(LEVEL_VALUE_KEY, String.valueOf(level.toInt())); + + if (loggingEnhancers != null) { + for (LoggingEnhancer enhancer : loggingEnhancers) { + enhancer.enhanceLogEntry(builder); + } + } + + return builder.build(); + } + + /** + * Transforms Logback logging levels to Cloud severity. + * + * @param level Logback logging level + * @return Cloud severity level + */ + private static Severity severityFor(Level level) { + switch (level.toInt()) { + // TRACE + case 5000: + return Severity.DEBUG; + // DEBUG + case 10000: + return Severity.DEBUG; + // INFO + case 20000: + return Severity.INFO; + // WARNING + case 30000: + return Severity.WARNING; + // ERROR + case 40000: + return Severity.ERROR; + default: + return Severity.DEFAULT; + } + } +} diff --git a/google-cloud-contrib/google-cloud-logging-logback/src/test/java/com/example/enhancers/AnotherTestLoggingEnhancer.java b/google-cloud-contrib/google-cloud-logging-logback/src/test/java/com/example/enhancers/AnotherTestLoggingEnhancer.java new file mode 100644 index 000000000000..77aed4e10666 --- /dev/null +++ b/google-cloud-contrib/google-cloud-logging-logback/src/test/java/com/example/enhancers/AnotherTestLoggingEnhancer.java @@ -0,0 +1,28 @@ +/* + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.enhancers; + +import com.google.cloud.logging.LogEntry; +import com.google.cloud.logging.LoggingEnhancer; + +public class AnotherTestLoggingEnhancer implements LoggingEnhancer { + + @Override + public void enhanceLogEntry(LogEntry.Builder logEntry) { + logEntry.addLabel("test-label-2", "test-value-2"); + } +} diff --git a/google-cloud-contrib/google-cloud-logging-logback/src/test/java/com/example/enhancers/TestLoggingEnhancer.java b/google-cloud-contrib/google-cloud-logging-logback/src/test/java/com/example/enhancers/TestLoggingEnhancer.java new file mode 100644 index 000000000000..172e208761d0 --- /dev/null +++ b/google-cloud-contrib/google-cloud-logging-logback/src/test/java/com/example/enhancers/TestLoggingEnhancer.java @@ -0,0 +1,28 @@ +/* + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.enhancers; + +import com.google.cloud.logging.LogEntry; +import com.google.cloud.logging.LoggingEnhancer; + +public class TestLoggingEnhancer implements LoggingEnhancer { + + @Override + public void enhanceLogEntry(LogEntry.Builder logEntry) { + logEntry.addLabel("test-label-1", "test-value-1"); + } +} diff --git a/google-cloud-contrib/google-cloud-logging-logback/src/test/java/com/google/cloud/logging/logback/LoggingAppenderTest.java b/google-cloud-contrib/google-cloud-logging-logback/src/test/java/com/google/cloud/logging/logback/LoggingAppenderTest.java new file mode 100644 index 000000000000..58142566dad1 --- /dev/null +++ b/google-cloud-contrib/google-cloud-logging-logback/src/test/java/com/google/cloud/logging/logback/LoggingAppenderTest.java @@ -0,0 +1,192 @@ +/* + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.logback; + +import static org.easymock.EasyMock.anyObject; +import static org.easymock.EasyMock.capture; +import static org.easymock.EasyMock.expectLastCall; +import static org.easymock.EasyMock.replay; +import static org.easymock.EasyMock.verify; + +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.filter.ThresholdFilter; +import ch.qos.logback.classic.spi.LoggingEvent; +import com.google.cloud.MonitoredResource; +import com.google.cloud.Timestamp; +import com.google.cloud.logging.LogEntry; +import com.google.cloud.logging.Logging; +import com.google.cloud.logging.Logging.WriteOption; +import com.google.cloud.logging.Payload.StringPayload; +import com.google.cloud.logging.Severity; +import com.google.common.collect.ImmutableMap; +import org.easymock.Capture; +import org.easymock.EasyMock; +import org.easymock.EasyMockRunner; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; + +@RunWith(EasyMockRunner.class) +public class LoggingAppenderTest { + private final String projectId = "test-project"; + private final Logging logging = EasyMock.createStrictMock(Logging.class); + private LoggingAppender loggingAppender = new TestLoggingAppender(); + + class TestLoggingAppender extends LoggingAppender { + @Override + String getProjectId() { + return projectId; + } + + @Override + Logging getLogging() { + return logging; + } + } + + @Before + public void setUp() {} + + private final WriteOption[] defaultWriteOptions = + new WriteOption[] { + WriteOption.logName("java.log"), + WriteOption.resource( + MonitoredResource.newBuilder("global") + .setLabels( + new ImmutableMap.Builder().put("project_id", projectId).build()) + .build()) + }; + + @Test + public void testFlushLevelConfigUpdatesLoggingFlushSeverity() { + LogEntry logEntry = + LogEntry.newBuilder(StringPayload.of("this is a test")) + .setTimestamp(100000L) + .setSeverity(Severity.WARNING) + .setLabels( + new ImmutableMap.Builder() + .put("levelName", "WARN") + .put("levelValue", String.valueOf(30000L)) + .build()) + .build(); + logging.setFlushSeverity(Severity.WARNING); + Capture> capturedArgument = Capture.newInstance(); + logging.write( + capture(capturedArgument), (WriteOption) anyObject(), (WriteOption) anyObject()); + replay(logging); + Timestamp timestamp = Timestamp.ofTimeSecondsAndNanos(100000, 0); + LoggingEvent loggingEvent = createLoggingEvent(Level.WARN, timestamp.getSeconds()); + // error is the default, updating to warn for test + loggingAppender.setFlushLevel(Level.WARN); + loggingAppender.start(); + loggingAppender.doAppend(loggingEvent); + verify(logging); + Assert.assertTrue(capturedArgument.getValue().iterator().hasNext()); + Assert.assertTrue(logEntry.equals(capturedArgument.getValue().iterator().next())); + } + + @Test + public void testFilterLogsOnlyLogsAtOrAboveLogLevel() { + LogEntry logEntry = + LogEntry.newBuilder(StringPayload.of("this is a test")) + .setTimestamp(100000L) + .setSeverity(Severity.ERROR) + .setLabels( + new ImmutableMap.Builder() + .put("levelName", "ERROR") + .put("levelValue", String.valueOf(40000L)) + .build()) + .build(); + logging.setFlushSeverity(Severity.ERROR); + Capture> capturedArgument = Capture.newInstance(); + logging.write( + capture(capturedArgument), (WriteOption) anyObject(), (WriteOption) anyObject()); + expectLastCall().once(); + replay(logging); + Timestamp timestamp = Timestamp.ofTimeSecondsAndNanos(100000, 0); + LoggingEvent loggingEvent1 = createLoggingEvent(Level.INFO, timestamp.getSeconds()); + ThresholdFilter thresholdFilter = new ThresholdFilter(); + thresholdFilter.setLevel("ERROR"); + thresholdFilter.start(); + loggingAppender.addFilter(thresholdFilter); + loggingAppender.start(); + // info event does not get logged + loggingAppender.doAppend(loggingEvent1); + LoggingEvent loggingEvent2 = createLoggingEvent(Level.ERROR, timestamp.getSeconds()); + // error event gets logged + loggingAppender.doAppend(loggingEvent2); + verify(logging); + Assert.assertTrue(capturedArgument.getValue().iterator().hasNext()); + Assert.assertTrue(logEntry.equals(capturedArgument.getValue().iterator().next())); + } + + @Test + public void testEnhancersAddCorrectLabelsToLogEntries() { + LogEntry logEntry = + LogEntry.newBuilder(StringPayload.of("this is a test")) + .setTimestamp(100000L) + .setSeverity(Severity.WARNING) + .setLabels( + new ImmutableMap.Builder() + .put("levelName", "WARN") + .put("levelValue", String.valueOf(30000L)) + .put("test-label-1", "test-value-1") + .put("test-label-2", "test-value-2") + .build()) + .build(); + logging.setFlushSeverity(Severity.ERROR); + Capture> capturedArgument = Capture.newInstance(); + logging.write( + capture(capturedArgument), (WriteOption) anyObject(), (WriteOption) anyObject()); + expectLastCall().once(); + replay(logging); + loggingAppender.addEnhancer("com.example.enhancers.TestLoggingEnhancer"); + loggingAppender.addEnhancer("com.example.enhancers.AnotherTestLoggingEnhancer"); + loggingAppender.start(); + Timestamp timestamp = Timestamp.ofTimeSecondsAndNanos(100000, 0); + LoggingEvent loggingEvent = createLoggingEvent(Level.WARN, timestamp.getSeconds()); + loggingAppender.doAppend(loggingEvent); + verify(logging); + Assert.assertTrue(capturedArgument.getValue().iterator().hasNext()); + Assert.assertTrue(logEntry.equals(capturedArgument.getValue().iterator().next())); + } + + @Test + public void testDefaultWriteOptionsHasExpectedDefaults() { + logging.setFlushSeverity(Severity.ERROR); + Capture logNameArg = Capture.newInstance(); + Capture resourceArg = Capture.newInstance(); + logging.write((Iterable) anyObject(), capture(logNameArg), capture(resourceArg)); + expectLastCall().once(); + replay(logging); + loggingAppender.start(); + Timestamp timestamp = Timestamp.ofTimeSecondsAndNanos(100000, 0); + LoggingEvent loggingEvent = createLoggingEvent(Level.ERROR, timestamp.getSeconds()); + loggingAppender.doAppend(loggingEvent); + Assert.assertTrue(logNameArg.getValue().equals(defaultWriteOptions[0])); + Assert.assertTrue(resourceArg.getValue().equals(defaultWriteOptions[1])); + } + + private LoggingEvent createLoggingEvent(Level level, long timestamp) { + LoggingEvent loggingEvent = new LoggingEvent(); + loggingEvent.setMessage("this is a test"); + loggingEvent.setLevel(level); + loggingEvent.setTimeStamp(timestamp); + return loggingEvent; + } +} From 0c509ae4dac5921522b33b1a23d31fdad33586ba Mon Sep 17 00:00:00 2001 From: Thomas Coffee Date: Tue, 6 Jun 2017 07:32:54 -0700 Subject: [PATCH 0003/1629] Release 0.19.0 (#2114) * Bump dependency versions for gax and auth * Release 0.19.0 --- google-cloud-contrib/google-cloud-logging-logback/README.md | 6 +++--- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/README.md b/google-cloud-contrib/google-cloud-logging-logback/README.md index e69b8edaecf0..4ca5fa8d96e6 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/README.md +++ b/google-cloud-contrib/google-cloud-logging-logback/README.md @@ -19,16 +19,16 @@ If you are using Maven, add this to your pom.xml file com.google.cloud google-cloud-logging-logback - 0.18.0-alpha + 0.19.0-alpha ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-logging-logback:0.18.0-alpha' +compile 'com.google.cloud:google-cloud-logging-logback:0.19.0-alpha' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.18.0-alpha" +libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.19.0-alpha" ``` Usage diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 1c99617f1af0..92b865e0e528 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.18.1-alpha-SNAPSHOT + 0.19.0-alpha jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.18.1-alpha-SNAPSHOT + 0.19.0-alpha From a8bc6967ae79ba4b20f0cdcba219a07d35f4e4e1 Mon Sep 17 00:00:00 2001 From: Thomas Coffee Date: Tue, 6 Jun 2017 09:52:35 -0700 Subject: [PATCH 0004/1629] Bump to next snapshot versions (#2119) --- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 92b865e0e528..e0f2364ca4db 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.19.0-alpha + 0.19.1-alpha-SNAPSHOT jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.19.0-alpha + 0.19.1-alpha-SNAPSHOT From 9678285ba8ef1c84c8d1580b1e77b848f14ebb13 Mon Sep 17 00:00:00 2001 From: Jisha Abubaker Date: Thu, 8 Jun 2017 15:06:40 -0700 Subject: [PATCH 0005/1629] Logging logback appender : Class loader fix for custom enhancers Replacing system classloader with ch.qos.logback.core.util.Loader#loadClas for custom enhancers. (#2130) Fix #2123 --- .../java/com/google/cloud/logging/logback/LoggingAppender.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/src/main/java/com/google/cloud/logging/logback/LoggingAppender.java b/google-cloud-contrib/google-cloud-logging-logback/src/main/java/com/google/cloud/logging/logback/LoggingAppender.java index 4f6a38f1b081..4bc46ef2c435 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/src/main/java/com/google/cloud/logging/logback/LoggingAppender.java +++ b/google-cloud-contrib/google-cloud-logging-logback/src/main/java/com/google/cloud/logging/logback/LoggingAppender.java @@ -19,6 +19,7 @@ import ch.qos.logback.classic.Level; import ch.qos.logback.classic.spi.ILoggingEvent; import ch.qos.logback.core.UnsynchronizedAppenderBase; +import ch.qos.logback.core.util.Loader; import com.google.cloud.MonitoredResource; import com.google.cloud.logging.LogEntry; import com.google.cloud.logging.Logging; @@ -143,7 +144,7 @@ private LoggingEnhancer getEnhancer(String enhancerClassName) { try { Class clz = (Class) - ClassLoader.getSystemClassLoader().loadClass(enhancerClassName.trim()); + Loader.loadClass(enhancerClassName.trim()); return clz.newInstance(); } catch (Exception ex) { // If we cannot create the enhancer we fallback to null From a73a239c23944b807f08747d71543343f51f8813 Mon Sep 17 00:00:00 2001 From: Garrett Jones Date: Thu, 15 Jun 2017 08:43:38 -0700 Subject: [PATCH 0006/1629] Bumping versions to 1.2.0, 0.20.0-beta, 0.20.0-alpha for release --- google-cloud-contrib/google-cloud-logging-logback/README.md | 6 +++--- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/README.md b/google-cloud-contrib/google-cloud-logging-logback/README.md index 4ca5fa8d96e6..896f542af466 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/README.md +++ b/google-cloud-contrib/google-cloud-logging-logback/README.md @@ -19,16 +19,16 @@ If you are using Maven, add this to your pom.xml file com.google.cloud google-cloud-logging-logback - 0.19.0-alpha + 0.20.0-alpha ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-logging-logback:0.19.0-alpha' +compile 'com.google.cloud:google-cloud-logging-logback:0.20.0-alpha' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.19.0-alpha" +libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.20.0-alpha" ``` Usage diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index e0f2364ca4db..3e546667502c 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.19.1-alpha-SNAPSHOT + 0.20.0-alpha jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.19.1-alpha-SNAPSHOT + 0.20.0-alpha From 40745aa0292a6552ce08d59818bb3a9444c10944 Mon Sep 17 00:00:00 2001 From: Garrett Jones Date: Thu, 15 Jun 2017 11:07:58 -0700 Subject: [PATCH 0007/1629] Bumping to snapshot versions (#2154) --- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 3e546667502c..754c5e9b24e8 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.20.0-alpha + 0.20.1-alpha-SNAPSHOT jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.20.0-alpha + 0.20.1-alpha-SNAPSHOT From b276af5e027cf91d06a0c0c5f255d3609f33650a Mon Sep 17 00:00:00 2001 From: Michael Darakananda Date: Tue, 27 Jun 2017 14:13:43 +1000 Subject: [PATCH 0008/1629] Release 0.20.1 (#2189) --- google-cloud-contrib/google-cloud-logging-logback/README.md | 6 +++--- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/README.md b/google-cloud-contrib/google-cloud-logging-logback/README.md index 896f542af466..88adf642316e 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/README.md +++ b/google-cloud-contrib/google-cloud-logging-logback/README.md @@ -19,16 +19,16 @@ If you are using Maven, add this to your pom.xml file com.google.cloud google-cloud-logging-logback - 0.20.0-alpha + 0.20.1-alpha ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-logging-logback:0.20.0-alpha' +compile 'com.google.cloud:google-cloud-logging-logback:0.20.1-alpha' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.20.0-alpha" +libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.20.1-alpha" ``` Usage diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 754c5e9b24e8..3a8642d01afa 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.20.1-alpha-SNAPSHOT + 0.20.1-alpha jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.20.1-alpha-SNAPSHOT + 0.20.1-alpha From b81553b88d26e0df7277ef925f116ce1e01ec32a Mon Sep 17 00:00:00 2001 From: Michael Darakananda Date: Wed, 28 Jun 2017 01:17:20 +1000 Subject: [PATCH 0009/1629] bump version to 0.20.2-alpha for development (#2190) --- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 3a8642d01afa..63a501cb4d68 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.20.1-alpha + 0.20.2-alpha-SNAPSHOT jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.20.1-alpha + 0.20.2-alpha-SNAPSHOT From 63850ec17c46bc9d72535a43a842ae730fcd150a Mon Sep 17 00:00:00 2001 From: neozwu Date: Mon, 17 Jul 2017 15:27:38 -0700 Subject: [PATCH 0010/1629] Release 0.20.2 (#2244) --- google-cloud-contrib/google-cloud-logging-logback/README.md | 6 +++--- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/README.md b/google-cloud-contrib/google-cloud-logging-logback/README.md index 88adf642316e..5d33fe70dbf8 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/README.md +++ b/google-cloud-contrib/google-cloud-logging-logback/README.md @@ -19,16 +19,16 @@ If you are using Maven, add this to your pom.xml file com.google.cloud google-cloud-logging-logback - 0.20.1-alpha + 0.20.2-alpha ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-logging-logback:0.20.1-alpha' +compile 'com.google.cloud:google-cloud-logging-logback:0.20.2-alpha' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.20.1-alpha" +libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.20.2-alpha" ``` Usage diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 63a501cb4d68..1ecf4106457b 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.20.2-alpha-SNAPSHOT + 0.20.2-alpha jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.20.2-alpha-SNAPSHOT + 0.20.2-alpha From c0ed2a423fdeca795a809a24cf5eda8b51812e51 Mon Sep 17 00:00:00 2001 From: neozwu Date: Mon, 17 Jul 2017 15:55:47 -0700 Subject: [PATCH 0011/1629] bump version to 0.20.3-alpha for development (#2245) --- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 1ecf4106457b..9b4ef2e923c8 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.20.2-alpha + 0.20.3-alpha-SNAPSHOT jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.20.2-alpha + 0.20.3-alpha-SNAPSHOT From e5b615062a1c9193eac90528a5312632a19d5d24 Mon Sep 17 00:00:00 2001 From: Thomas Coffee Date: Wed, 19 Jul 2017 14:36:58 -0700 Subject: [PATCH 0012/1629] Release 0.20.3 (#2261) --- google-cloud-contrib/google-cloud-logging-logback/README.md | 6 +++--- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/README.md b/google-cloud-contrib/google-cloud-logging-logback/README.md index 5d33fe70dbf8..e280b06a3411 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/README.md +++ b/google-cloud-contrib/google-cloud-logging-logback/README.md @@ -19,16 +19,16 @@ If you are using Maven, add this to your pom.xml file com.google.cloud google-cloud-logging-logback - 0.20.2-alpha + 0.20.3-alpha ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-logging-logback:0.20.2-alpha' +compile 'com.google.cloud:google-cloud-logging-logback:0.20.3-alpha' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.20.2-alpha" +libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.20.3-alpha" ``` Usage diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 9b4ef2e923c8..5cc14b9448f2 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.20.3-alpha-SNAPSHOT + 0.20.3-alpha jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.20.3-alpha-SNAPSHOT + 0.20.3-alpha From e27c4655f6d9bbca77ffa808fd708ed3ac84dff3 Mon Sep 17 00:00:00 2001 From: Thomas Coffee Date: Wed, 19 Jul 2017 16:09:02 -0700 Subject: [PATCH 0013/1629] Bump to next snapshot versions (#2262) --- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 5cc14b9448f2..c9405b39198f 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.20.3-alpha + 0.20.4-alpha-SNAPSHOT jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.20.3-alpha + 0.20.4-alpha-SNAPSHOT From b3c91309e60fbeddd611846ba1443f66ad9e9246 Mon Sep 17 00:00:00 2001 From: neozwu Date: Wed, 19 Jul 2017 20:19:24 -0700 Subject: [PATCH 0014/1629] use objenesis 2.6 (#2252) fix #2172 --- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index c9405b39198f..b608ae733e93 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -36,7 +36,11 @@ org.easymock easymock - 3.4 + test + + + org.objenesis + objenesis test From 6ca946ee8e4ec3549ae047d4e29ce0d1a4e6f5a6 Mon Sep 17 00:00:00 2001 From: Garrett Jones Date: Thu, 27 Jul 2017 15:30:58 -0700 Subject: [PATCH 0015/1629] Release 1.3.0, 0.21.0-beta, 0.21.0-alpha --- google-cloud-contrib/google-cloud-logging-logback/README.md | 6 +++--- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/README.md b/google-cloud-contrib/google-cloud-logging-logback/README.md index e280b06a3411..47efcd4b8952 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/README.md +++ b/google-cloud-contrib/google-cloud-logging-logback/README.md @@ -19,16 +19,16 @@ If you are using Maven, add this to your pom.xml file com.google.cloud google-cloud-logging-logback - 0.20.3-alpha + 0.21.0-alpha ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-logging-logback:0.20.3-alpha' +compile 'com.google.cloud:google-cloud-logging-logback:0.21.0-alpha' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.20.3-alpha" +libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.21.0-alpha" ``` Usage diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index b608ae733e93..3dd14808fd43 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.20.4-alpha-SNAPSHOT + 0.21.0-alpha jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.20.4-alpha-SNAPSHOT + 0.21.0-alpha From f5f2a0078ec21145ac3237f3f87d59150721e84f Mon Sep 17 00:00:00 2001 From: Garrett Jones Date: Thu, 27 Jul 2017 20:42:29 -0700 Subject: [PATCH 0016/1629] Bumping to next snapshot versions (#2288) --- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 3dd14808fd43..4ad16a0161c8 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.21.0-alpha + 0.21.1-alpha-SNAPSHOT jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.21.0-alpha + 0.21.1-alpha-SNAPSHOT From 29e6aca4dba14dd10a4825c03414ca1b19fa85fd Mon Sep 17 00:00:00 2001 From: Shin Fan Date: Mon, 31 Jul 2017 13:21:48 -0700 Subject: [PATCH 0017/1629] Release 0.21.1 (#2293) --- google-cloud-contrib/google-cloud-logging-logback/README.md | 6 +++--- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/README.md b/google-cloud-contrib/google-cloud-logging-logback/README.md index 47efcd4b8952..d27e20aa4c82 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/README.md +++ b/google-cloud-contrib/google-cloud-logging-logback/README.md @@ -19,16 +19,16 @@ If you are using Maven, add this to your pom.xml file com.google.cloud google-cloud-logging-logback - 0.21.0-alpha + 0.21.1-alpha ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-logging-logback:0.21.0-alpha' +compile 'com.google.cloud:google-cloud-logging-logback:0.21.1-alpha' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.21.0-alpha" +libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.21.1-alpha" ``` Usage diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 4ad16a0161c8..93695c1845a5 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.21.1-alpha-SNAPSHOT + 0.21.1-alpha jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.21.1-alpha-SNAPSHOT + 0.21.1-alpha From 89f08083daac41475a95f667ed7cbc0adaddd478 Mon Sep 17 00:00:00 2001 From: Shin Fan Date: Mon, 31 Jul 2017 14:34:50 -0700 Subject: [PATCH 0018/1629] Bump to SNAPSHOT version (#2294) --- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 93695c1845a5..efa86413f689 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.21.1-alpha + 0.21.2-alpha-SNAPSHOT jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.21.1-alpha + 0.21.2-alpha-SNAPSHOT From 01ddae952d40c17959eb101abf65152eba023e6d Mon Sep 17 00:00:00 2001 From: Garrett Jones Date: Mon, 21 Aug 2017 14:19:43 -0700 Subject: [PATCH 0019/1629] Release 1.4.0, 0.22.0-beta, 0.22.0-alpha --- google-cloud-contrib/google-cloud-logging-logback/README.md | 6 +++--- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/README.md b/google-cloud-contrib/google-cloud-logging-logback/README.md index d27e20aa4c82..4f7406ab5469 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/README.md +++ b/google-cloud-contrib/google-cloud-logging-logback/README.md @@ -19,16 +19,16 @@ If you are using Maven, add this to your pom.xml file com.google.cloud google-cloud-logging-logback - 0.21.1-alpha + 0.22.0-alpha ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-logging-logback:0.21.1-alpha' +compile 'com.google.cloud:google-cloud-logging-logback:0.22.0-alpha' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.21.1-alpha" +libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.22.0-alpha" ``` Usage diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index efa86413f689..2ff382e0f796 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.21.2-alpha-SNAPSHOT + 0.22.0-alpha jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.21.2-alpha-SNAPSHOT + 0.22.0-alpha From 8194339e3c83a40278987f5f755a4919169e76fe Mon Sep 17 00:00:00 2001 From: Garrett Jones Date: Mon, 21 Aug 2017 16:05:53 -0700 Subject: [PATCH 0020/1629] Bumping to next snapshot versions (#2366) --- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 2ff382e0f796..db0040219587 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.22.0-alpha + 0.22.1-alpha-SNAPSHOT jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.22.0-alpha + 0.22.1-alpha-SNAPSHOT From d3dad55dfa784a0e64cec85e12c44eff1057f2d4 Mon Sep 17 00:00:00 2001 From: Shin Fan Date: Mon, 11 Sep 2017 16:55:38 -0700 Subject: [PATCH 0021/1629] Bump up versions for release (#2430) --- google-cloud-contrib/google-cloud-logging-logback/README.md | 6 +++--- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/README.md b/google-cloud-contrib/google-cloud-logging-logback/README.md index 4f7406ab5469..7ba5f9976d42 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/README.md +++ b/google-cloud-contrib/google-cloud-logging-logback/README.md @@ -19,16 +19,16 @@ If you are using Maven, add this to your pom.xml file com.google.cloud google-cloud-logging-logback - 0.22.0-alpha + 0.23.0-alpha ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-logging-logback:0.22.0-alpha' +compile 'com.google.cloud:google-cloud-logging-logback:0.23.0-alpha' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.22.0-alpha" +libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.23.0-alpha" ``` Usage diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index db0040219587..c26c906f487e 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.22.1-alpha-SNAPSHOT + 0.23.0-alpha jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.22.1-alpha-SNAPSHOT + 0.23.0-alpha From 1af5395c78cafcfece79ed9f64dbc12037afe1fc Mon Sep 17 00:00:00 2001 From: Shin Fan Date: Tue, 12 Sep 2017 10:07:17 -0700 Subject: [PATCH 0022/1629] Bump tp SNAPSHOT version (#2431) --- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index c26c906f487e..7d454974ab88 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.23.0-alpha + 0.23.1-alpha-SNAPSHOT jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.23.0-alpha + 0.23.1-alpha-SNAPSHOT From b0e8dc3272e6ae379936c17d64730bc1d2e8bf66 Mon Sep 17 00:00:00 2001 From: michaelbausor Date: Wed, 13 Sep 2017 08:15:43 -0700 Subject: [PATCH 0023/1629] Bump versions for release (#2436) --- google-cloud-contrib/google-cloud-logging-logback/README.md | 6 +++--- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/README.md b/google-cloud-contrib/google-cloud-logging-logback/README.md index 7ba5f9976d42..914aa8388f17 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/README.md +++ b/google-cloud-contrib/google-cloud-logging-logback/README.md @@ -19,16 +19,16 @@ If you are using Maven, add this to your pom.xml file com.google.cloud google-cloud-logging-logback - 0.23.0-alpha + 0.23.1-alpha ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-logging-logback:0.23.0-alpha' +compile 'com.google.cloud:google-cloud-logging-logback:0.23.1-alpha' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.23.0-alpha" +libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.23.1-alpha" ``` Usage diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 7d454974ab88..1e35c7e7c58e 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.23.1-alpha-SNAPSHOT + 0.23.1-alpha jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.23.1-alpha-SNAPSHOT + 0.23.1-alpha From a6d5a024df33a526251636343982c0a7f01249ec Mon Sep 17 00:00:00 2001 From: michaelbausor Date: Wed, 13 Sep 2017 09:59:38 -0700 Subject: [PATCH 0024/1629] Bump to snapshot version (#2437) --- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 1e35c7e7c58e..fbaa8a213d18 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.23.1-alpha + 0.23.2-alpha-SNAPSHOT jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.23.1-alpha + 0.23.2-alpha-SNAPSHOT From 4ba4cc5e2ad777ffb307ec052ad26267ab3ba9df Mon Sep 17 00:00:00 2001 From: neozwu Date: Mon, 18 Sep 2017 15:26:34 -0700 Subject: [PATCH 0025/1629] bump versions for release (#2449) --- google-cloud-contrib/google-cloud-logging-logback/README.md | 6 +++--- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/README.md b/google-cloud-contrib/google-cloud-logging-logback/README.md index 914aa8388f17..b847a793b13a 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/README.md +++ b/google-cloud-contrib/google-cloud-logging-logback/README.md @@ -19,16 +19,16 @@ If you are using Maven, add this to your pom.xml file com.google.cloud google-cloud-logging-logback - 0.23.1-alpha + 0.24.0-alpha ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-logging-logback:0.23.1-alpha' +compile 'com.google.cloud:google-cloud-logging-logback:0.24.0-alpha' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.23.1-alpha" +libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.24.0-alpha" ``` Usage diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index fbaa8a213d18..40f21869e3d4 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.23.2-alpha-SNAPSHOT + 0.24.0-alpha jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.23.2-alpha-SNAPSHOT + 0.24.0-alpha From 2c61f7d68ba73854756537ebc4b664809a885f76 Mon Sep 17 00:00:00 2001 From: neozwu Date: Mon, 18 Sep 2017 16:18:01 -0700 Subject: [PATCH 0026/1629] bump versions for development (#2450) --- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 40f21869e3d4..3cc140f8d1b4 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.24.0-alpha + 0.24.1-alpha-SNAPSHOT jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.24.0-alpha + 0.24.1-alpha-SNAPSHOT From 05784d58851ece645e38eec99f61bf7a394fe2f6 Mon Sep 17 00:00:00 2001 From: Neo Wu Date: Mon, 2 Oct 2017 19:33:20 -0700 Subject: [PATCH 0027/1629] Release 0.25.0 --- google-cloud-contrib/google-cloud-logging-logback/README.md | 6 +++--- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/README.md b/google-cloud-contrib/google-cloud-logging-logback/README.md index b847a793b13a..d6e5529a626f 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/README.md +++ b/google-cloud-contrib/google-cloud-logging-logback/README.md @@ -19,16 +19,16 @@ If you are using Maven, add this to your pom.xml file com.google.cloud google-cloud-logging-logback - 0.24.0-alpha + 0.25.0-alpha ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-logging-logback:0.24.0-alpha' +compile 'com.google.cloud:google-cloud-logging-logback:0.25.0-alpha' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.24.0-alpha" +libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.25.0-alpha" ``` Usage diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 3cc140f8d1b4..b575d860f063 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.24.1-alpha-SNAPSHOT + 0.25.0-alpha jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.24.1-alpha-SNAPSHOT + 0.25.0-alpha From 8310e5847a4b8521b1e197d80ae66f766f587dbf Mon Sep 17 00:00:00 2001 From: neozwu Date: Mon, 2 Oct 2017 22:12:16 -0700 Subject: [PATCH 0028/1629] bump version for development (#2474) --- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index b575d860f063..d6cf89502bd1 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.25.0-alpha + 0.25.1-alpha-SNAPSHOT jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.25.0-alpha + 0.25.1-alpha-SNAPSHOT From 063ac82b1ba30b152d2895c2215d4b5637edf5c7 Mon Sep 17 00:00:00 2001 From: neozwu Date: Fri, 13 Oct 2017 20:39:10 -0700 Subject: [PATCH 0029/1629] release 0.26.0 (#2523) --- google-cloud-contrib/google-cloud-logging-logback/README.md | 6 +++--- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/README.md b/google-cloud-contrib/google-cloud-logging-logback/README.md index d6e5529a626f..5be1a9e713ff 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/README.md +++ b/google-cloud-contrib/google-cloud-logging-logback/README.md @@ -19,16 +19,16 @@ If you are using Maven, add this to your pom.xml file com.google.cloud google-cloud-logging-logback - 0.25.0-alpha + 0.26.0-alpha ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-logging-logback:0.25.0-alpha' +compile 'com.google.cloud:google-cloud-logging-logback:0.26.0-alpha' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.25.0-alpha" +libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.26.0-alpha" ``` Usage diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index d6cf89502bd1..b6b10efc21ca 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.25.1-alpha-SNAPSHOT + 0.26.0-alpha jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.25.1-alpha-SNAPSHOT + 0.26.0-alpha From 4763d5afbdbaac807b5984b37b2d168511f82089 Mon Sep 17 00:00:00 2001 From: neozwu Date: Fri, 13 Oct 2017 20:50:29 -0700 Subject: [PATCH 0030/1629] bump version for development (#2524) --- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index b6b10efc21ca..626d469f9f1b 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.26.0-alpha + 0.26.1-alpha-SNAPSHOT jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.26.0-alpha + 0.26.1-alpha-SNAPSHOT From ea604e57d4f2665abcf83dcfb11cdff53a8f55f9 Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Wed, 8 Nov 2017 11:19:35 -0800 Subject: [PATCH 0031/1629] Release 0.27.0 (#2596) --- google-cloud-contrib/google-cloud-logging-logback/README.md | 6 +++--- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/README.md b/google-cloud-contrib/google-cloud-logging-logback/README.md index 5be1a9e713ff..fa715287c21d 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/README.md +++ b/google-cloud-contrib/google-cloud-logging-logback/README.md @@ -19,16 +19,16 @@ If you are using Maven, add this to your pom.xml file com.google.cloud google-cloud-logging-logback - 0.26.0-alpha + 0.27.0-alpha ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-logging-logback:0.26.0-alpha' +compile 'com.google.cloud:google-cloud-logging-logback:0.27.0-alpha' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.26.0-alpha" +libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.27.0-alpha" ``` Usage diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 626d469f9f1b..1e52a541b2f4 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.26.1-alpha-SNAPSHOT + 0.27.0-alpha jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.26.1-alpha-SNAPSHOT + 0.27.0-alpha From 53dc9b61efe4a031ca3fa64ecd88d0d8826df9d5 Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Wed, 8 Nov 2017 13:31:07 -0800 Subject: [PATCH 0032/1629] Update pom.xml version to 0.27.1-SNAPSHOT by script (#2595) --- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 1e52a541b2f4..9e7b91dea9d2 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.27.0-alpha + 0.27.1-alpha-SNAPSHOT jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.27.0-alpha + 0.27.1-alpha-SNAPSHOT From 3ddc268012f8aae731d6c0239c8850606da4d45e Mon Sep 17 00:00:00 2001 From: Garrett Jones Date: Wed, 8 Nov 2017 16:26:28 -0800 Subject: [PATCH 0033/1629] Release 0.28.0 --- google-cloud-contrib/google-cloud-logging-logback/README.md | 6 +++--- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/README.md b/google-cloud-contrib/google-cloud-logging-logback/README.md index fa715287c21d..de90b11411e3 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/README.md +++ b/google-cloud-contrib/google-cloud-logging-logback/README.md @@ -19,16 +19,16 @@ If you are using Maven, add this to your pom.xml file com.google.cloud google-cloud-logging-logback - 0.27.0-alpha + 0.28.0-alpha ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-logging-logback:0.27.0-alpha' +compile 'com.google.cloud:google-cloud-logging-logback:0.28.0-alpha' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.27.0-alpha" +libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.28.0-alpha" ``` Usage diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 9e7b91dea9d2..49c4e1845d26 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.27.1-alpha-SNAPSHOT + 0.28.0-alpha jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.27.1-alpha-SNAPSHOT + 0.28.0-alpha From c6a1fdef9f9f0ce2859030540965805677c03039 Mon Sep 17 00:00:00 2001 From: Garrett Jones Date: Wed, 8 Nov 2017 20:35:49 -0800 Subject: [PATCH 0034/1629] Bumping to next snapshot versions (#2603) --- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 49c4e1845d26..df81bf6d88bd 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.28.0-alpha + 0.28.1-alpha-SNAPSHOT jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.28.0-alpha + 0.28.1-alpha-SNAPSHOT From c40e02d6a21164116edd3c299aaa872dd4ddca13 Mon Sep 17 00:00:00 2001 From: Vadym Matsishevskyi <25311427+vam-google@users.noreply.github.com> Date: Tue, 14 Nov 2017 19:19:41 -0800 Subject: [PATCH 0035/1629] Release 0.29.0 (#2627) --- google-cloud-contrib/google-cloud-logging-logback/README.md | 6 +++--- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/README.md b/google-cloud-contrib/google-cloud-logging-logback/README.md index de90b11411e3..f79215ea3862 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/README.md +++ b/google-cloud-contrib/google-cloud-logging-logback/README.md @@ -19,16 +19,16 @@ If you are using Maven, add this to your pom.xml file com.google.cloud google-cloud-logging-logback - 0.28.0-alpha + 0.29.0-alpha ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-logging-logback:0.28.0-alpha' +compile 'com.google.cloud:google-cloud-logging-logback:0.29.0-alpha' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.28.0-alpha" +libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.29.0-alpha" ``` Usage diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index df81bf6d88bd..870fb069e975 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.28.1-alpha-SNAPSHOT + 0.29.0-alpha jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.28.1-alpha-SNAPSHOT + 0.29.0-alpha From 54400df4dcaf60de576bb02e59aa00d9acda4bbe Mon Sep 17 00:00:00 2001 From: Vadym Matsishevskyi <25311427+vam-google@users.noreply.github.com> Date: Tue, 14 Nov 2017 22:10:08 -0800 Subject: [PATCH 0036/1629] Bump version to 0.29.1-SNAPSHOT for development (#2628) --- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 870fb069e975..7d2fae1c4a12 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.29.0-alpha + 0.29.1-alpha-SNAPSHOT jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.29.0-alpha + 0.29.1-alpha-SNAPSHOT From 7754c33c00226d10b49a9f4139a840bc0f364295 Mon Sep 17 00:00:00 2001 From: Garrett Jones Date: Wed, 15 Nov 2017 18:54:22 -0800 Subject: [PATCH 0037/1629] Release 1.12.0/0.30.0 --- google-cloud-contrib/google-cloud-logging-logback/README.md | 6 +++--- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/README.md b/google-cloud-contrib/google-cloud-logging-logback/README.md index f79215ea3862..ca2e30bb6ce4 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/README.md +++ b/google-cloud-contrib/google-cloud-logging-logback/README.md @@ -19,16 +19,16 @@ If you are using Maven, add this to your pom.xml file com.google.cloud google-cloud-logging-logback - 0.29.0-alpha + 0.30.0-alpha ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-logging-logback:0.29.0-alpha' +compile 'com.google.cloud:google-cloud-logging-logback:0.30.0-alpha' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.29.0-alpha" +libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.30.0-alpha" ``` Usage diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 7d2fae1c4a12..deb3ce442396 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.29.1-alpha-SNAPSHOT + 0.30.0-alpha jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.29.1-alpha-SNAPSHOT + 0.30.0-alpha From 37098134d05fbf1a5fa626377fbd433ebf93eb83 Mon Sep 17 00:00:00 2001 From: Garrett Jones Date: Thu, 16 Nov 2017 08:59:59 -0800 Subject: [PATCH 0038/1629] Bumping to next snapshot version (#2635) --- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index deb3ce442396..1a68579ea6a5 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.30.0-alpha + 0.30.1-alpha-SNAPSHOT jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.30.0-alpha + 0.30.1-alpha-SNAPSHOT From 9a2b249319a51e93f6e5fdde1bcdde9eab23a0b6 Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Mon, 11 Dec 2017 17:15:52 -0800 Subject: [PATCH 0039/1629] Bump version to 0.32.0 (#2684) --- google-cloud-contrib/google-cloud-logging-logback/README.md | 6 +++--- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/README.md b/google-cloud-contrib/google-cloud-logging-logback/README.md index ca2e30bb6ce4..1146ed9ee7f9 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/README.md +++ b/google-cloud-contrib/google-cloud-logging-logback/README.md @@ -19,16 +19,16 @@ If you are using Maven, add this to your pom.xml file com.google.cloud google-cloud-logging-logback - 0.30.0-alpha + 0.32.0-alpha ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-logging-logback:0.30.0-alpha' +compile 'com.google.cloud:google-cloud-logging-logback:0.32.0-alpha' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.30.0-alpha" +libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.32.0-alpha" ``` Usage diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 1a68579ea6a5..405155820443 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.30.1-alpha-SNAPSHOT + 0.32.0-alpha jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.30.1-alpha-SNAPSHOT + 0.32.0-alpha From 02d9e362b73a7c6c5dd2a8b176964114dd72680e Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Tue, 12 Dec 2017 11:11:40 -0800 Subject: [PATCH 0040/1629] Bump versions to SNAPSHOT (#2700) alpha version now 0.32.1-alpha-SNAPSHOT beta version now 0.32.1-beta-SNAPSHOT ga version now 1.14.1-SNAPSHOT --- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 405155820443..9ee67f404822 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.32.0-alpha + 0.32.1-alpha-SNAPSHOT jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.32.0-alpha + 0.32.1-alpha-SNAPSHOT From b7bf764ebc77efd56d4af04f2909cba3308d38a2 Mon Sep 17 00:00:00 2001 From: Michael Darakananda Date: Wed, 10 Jan 2018 11:52:56 +1100 Subject: [PATCH 0041/1629] all: fix copyright header (#2763) Fixes #2758. Change the copyright header of all manually-written files to the recommended format. The copyright year is not changed. Autogenerated files should be updated by the code generator. Created by command below: ```shell find -name '*.java' | xargs grep -FL 'Generated("by GAPIC' | xargs fr -f 'Copyright (\d\d\d\d).*' -t 'Copyright $1 Google LLC'` ``` --- .../java/com/google/cloud/logging/logback/LoggingAppender.java | 2 +- .../java/com/example/enhancers/AnotherTestLoggingEnhancer.java | 2 +- .../test/java/com/example/enhancers/TestLoggingEnhancer.java | 2 +- .../com/google/cloud/logging/logback/LoggingAppenderTest.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/src/main/java/com/google/cloud/logging/logback/LoggingAppender.java b/google-cloud-contrib/google-cloud-logging-logback/src/main/java/com/google/cloud/logging/logback/LoggingAppender.java index 4bc46ef2c435..c670e7b20d0a 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/src/main/java/com/google/cloud/logging/logback/LoggingAppender.java +++ b/google-cloud-contrib/google-cloud-logging-logback/src/main/java/com/google/cloud/logging/logback/LoggingAppender.java @@ -1,5 +1,5 @@ /* - * Copyright 2017 Google Inc. All Rights Reserved. + * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-contrib/google-cloud-logging-logback/src/test/java/com/example/enhancers/AnotherTestLoggingEnhancer.java b/google-cloud-contrib/google-cloud-logging-logback/src/test/java/com/example/enhancers/AnotherTestLoggingEnhancer.java index 77aed4e10666..d9da84471af0 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/src/test/java/com/example/enhancers/AnotherTestLoggingEnhancer.java +++ b/google-cloud-contrib/google-cloud-logging-logback/src/test/java/com/example/enhancers/AnotherTestLoggingEnhancer.java @@ -1,5 +1,5 @@ /* - * Copyright 2017 Google Inc. All Rights Reserved. + * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-contrib/google-cloud-logging-logback/src/test/java/com/example/enhancers/TestLoggingEnhancer.java b/google-cloud-contrib/google-cloud-logging-logback/src/test/java/com/example/enhancers/TestLoggingEnhancer.java index 172e208761d0..f982b3f0690a 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/src/test/java/com/example/enhancers/TestLoggingEnhancer.java +++ b/google-cloud-contrib/google-cloud-logging-logback/src/test/java/com/example/enhancers/TestLoggingEnhancer.java @@ -1,5 +1,5 @@ /* - * Copyright 2017 Google Inc. All Rights Reserved. + * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-contrib/google-cloud-logging-logback/src/test/java/com/google/cloud/logging/logback/LoggingAppenderTest.java b/google-cloud-contrib/google-cloud-logging-logback/src/test/java/com/google/cloud/logging/logback/LoggingAppenderTest.java index 58142566dad1..cd437c5d98cc 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/src/test/java/com/google/cloud/logging/logback/LoggingAppenderTest.java +++ b/google-cloud-contrib/google-cloud-logging-logback/src/test/java/com/google/cloud/logging/logback/LoggingAppenderTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2017 Google Inc. All Rights Reserved. + * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From 71322279ccf78521b3a05537cfe552b1a6404092 Mon Sep 17 00:00:00 2001 From: Garrett Jones Date: Wed, 17 Jan 2018 15:26:06 -0800 Subject: [PATCH 0042/1629] Bumping to 1.15.0/0.33.0 for release --- google-cloud-contrib/google-cloud-logging-logback/README.md | 6 +++--- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/README.md b/google-cloud-contrib/google-cloud-logging-logback/README.md index 1146ed9ee7f9..de5657d4a17e 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/README.md +++ b/google-cloud-contrib/google-cloud-logging-logback/README.md @@ -19,16 +19,16 @@ If you are using Maven, add this to your pom.xml file com.google.cloud google-cloud-logging-logback - 0.32.0-alpha + 0.33.0-alpha ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-logging-logback:0.32.0-alpha' +compile 'com.google.cloud:google-cloud-logging-logback:0.33.0-alpha' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.32.0-alpha" +libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.33.0-alpha" ``` Usage diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 9ee67f404822..9df21d8d83a4 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.32.1-alpha-SNAPSHOT + 0.33.0-alpha jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.32.1-alpha-SNAPSHOT + 0.33.0-alpha From a9e59ef12655fcdc0f24321002e973622ea7d4bf Mon Sep 17 00:00:00 2001 From: Garrett Jones Date: Wed, 17 Jan 2018 17:13:33 -0800 Subject: [PATCH 0043/1629] Bumping to next snapshot versions (#2789) --- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 9df21d8d83a4..59d4078533f5 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.33.0-alpha + 0.33.1-alpha-SNAPSHOT jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.33.0-alpha + 0.33.1-alpha-SNAPSHOT From b820bf1ea653e8e56800720b865591c0ab9112b1 Mon Sep 17 00:00:00 2001 From: Michael Darakananda Date: Mon, 22 Jan 2018 11:25:39 +1100 Subject: [PATCH 0044/1629] logback: log stack trace (#2765) Fixes #2735. --- .../google-cloud-logging-logback/pom.xml | 13 +++++-- .../logging/logback/LoggingAppender.java | 38 +++++++++++++++++-- .../logging/logback/LoggingAppenderTest.java | 19 +++++----- .../cloud/logging/logback/StackTraceTest.java | 38 +++++++++++++++++++ 4 files changed, 92 insertions(+), 16 deletions(-) create mode 100644 google-cloud-contrib/google-cloud-logging-logback/src/test/java/com/google/cloud/logging/logback/StackTraceTest.java diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 59d4078533f5..5746c54b455b 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -44,10 +44,15 @@ test - junit - junit - 4.12 - test + junit + junit + 4.12 + test + + + com.google.truth + truth + test diff --git a/google-cloud-contrib/google-cloud-logging-logback/src/main/java/com/google/cloud/logging/logback/LoggingAppender.java b/google-cloud-contrib/google-cloud-logging-logback/src/main/java/com/google/cloud/logging/logback/LoggingAppender.java index c670e7b20d0a..9ac47ae617f4 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/src/main/java/com/google/cloud/logging/logback/LoggingAppender.java +++ b/google-cloud-contrib/google-cloud-logging-logback/src/main/java/com/google/cloud/logging/logback/LoggingAppender.java @@ -18,8 +18,11 @@ import ch.qos.logback.classic.Level; import ch.qos.logback.classic.spi.ILoggingEvent; +import ch.qos.logback.classic.spi.IThrowableProxy; +import ch.qos.logback.classic.spi.StackTraceElementProxy; import ch.qos.logback.core.UnsynchronizedAppenderBase; import ch.qos.logback.core.util.Loader; +import com.google.api.core.InternalApi; import com.google.cloud.MonitoredResource; import com.google.cloud.logging.LogEntry; import com.google.cloud.logging.Logging; @@ -29,7 +32,6 @@ import com.google.cloud.logging.MonitoredResourceUtil; import com.google.cloud.logging.Payload; import com.google.cloud.logging.Severity; - import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; @@ -206,10 +208,12 @@ Logging getLogging() { } private LogEntry logEntryFor(ILoggingEvent e) { - String payload = e.getFormattedMessage(); + StringBuilder payload = new StringBuilder(e.getFormattedMessage()).append('\n'); + writeStack(e.getThrowableProxy(), "", payload); + Level level = e.getLevel(); LogEntry.Builder builder = - LogEntry.newBuilder(Payload.StringPayload.of(payload)) + LogEntry.newBuilder(Payload.StringPayload.of(payload.toString().trim())) .setTimestamp(e.getTimeStamp()) .setSeverity(severityFor(level)); @@ -226,6 +230,34 @@ private LogEntry logEntryFor(ILoggingEvent e) { return builder.build(); } + @InternalApi("Visible for testing") + static void writeStack(IThrowableProxy throwProxy, String prefix, StringBuilder payload) { + if (throwProxy == null) { + return; + } + payload + .append(prefix) + .append(throwProxy.getClassName()) + .append(": ") + .append(throwProxy.getMessage()) + .append('\n'); + StackTraceElementProxy[] trace = throwProxy.getStackTraceElementProxyArray(); + if (trace == null) { + trace = new StackTraceElementProxy[0]; + } + + int commonFrames = throwProxy.getCommonFrames(); + int printFrames = trace.length - commonFrames; + for (int i = 0; i < printFrames; i++) { + payload.append(" ").append(trace[i]).append('\n'); + } + if (commonFrames != 0) { + payload.append(" ... ").append(commonFrames).append(" common frames elided\n"); + } + + writeStack(throwProxy.getCause(), "caused by: ", payload); + } + /** * Transforms Logback logging levels to Cloud severity. * diff --git a/google-cloud-contrib/google-cloud-logging-logback/src/test/java/com/google/cloud/logging/logback/LoggingAppenderTest.java b/google-cloud-contrib/google-cloud-logging-logback/src/test/java/com/google/cloud/logging/logback/LoggingAppenderTest.java index cd437c5d98cc..9d67190b3d92 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/src/test/java/com/google/cloud/logging/logback/LoggingAppenderTest.java +++ b/google-cloud-contrib/google-cloud-logging-logback/src/test/java/com/google/cloud/logging/logback/LoggingAppenderTest.java @@ -16,6 +16,7 @@ package com.google.cloud.logging.logback; +import static com.google.common.truth.Truth.assertThat; import static org.easymock.EasyMock.anyObject; import static org.easymock.EasyMock.capture; import static org.easymock.EasyMock.expectLastCall; @@ -36,7 +37,6 @@ import org.easymock.Capture; import org.easymock.EasyMock; import org.easymock.EasyMockRunner; -import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -96,8 +96,8 @@ public void testFlushLevelConfigUpdatesLoggingFlushSeverity() { loggingAppender.start(); loggingAppender.doAppend(loggingEvent); verify(logging); - Assert.assertTrue(capturedArgument.getValue().iterator().hasNext()); - Assert.assertTrue(logEntry.equals(capturedArgument.getValue().iterator().next())); + assertThat(capturedArgument.getValue().iterator().hasNext()).isTrue(); + assertThat(capturedArgument.getValue().iterator().next()).isEqualTo(logEntry); } @Test @@ -131,8 +131,8 @@ public void testFilterLogsOnlyLogsAtOrAboveLogLevel() { // error event gets logged loggingAppender.doAppend(loggingEvent2); verify(logging); - Assert.assertTrue(capturedArgument.getValue().iterator().hasNext()); - Assert.assertTrue(logEntry.equals(capturedArgument.getValue().iterator().next())); + assertThat(capturedArgument.getValue().iterator().hasNext()).isTrue(); + assertThat(capturedArgument.getValue().iterator().next()).isEqualTo(logEntry); } @Test @@ -162,8 +162,8 @@ public void testEnhancersAddCorrectLabelsToLogEntries() { LoggingEvent loggingEvent = createLoggingEvent(Level.WARN, timestamp.getSeconds()); loggingAppender.doAppend(loggingEvent); verify(logging); - Assert.assertTrue(capturedArgument.getValue().iterator().hasNext()); - Assert.assertTrue(logEntry.equals(capturedArgument.getValue().iterator().next())); + assertThat(capturedArgument.getValue().iterator().hasNext()).isTrue(); + assertThat(capturedArgument.getValue().iterator().next()).isEqualTo(logEntry); } @Test @@ -178,8 +178,9 @@ public void testDefaultWriteOptionsHasExpectedDefaults() { Timestamp timestamp = Timestamp.ofTimeSecondsAndNanos(100000, 0); LoggingEvent loggingEvent = createLoggingEvent(Level.ERROR, timestamp.getSeconds()); loggingAppender.doAppend(loggingEvent); - Assert.assertTrue(logNameArg.getValue().equals(defaultWriteOptions[0])); - Assert.assertTrue(resourceArg.getValue().equals(defaultWriteOptions[1])); + + assertThat(logNameArg.getValue()).isEqualTo(defaultWriteOptions[0]); + assertThat(resourceArg.getValue()).isEqualTo(defaultWriteOptions[1]); } private LoggingEvent createLoggingEvent(Level level, long timestamp) { diff --git a/google-cloud-contrib/google-cloud-logging-logback/src/test/java/com/google/cloud/logging/logback/StackTraceTest.java b/google-cloud-contrib/google-cloud-logging-logback/src/test/java/com/google/cloud/logging/logback/StackTraceTest.java new file mode 100644 index 000000000000..fa26b858fb45 --- /dev/null +++ b/google-cloud-contrib/google-cloud-logging-logback/src/test/java/com/google/cloud/logging/logback/StackTraceTest.java @@ -0,0 +1,38 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.logback; + +import static com.google.common.truth.Truth.assertThat; + +import ch.qos.logback.classic.spi.ThrowableProxy; +import org.junit.Test; + +public class StackTraceTest { + @Test + public void testStack() { + Exception ex = new UnsupportedOperationException("foo"); + ex = new IllegalStateException("bar", ex); + + StringBuilder stackBuilder = new StringBuilder(); + LoggingAppender.writeStack(new ThrowableProxy(ex), "", stackBuilder); + String stack = stackBuilder.toString(); + + assertThat(stack).contains("java.lang.IllegalStateException: bar"); + assertThat(stack).contains("caused by: java.lang.UnsupportedOperationException: foo"); + assertThat(stack).contains("common frames elided"); + } +} From 21b25f0e847d5debf7670483fdee9ae1d33e448f Mon Sep 17 00:00:00 2001 From: neozwu Date: Mon, 5 Feb 2018 11:40:50 -0800 Subject: [PATCH 0045/1629] bump version to 0.34.0/0.16.0 for release (#2856) * bump version to 0.34.0/0.16.0 for release * bump bom in pom --- google-cloud-contrib/google-cloud-logging-logback/README.md | 6 +++--- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/README.md b/google-cloud-contrib/google-cloud-logging-logback/README.md index de5657d4a17e..7f5aa4e42590 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/README.md +++ b/google-cloud-contrib/google-cloud-logging-logback/README.md @@ -19,16 +19,16 @@ If you are using Maven, add this to your pom.xml file com.google.cloud google-cloud-logging-logback - 0.33.0-alpha + 0.34.0-alpha ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-logging-logback:0.33.0-alpha' +compile 'com.google.cloud:google-cloud-logging-logback:0.34.0-alpha' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.33.0-alpha" +libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.34.0-alpha" ``` Usage diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 5746c54b455b..bcf0a4c97bf2 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.33.1-alpha-SNAPSHOT + 0.34.0-alpha jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.33.1-alpha-SNAPSHOT + 0.34.0-alpha From 3bac7213bb3d01ef0f38c27c274e67b5f2f3f574 Mon Sep 17 00:00:00 2001 From: neozwu Date: Mon, 5 Feb 2018 13:08:51 -0800 Subject: [PATCH 0046/1629] bump version for dev (#2859) --- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index bcf0a4c97bf2..627bff319679 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.34.0-alpha + 0.34.1-alpha-SNAPSHOT jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.34.0-alpha + 0.34.1-alpha-SNAPSHOT From e7a03c064dc87448fe1f98d08a99451684cfab61 Mon Sep 17 00:00:00 2001 From: Vadym Matsishevskyi <25311427+vam-google@users.noreply.github.com> Date: Wed, 21 Feb 2018 09:36:05 -0800 Subject: [PATCH 0047/1629] Release 0.35.0-alpha, 0.35.0-beta and 1.17.0 (#2929) Also: fix javadoc issue in Role.java file; fix s/google-cloud-bom.version/bom.version to fix the version update script; fix root README.md version from 0.33.0 (should be 0.34.0) directly to 0.35.0); fix javadoc issue in LocalStorageHelper.java. --- google-cloud-contrib/google-cloud-logging-logback/README.md | 6 +++--- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/README.md b/google-cloud-contrib/google-cloud-logging-logback/README.md index 7f5aa4e42590..1825a11d62c2 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/README.md +++ b/google-cloud-contrib/google-cloud-logging-logback/README.md @@ -19,16 +19,16 @@ If you are using Maven, add this to your pom.xml file com.google.cloud google-cloud-logging-logback - 0.34.0-alpha + 0.35.0-alpha ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-logging-logback:0.34.0-alpha' +compile 'com.google.cloud:google-cloud-logging-logback:0.35.0-alpha' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.34.0-alpha" +libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.35.0-alpha" ``` Usage diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 627bff319679..14d36c676978 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.34.1-alpha-SNAPSHOT + 0.35.0-alpha jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.34.1-alpha-SNAPSHOT + 0.35.0-alpha From a92393a9e853102015aec2a3893b4f2a53dae799 Mon Sep 17 00:00:00 2001 From: Vadym Matsishevskyi <25311427+vam-google@users.noreply.github.com> Date: Wed, 21 Feb 2018 13:09:13 -0800 Subject: [PATCH 0048/1629] Bump versions to 0.35.1-alpha-SNAPSHOT, 0.35.1-beta-SNAPSHOT and 1.17.1-SNAPSHOT for development (#2933) --- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 14d36c676978..a4d4c13d5703 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.35.0-alpha + 0.35.1-alpha-SNAPSHOT jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.35.0-alpha + 0.35.1-alpha-SNAPSHOT From 75d67e9062e55b4d1372cdc53fa995a740f6148f Mon Sep 17 00:00:00 2001 From: Garrett Jones Date: Mon, 26 Feb 2018 10:18:31 -0800 Subject: [PATCH 0049/1629] Adding new version update scripts (#2947) versions.txt has both the last-released version (in maven) and the current version (either about-to-be-released or the snapshot version). There are two scripts: bump_versions.py: Bumps the versions stored in version.txt replace_versions.py: Idempotent script which replaces the versions everywhere they are tagged Users can choose to manually update versions.txt if they so choose and skip the bump_versions.py script. --- google-cloud-contrib/google-cloud-logging-logback/README.md | 3 +++ google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/README.md b/google-cloud-contrib/google-cloud-logging-logback/README.md index 1825a11d62c2..81421ed2cbbb 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/README.md +++ b/google-cloud-contrib/google-cloud-logging-logback/README.md @@ -14,6 +14,8 @@ This library allows you to use [Logback](https://logback.qos.ch/) configuration Quickstart ---------- + +[//]: # ({x-version-update-start:google-cloud-logging-logback:released}) If you are using Maven, add this to your pom.xml file ```xml @@ -30,6 +32,7 @@ If you are using SBT, add this to your dependencies ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.35.0-alpha" ``` +[//]: # ({x-version-update-end}) Usage ----- diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index a4d4c13d5703..4e46dc67ea34 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.35.1-alpha-SNAPSHOT + 0.35.1-alpha-SNAPSHOT jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.35.1-alpha-SNAPSHOT + 0.35.1-alpha-SNAPSHOT From c23860882c040143b7263760a63f69635b7f2297 Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Tue, 27 Feb 2018 09:50:11 -0800 Subject: [PATCH 0050/1629] Version bump to 0.36.0 (#2967) --- google-cloud-contrib/google-cloud-logging-logback/README.md | 6 +++--- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/README.md b/google-cloud-contrib/google-cloud-logging-logback/README.md index 81421ed2cbbb..50a180d5e765 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/README.md +++ b/google-cloud-contrib/google-cloud-logging-logback/README.md @@ -21,16 +21,16 @@ If you are using Maven, add this to your pom.xml file com.google.cloud google-cloud-logging-logback - 0.35.0-alpha + 0.36.0-alpha ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-logging-logback:0.35.0-alpha' +compile 'com.google.cloud:google-cloud-logging-logback:0.36.0-alpha' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.35.0-alpha" +libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.36.0-alpha" ``` [//]: # ({x-version-update-end}) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 4e46dc67ea34..8d58e6b82fd5 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.35.1-alpha-SNAPSHOT + 0.36.0-alpha jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.35.1-alpha-SNAPSHOT + 0.36.0-alpha From 25165429abb0408bb771a15ce7c73ab16d7a0aea Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Tue, 27 Feb 2018 10:07:02 -0800 Subject: [PATCH 0051/1629] Version bump to snapshot (#2966) --- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 8d58e6b82fd5..964f2bc81453 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.36.0-alpha + 0.36.1-alpha-SNAPSHOT jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.36.0-alpha + 0.36.1-alpha-SNAPSHOT From 68943d3e832afc7b1c25f090d1467c729e85af18 Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Tue, 27 Feb 2018 11:04:55 -0800 Subject: [PATCH 0052/1629] bump version to 0.37.0 (#2969) --- google-cloud-contrib/google-cloud-logging-logback/README.md | 6 +++--- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/README.md b/google-cloud-contrib/google-cloud-logging-logback/README.md index 50a180d5e765..817af3e3101b 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/README.md +++ b/google-cloud-contrib/google-cloud-logging-logback/README.md @@ -21,16 +21,16 @@ If you are using Maven, add this to your pom.xml file com.google.cloud google-cloud-logging-logback - 0.36.0-alpha + 0.37.0-alpha ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-logging-logback:0.36.0-alpha' +compile 'com.google.cloud:google-cloud-logging-logback:0.37.0-alpha' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.36.0-alpha" +libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.37.0-alpha" ``` [//]: # ({x-version-update-end}) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 964f2bc81453..36c754ecd2fe 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.36.1-alpha-SNAPSHOT + 0.37.0-alpha jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.36.1-alpha-SNAPSHOT + 0.37.0-alpha From c2d92b1421a5c6e1742f7c6b09c5bba0593fe328 Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Tue, 27 Feb 2018 11:29:42 -0800 Subject: [PATCH 0053/1629] Version bump to snapshot (#2970) --- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 36c754ecd2fe..0612576cf3bb 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.37.0-alpha + 0.37.1-alpha-SNAPSHOT jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.37.0-alpha + 0.37.1-alpha-SNAPSHOT From a19dec052c46d0b4c119eec23002a3664094697e Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Tue, 6 Mar 2018 13:34:25 -0800 Subject: [PATCH 0054/1629] releasing 0.38.0 (#3004) --- google-cloud-contrib/google-cloud-logging-logback/README.md | 6 +++--- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/README.md b/google-cloud-contrib/google-cloud-logging-logback/README.md index 817af3e3101b..13f62da37248 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/README.md +++ b/google-cloud-contrib/google-cloud-logging-logback/README.md @@ -21,16 +21,16 @@ If you are using Maven, add this to your pom.xml file com.google.cloud google-cloud-logging-logback - 0.37.0-alpha + 0.38.0-alpha ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-logging-logback:0.37.0-alpha' +compile 'com.google.cloud:google-cloud-logging-logback:0.38.0-alpha' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.37.0-alpha" +libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.38.0-alpha" ``` [//]: # ({x-version-update-end}) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 0612576cf3bb..65c525f98591 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.37.1-alpha-SNAPSHOT + 0.38.0-alpha jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.37.1-alpha-SNAPSHOT + 0.38.0-alpha From 53dbad7fe98977df50dc7407651fd64d5fbb4415 Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Tue, 6 Mar 2018 13:47:43 -0800 Subject: [PATCH 0055/1629] Bump versions to snapshot (#3005) --- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 65c525f98591..af5906a99a11 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.38.0-alpha + 0.38.1-alpha-SNAPSHOT jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.38.0-alpha + 0.38.1-alpha-SNAPSHOT From 3c2cd7127088db67e9cf9907bc32f19f308e6702 Mon Sep 17 00:00:00 2001 From: neozwu Date: Wed, 14 Mar 2018 13:36:03 -0700 Subject: [PATCH 0056/1629] release 0.39.0 (#3042) --- google-cloud-contrib/google-cloud-logging-logback/README.md | 6 +++--- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/README.md b/google-cloud-contrib/google-cloud-logging-logback/README.md index 13f62da37248..40583f0e59e1 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/README.md +++ b/google-cloud-contrib/google-cloud-logging-logback/README.md @@ -21,16 +21,16 @@ If you are using Maven, add this to your pom.xml file com.google.cloud google-cloud-logging-logback - 0.38.0-alpha + 0.39.0-alpha ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-logging-logback:0.38.0-alpha' +compile 'com.google.cloud:google-cloud-logging-logback:0.39.0-alpha' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.38.0-alpha" +libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.39.0-alpha" ``` [//]: # ({x-version-update-end}) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index af5906a99a11..b4772d7fb0b7 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.38.1-alpha-SNAPSHOT + 0.39.0-alpha jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.38.1-alpha-SNAPSHOT + 0.39.0-alpha From 8d588436e1c89ff977cb0b840fc390815b74c143 Mon Sep 17 00:00:00 2001 From: neozwu Date: Wed, 14 Mar 2018 16:08:32 -0700 Subject: [PATCH 0057/1629] bump version for development (#3045) --- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index b4772d7fb0b7..94441dad8f7e 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.39.0-alpha + 0.39.1-alpha-SNAPSHOT jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.39.0-alpha + 0.39.1-alpha-SNAPSHOT From b30a6fda88574a331e2ae0027029975de31e3bdb Mon Sep 17 00:00:00 2001 From: Neo Wu Date: Fri, 16 Mar 2018 16:12:00 -0700 Subject: [PATCH 0058/1629] Release 0.40.0 --- google-cloud-contrib/google-cloud-logging-logback/README.md | 6 +++--- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/README.md b/google-cloud-contrib/google-cloud-logging-logback/README.md index 40583f0e59e1..167c1ac90be8 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/README.md +++ b/google-cloud-contrib/google-cloud-logging-logback/README.md @@ -21,16 +21,16 @@ If you are using Maven, add this to your pom.xml file com.google.cloud google-cloud-logging-logback - 0.39.0-alpha + 0.40.0-alpha ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-logging-logback:0.39.0-alpha' +compile 'com.google.cloud:google-cloud-logging-logback:0.40.0-alpha' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.39.0-alpha" +libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.40.0-alpha" ``` [//]: # ({x-version-update-end}) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 94441dad8f7e..26ffbde07f18 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.39.1-alpha-SNAPSHOT + 0.40.0-alpha jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.39.1-alpha-SNAPSHOT + 0.40.0-alpha From 22aae0f03ee60aa8f05b800d06ac2a22de569a25 Mon Sep 17 00:00:00 2001 From: neozwu Date: Fri, 16 Mar 2018 20:37:45 -0700 Subject: [PATCH 0059/1629] bump to snapshot version (#3055) --- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 26ffbde07f18..a09b18bb9d43 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.40.0-alpha + 0.40.1-alpha-SNAPSHOT jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.40.0-alpha + 0.40.1-alpha-SNAPSHOT From 0f03687cc3d9d66dea8a49fc931d0633117c120f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Skj=C3=B8lberg?= Date: Sat, 17 Mar 2018 05:57:27 +0100 Subject: [PATCH 0060/1629] Add interface for enhancing Logback events (#2734) --- .../logging/logback/LoggingAppender.java | 38 +++++++++++++++---- .../logging/logback/LoggingEventEnhancer.java | 29 ++++++++++++++ 2 files changed, 60 insertions(+), 7 deletions(-) create mode 100644 google-cloud-contrib/google-cloud-logging-logback/src/main/java/com/google/cloud/logging/logback/LoggingEventEnhancer.java diff --git a/google-cloud-contrib/google-cloud-logging-logback/src/main/java/com/google/cloud/logging/logback/LoggingAppender.java b/google-cloud-contrib/google-cloud-logging-logback/src/main/java/com/google/cloud/logging/logback/LoggingAppender.java index 9ac47ae617f4..8124754055c1 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/src/main/java/com/google/cloud/logging/logback/LoggingAppender.java +++ b/google-cloud-contrib/google-cloud-logging-logback/src/main/java/com/google/cloud/logging/logback/LoggingAppender.java @@ -67,12 +67,14 @@ public class LoggingAppender extends UnsynchronizedAppenderBase { private volatile Logging logging; private List loggingEnhancers; + private List loggingEventEnhancers; private WriteOption[] defaultWriteOptions; private Level flushLevel; private String log; private String resourceType; private Set enhancerClassNames = new HashSet<>(); + private Set loggingEventEnhancerClassNames = new HashSet<>(); /** * Batched logging requests get immediately flushed for logs at or above this level. @@ -114,6 +116,11 @@ public void setResourceType(String resourceType) { public void addEnhancer(String enhancerClassName) { this.enhancerClassNames.add(enhancerClassName); } + + public void addLoggingEventEnhancer(String enhancerClassName) { + this.loggingEventEnhancerClassNames.add(enhancerClassName); + } + Level getFlushLevel() { return (flushLevel != null) ? flushLevel : Level.ERROR; @@ -128,11 +135,19 @@ MonitoredResource getMonitoredResource(String projectId) { } List getLoggingEnhancers() { - List loggingEnhancers = new ArrayList<>(); - if (enhancerClassNames != null) { - for (String enhancerClassName : enhancerClassNames) { + return getEnhancers(enhancerClassNames); + } + + List getLoggingEventEnhancers() { + return getEnhancers(loggingEventEnhancerClassNames); + } + + List getEnhancers(Set classNames) { + List loggingEnhancers = new ArrayList<>(); + if (classNames != null) { + for (String enhancerClassName : classNames) { if (enhancerClassName != null) { - LoggingEnhancer enhancer = getEnhancer(enhancerClassName); + T enhancer = getEnhancer(enhancerClassName); if (enhancer != null) { loggingEnhancers.add(enhancer); } @@ -142,10 +157,10 @@ List getLoggingEnhancers() { return loggingEnhancers; } - private LoggingEnhancer getEnhancer(String enhancerClassName) { + private T getEnhancer(String enhancerClassName) { try { - Class clz = - (Class) + Class clz = + (Class) Loader.loadClass(enhancerClassName.trim()); return clz.newInstance(); } catch (Exception ex) { @@ -170,6 +185,9 @@ public synchronized void start() { List resourceEnhancers = MonitoredResourceUtil.getResourceEnhancers(); loggingEnhancers.addAll(resourceEnhancers); loggingEnhancers.addAll(getLoggingEnhancers()); + loggingEventEnhancers = new ArrayList<>(); + loggingEventEnhancers.addAll(getLoggingEventEnhancers()); + super.start(); } @@ -227,6 +245,12 @@ private LogEntry logEntryFor(ILoggingEvent e) { } } + if (loggingEventEnhancers != null) { + for (LoggingEventEnhancer enhancer : loggingEventEnhancers) { + enhancer.enhanceLogEntry(builder, e); + } + } + return builder.build(); } diff --git a/google-cloud-contrib/google-cloud-logging-logback/src/main/java/com/google/cloud/logging/logback/LoggingEventEnhancer.java b/google-cloud-contrib/google-cloud-logging-logback/src/main/java/com/google/cloud/logging/logback/LoggingEventEnhancer.java new file mode 100644 index 000000000000..53aa518b4bb0 --- /dev/null +++ b/google-cloud-contrib/google-cloud-logging-logback/src/main/java/com/google/cloud/logging/logback/LoggingEventEnhancer.java @@ -0,0 +1,29 @@ +/* + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.logback; + +import com.google.cloud.logging.LogEntry; + +import ch.qos.logback.classic.spi.ILoggingEvent; + +/** + * An enhancer for {@linkplain ILoggingEvent} log entries. + * Used to add custom labels to the {@link LogEntry.Builder}. + */ +public interface LoggingEventEnhancer { + void enhanceLogEntry(LogEntry.Builder builder, ILoggingEvent e); +} From 60347a68bd9dbb652bb8e2d7f6e04eda755ac3e5 Mon Sep 17 00:00:00 2001 From: Vadym Matsishevskyi <25311427+vam-google@users.noreply.github.com> Date: Thu, 22 Mar 2018 13:05:34 -0700 Subject: [PATCH 0061/1629] Release 0.41.0 (#3076) --- google-cloud-contrib/google-cloud-logging-logback/README.md | 6 +++--- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/README.md b/google-cloud-contrib/google-cloud-logging-logback/README.md index 167c1ac90be8..d9d9b9c6ed31 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/README.md +++ b/google-cloud-contrib/google-cloud-logging-logback/README.md @@ -21,16 +21,16 @@ If you are using Maven, add this to your pom.xml file com.google.cloud google-cloud-logging-logback - 0.40.0-alpha + 0.41.0-alpha ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-logging-logback:0.40.0-alpha' +compile 'com.google.cloud:google-cloud-logging-logback:0.41.0-alpha' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.40.0-alpha" +libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.41.0-alpha" ``` [//]: # ({x-version-update-end}) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index a09b18bb9d43..19be54515ea3 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.40.1-alpha-SNAPSHOT + 0.41.0-alpha jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.40.1-alpha-SNAPSHOT + 0.41.0-alpha From 87ff7b9afba604aa8413f7e231007788052db0f6 Mon Sep 17 00:00:00 2001 From: Vadym Matsishevskyi <25311427+vam-google@users.noreply.github.com> Date: Fri, 23 Mar 2018 09:45:54 -0700 Subject: [PATCH 0062/1629] Bump version to 0.41.1-SNAPSHOT for development (#3079) Add texttospeech in root readme --- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 19be54515ea3..b921e1e404c8 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.41.0-alpha + 0.41.1-alpha-SNAPSHOT jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.41.0-alpha + 0.41.1-alpha-SNAPSHOT From af0e6e800406e3342c3b6f564c6dcdcc2f449781 Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Tue, 27 Mar 2018 16:45:53 -0700 Subject: [PATCH 0063/1629] Release 0.42.0 (#3095) --- google-cloud-contrib/google-cloud-logging-logback/README.md | 6 +++--- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/README.md b/google-cloud-contrib/google-cloud-logging-logback/README.md index d9d9b9c6ed31..3125f4c11126 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/README.md +++ b/google-cloud-contrib/google-cloud-logging-logback/README.md @@ -21,16 +21,16 @@ If you are using Maven, add this to your pom.xml file com.google.cloud google-cloud-logging-logback - 0.41.0-alpha + 0.42.0-alpha ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-logging-logback:0.41.0-alpha' +compile 'com.google.cloud:google-cloud-logging-logback:0.42.0-alpha' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.41.0-alpha" +libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.42.0-alpha" ``` [//]: # ({x-version-update-end}) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index b921e1e404c8..973d6e52d0b8 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.41.1-alpha-SNAPSHOT + 0.42.0-alpha jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.41.1-alpha-SNAPSHOT + 0.42.0-alpha From 638259c7aadb2cd7768a53357ad5ebb28e1e390d Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Tue, 27 Mar 2018 16:57:25 -0700 Subject: [PATCH 0064/1629] Bump to snapshot version for development (#3096) --- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 973d6e52d0b8..ed98ec1456ec 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.42.0-alpha + 0.42.1-alpha-SNAPSHOT jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.42.0-alpha + 0.42.1-alpha-SNAPSHOT From e5ee9f7dcdecea8361cd7fe82bab277f9b347eb9 Mon Sep 17 00:00:00 2001 From: Garrett Jones Date: Mon, 2 Apr 2018 10:23:07 -0700 Subject: [PATCH 0065/1629] Release 0.42.1 --- google-cloud-contrib/google-cloud-logging-logback/README.md | 6 +++--- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/README.md b/google-cloud-contrib/google-cloud-logging-logback/README.md index 3125f4c11126..cc22e2d61545 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/README.md +++ b/google-cloud-contrib/google-cloud-logging-logback/README.md @@ -21,16 +21,16 @@ If you are using Maven, add this to your pom.xml file com.google.cloud google-cloud-logging-logback - 0.42.0-alpha + 0.42.1-alpha ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-logging-logback:0.42.0-alpha' +compile 'com.google.cloud:google-cloud-logging-logback:0.42.1-alpha' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.42.0-alpha" +libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.42.1-alpha" ``` [//]: # ({x-version-update-end}) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index ed98ec1456ec..c1b1c13bf209 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.42.1-alpha-SNAPSHOT + 0.42.1-alpha jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.42.1-alpha-SNAPSHOT + 0.42.1-alpha From b2c459ee10f67ed57eb05d27d8b0912c0795ab76 Mon Sep 17 00:00:00 2001 From: Garrett Jones Date: Mon, 2 Apr 2018 11:52:39 -0700 Subject: [PATCH 0066/1629] Bumping to next snapshot versions (#3117) --- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index c1b1c13bf209..e51b18314a38 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.42.1-alpha + 0.42.2-alpha-SNAPSHOT jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.42.1-alpha + 0.42.2-alpha-SNAPSHOT From 7ae594cc481c303cee9350500a2a428a8f08ff35 Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Wed, 4 Apr 2018 18:00:43 -0700 Subject: [PATCH 0067/1629] Release 0.43.0/1.25.0 (#3127) --- google-cloud-contrib/google-cloud-logging-logback/README.md | 6 +++--- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/README.md b/google-cloud-contrib/google-cloud-logging-logback/README.md index cc22e2d61545..091d3741e44c 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/README.md +++ b/google-cloud-contrib/google-cloud-logging-logback/README.md @@ -21,16 +21,16 @@ If you are using Maven, add this to your pom.xml file com.google.cloud google-cloud-logging-logback - 0.42.1-alpha + 0.43.0-alpha ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-logging-logback:0.42.1-alpha' +compile 'com.google.cloud:google-cloud-logging-logback:0.43.0-alpha' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.42.1-alpha" +libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.43.0-alpha" ``` [//]: # ({x-version-update-end}) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index e51b18314a38..7becf6da9198 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.42.2-alpha-SNAPSHOT + 0.43.0-alpha jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.42.2-alpha-SNAPSHOT + 0.43.0-alpha From 8ed85b1c8a17d453a94592cae6d0254747e6237f Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Wed, 4 Apr 2018 18:14:35 -0700 Subject: [PATCH 0068/1629] Bump to snapshot version (#3128) --- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 7becf6da9198..f79448a4fe58 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.43.0-alpha + 0.43.1-alpha-SNAPSHOT jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.43.0-alpha + 0.43.1-alpha-SNAPSHOT From 9af7ce96523ca4349bc07dc303060d626c68824b Mon Sep 17 00:00:00 2001 From: neozwu Date: Mon, 16 Apr 2018 08:25:35 -0700 Subject: [PATCH 0069/1629] Release 0.44.0 (#3161) --- google-cloud-contrib/google-cloud-logging-logback/README.md | 6 +++--- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/README.md b/google-cloud-contrib/google-cloud-logging-logback/README.md index 091d3741e44c..32d4cc178d32 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/README.md +++ b/google-cloud-contrib/google-cloud-logging-logback/README.md @@ -21,16 +21,16 @@ If you are using Maven, add this to your pom.xml file com.google.cloud google-cloud-logging-logback - 0.43.0-alpha + 0.44.0-alpha ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-logging-logback:0.43.0-alpha' +compile 'com.google.cloud:google-cloud-logging-logback:0.44.0-alpha' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.43.0-alpha" +libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.44.0-alpha" ``` [//]: # ({x-version-update-end}) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index f79448a4fe58..eb7314b53b73 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.43.1-alpha-SNAPSHOT + 0.44.0-alpha jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.43.1-alpha-SNAPSHOT + 0.44.0-alpha From 39f516d331d8f1033f3019fd5e7fcb581df31ddd Mon Sep 17 00:00:00 2001 From: neozwu Date: Mon, 16 Apr 2018 09:12:27 -0700 Subject: [PATCH 0070/1629] bump version for development (#3162) --- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index eb7314b53b73..4bbd33a651c9 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.44.0-alpha + 0.44.1-alpha-SNAPSHOT jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.44.0-alpha + 0.44.1-alpha-SNAPSHOT From 093acd5165578fa6bd5178713c5a5dcc5de28d1d Mon Sep 17 00:00:00 2001 From: Vadym Matsishevskyi <25311427+vam-google@users.noreply.github.com> Date: Fri, 20 Apr 2018 08:20:26 -0700 Subject: [PATCH 0071/1629] Release 0.45.0 (#3174) --- google-cloud-contrib/google-cloud-logging-logback/README.md | 6 +++--- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/README.md b/google-cloud-contrib/google-cloud-logging-logback/README.md index 32d4cc178d32..7e7a4b190fd4 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/README.md +++ b/google-cloud-contrib/google-cloud-logging-logback/README.md @@ -21,16 +21,16 @@ If you are using Maven, add this to your pom.xml file com.google.cloud google-cloud-logging-logback - 0.44.0-alpha + 0.45.0-alpha ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-logging-logback:0.44.0-alpha' +compile 'com.google.cloud:google-cloud-logging-logback:0.45.0-alpha' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.44.0-alpha" +libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.45.0-alpha" ``` [//]: # ({x-version-update-end}) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 4bbd33a651c9..37cfe550179b 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.44.1-alpha-SNAPSHOT + 0.45.0-alpha jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.44.1-alpha-SNAPSHOT + 0.45.0-alpha From 7b1ebd5dbf2f4f7b7fdbcd125a8ad9df180c6705 Mon Sep 17 00:00:00 2001 From: Vadym Matsishevskyi <25311427+vam-google@users.noreply.github.com> Date: Fri, 20 Apr 2018 11:30:31 -0700 Subject: [PATCH 0072/1629] Bump version to 0.45.1-alpha-SNAPSHOT for development (#3177) --- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 37cfe550179b..e5699bf8bc7f 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.45.0-alpha + 0.45.1-alpha-SNAPSHOT jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.45.0-alpha + 0.45.1-alpha-SNAPSHOT From 6101db6e8a6b52117e48177cd2a29cb85c2f8564 Mon Sep 17 00:00:00 2001 From: Garrett Jones Date: Fri, 27 Apr 2018 11:34:52 -0700 Subject: [PATCH 0073/1629] Release 0.46.0/1.28.0 --- google-cloud-contrib/google-cloud-logging-logback/README.md | 6 +++--- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/README.md b/google-cloud-contrib/google-cloud-logging-logback/README.md index 7e7a4b190fd4..9152cf54b435 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/README.md +++ b/google-cloud-contrib/google-cloud-logging-logback/README.md @@ -21,16 +21,16 @@ If you are using Maven, add this to your pom.xml file com.google.cloud google-cloud-logging-logback - 0.45.0-alpha + 0.46.0-alpha ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-logging-logback:0.45.0-alpha' +compile 'com.google.cloud:google-cloud-logging-logback:0.46.0-alpha' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.45.0-alpha" +libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.46.0-alpha" ``` [//]: # ({x-version-update-end}) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index e5699bf8bc7f..a2a33b2d6468 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.45.1-alpha-SNAPSHOT + 0.46.0-alpha jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.45.1-alpha-SNAPSHOT + 0.46.0-alpha From 62bdd1fb3529a8d8a3759c32c8f411cbe74cfaf2 Mon Sep 17 00:00:00 2001 From: Garrett Jones Date: Fri, 27 Apr 2018 15:07:30 -0700 Subject: [PATCH 0074/1629] Bump to snapshot versions (#3211) --- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index a2a33b2d6468..888344f1e7bb 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.46.0-alpha + 0.46.1-alpha-SNAPSHOT jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.46.0-alpha + 0.46.1-alpha-SNAPSHOT From 86576a6340910b3e60394d2a5ed4ff4728f35803 Mon Sep 17 00:00:00 2001 From: Vadym Matsishevskyi <25311427+vam-google@users.noreply.github.com> Date: Mon, 30 Apr 2018 20:53:04 -0700 Subject: [PATCH 0075/1629] Move grpc/proto pacckages to google-cloud-java from api-client-staging. (#3212) --- grpc-google-cloud-logging-v2/pom.xml | 31 + .../logging/v2/ConfigServiceV2Grpc.java | 1182 +++++ .../logging/v2/LoggingServiceV2Grpc.java | 729 +++ .../logging/v2/MetricsServiceV2Grpc.java | 681 +++ proto-google-cloud-logging-v2/pom.xml | 31 + .../logging/v2/BillingExclusionName.java | 198 + .../com/google/logging/v2/BillingLogName.java | 198 + .../com/google/logging/v2/BillingName.java | 175 + .../google/logging/v2/BillingSinkName.java | 198 + .../logging/v2/CreateExclusionRequest.java | 828 ++++ .../v2/CreateExclusionRequestOrBuilder.java | 65 + .../logging/v2/CreateLogMetricRequest.java | 807 ++++ .../v2/CreateLogMetricRequestOrBuilder.java | 59 + .../google/logging/v2/CreateSinkRequest.java | 939 ++++ .../v2/CreateSinkRequestOrBuilder.java | 83 + .../logging/v2/DeleteExclusionRequest.java | 587 +++ .../v2/DeleteExclusionRequestOrBuilder.java | 37 + .../logging/v2/DeleteLogMetricRequest.java | 559 +++ .../v2/DeleteLogMetricRequestOrBuilder.java | 29 + .../google/logging/v2/DeleteLogRequest.java | 615 +++ .../logging/v2/DeleteLogRequestOrBuilder.java | 45 + .../google/logging/v2/DeleteSinkRequest.java | 594 +++ .../v2/DeleteSinkRequestOrBuilder.java | 39 + .../com/google/logging/v2/ExclusionName.java | 23 + .../com/google/logging/v2/ExclusionNames.java | 39 + .../logging/v2/FolderExclusionName.java | 198 + .../com/google/logging/v2/FolderLogName.java | 198 + .../com/google/logging/v2/FolderName.java | 175 + .../com/google/logging/v2/FolderSinkName.java | 198 + .../logging/v2/GetExclusionRequest.java | 587 +++ .../v2/GetExclusionRequestOrBuilder.java | 37 + .../logging/v2/GetLogMetricRequest.java | 559 +++ .../v2/GetLogMetricRequestOrBuilder.java | 29 + .../com/google/logging/v2/GetSinkRequest.java | 587 +++ .../logging/v2/GetSinkRequestOrBuilder.java | 37 + .../logging/v2/ListExclusionsRequest.java | 838 ++++ .../v2/ListExclusionsRequestOrBuilder.java | 70 + .../logging/v2/ListExclusionsResponse.java | 1006 +++++ .../v2/ListExclusionsResponseOrBuilder.java | 75 + .../logging/v2/ListLogEntriesRequest.java | 1621 +++++++ .../v2/ListLogEntriesRequestOrBuilder.java | 212 + .../logging/v2/ListLogEntriesResponse.java | 1094 +++++ .../v2/ListLogEntriesResponseOrBuilder.java | 97 + .../logging/v2/ListLogMetricsRequest.java | 817 ++++ .../v2/ListLogMetricsRequestOrBuilder.java | 64 + .../logging/v2/ListLogMetricsResponse.java | 1006 +++++ .../v2/ListLogMetricsResponseOrBuilder.java | 75 + .../google/logging/v2/ListLogsRequest.java | 838 ++++ .../logging/v2/ListLogsRequestOrBuilder.java | 70 + .../google/logging/v2/ListLogsResponse.java | 819 ++++ .../logging/v2/ListLogsResponseOrBuilder.java | 74 + ...stMonitoredResourceDescriptorsRequest.java | 655 +++ ...edResourceDescriptorsRequestOrBuilder.java | 44 + ...tMonitoredResourceDescriptorsResponse.java | 1006 +++++ ...dResourceDescriptorsResponseOrBuilder.java | 75 + .../google/logging/v2/ListSinksRequest.java | 838 ++++ .../logging/v2/ListSinksRequestOrBuilder.java | 70 + .../google/logging/v2/ListSinksResponse.java | 1006 +++++ .../v2/ListSinksResponseOrBuilder.java | 75 + .../java/com/google/logging/v2/LogEntry.java | 3990 +++++++++++++++++ .../google/logging/v2/LogEntryOperation.java | 880 ++++ .../v2/LogEntryOperationOrBuilder.java | 69 + .../google/logging/v2/LogEntryOrBuilder.java | 485 ++ .../com/google/logging/v2/LogEntryProto.java | 133 + .../logging/v2/LogEntrySourceLocation.java | 830 ++++ .../v2/LogEntrySourceLocationOrBuilder.java | 67 + .../com/google/logging/v2/LogExclusion.java | 1022 +++++ .../logging/v2/LogExclusionOrBuilder.java | 93 + .../java/com/google/logging/v2/LogMetric.java | 2603 +++++++++++ .../google/logging/v2/LogMetricOrBuilder.java | 377 ++ .../java/com/google/logging/v2/LogName.java | 23 + .../java/com/google/logging/v2/LogNames.java | 39 + .../java/com/google/logging/v2/LogSink.java | 2046 +++++++++ .../google/logging/v2/LogSinkOrBuilder.java | 224 + .../google/logging/v2/LoggingConfigProto.java | 287 ++ .../logging/v2/LoggingMetricsProto.java | 195 + .../com/google/logging/v2/LoggingProto.java | 251 ++ .../com/google/logging/v2/MetricName.java | 23 + .../com/google/logging/v2/MetricNames.java | 30 + .../logging/v2/OrganizationExclusionName.java | 198 + .../logging/v2/OrganizationLogName.java | 198 + .../google/logging/v2/OrganizationName.java | 175 + .../logging/v2/OrganizationSinkName.java | 198 + .../com/google/logging/v2/ParentName.java | 23 + .../com/google/logging/v2/ParentNames.java | 39 + .../logging/v2/ProjectExclusionName.java | 198 + .../com/google/logging/v2/ProjectLogName.java | 198 + .../google/logging/v2/ProjectMetricName.java | 198 + .../com/google/logging/v2/ProjectName.java | 175 + .../google/logging/v2/ProjectSinkName.java | 198 + .../java/com/google/logging/v2/SinkName.java | 23 + .../java/com/google/logging/v2/SinkNames.java | 39 + .../logging/v2/UntypedExclusionName.java | 112 + .../com/google/logging/v2/UntypedLogName.java | 112 + .../google/logging/v2/UntypedMetricName.java | 112 + .../google/logging/v2/UntypedParentName.java | 112 + .../google/logging/v2/UntypedSinkName.java | 112 + .../logging/v2/UpdateExclusionRequest.java | 1117 +++++ .../v2/UpdateExclusionRequestOrBuilder.java | 105 + .../logging/v2/UpdateLogMetricRequest.java | 809 ++++ .../v2/UpdateLogMetricRequestOrBuilder.java | 60 + .../google/logging/v2/UpdateSinkRequest.java | 1299 ++++++ .../v2/UpdateSinkRequestOrBuilder.java | 141 + .../v2/WriteLogEntriesPartialErrors.java | 759 ++++ ...WriteLogEntriesPartialErrorsOrBuilder.java | 83 + .../logging/v2/WriteLogEntriesRequest.java | 2182 +++++++++ .../v2/WriteLogEntriesRequestOrBuilder.java | 298 ++ .../logging/v2/WriteLogEntriesResponse.java | 398 ++ .../v2/WriteLogEntriesResponseOrBuilder.java | 9 + .../proto/google/logging/v2/log_entry.proto | 176 + .../proto/google/logging/v2/logging.proto | 302 ++ .../google/logging/v2/logging_config.proto | 456 ++ .../google/logging/v2/logging_metrics.proto | 251 ++ 113 files changed, 48453 insertions(+) create mode 100644 grpc-google-cloud-logging-v2/pom.xml create mode 100644 grpc-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ConfigServiceV2Grpc.java create mode 100644 grpc-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingServiceV2Grpc.java create mode 100644 grpc-google-cloud-logging-v2/src/main/java/com/google/logging/v2/MetricsServiceV2Grpc.java create mode 100644 proto-google-cloud-logging-v2/pom.xml create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BillingExclusionName.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BillingLogName.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BillingName.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BillingSinkName.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateExclusionRequest.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateExclusionRequestOrBuilder.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateLogMetricRequest.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateLogMetricRequestOrBuilder.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateSinkRequest.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateSinkRequestOrBuilder.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteExclusionRequest.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteExclusionRequestOrBuilder.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteLogMetricRequest.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteLogMetricRequestOrBuilder.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteLogRequest.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteLogRequestOrBuilder.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteSinkRequest.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteSinkRequestOrBuilder.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ExclusionName.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ExclusionNames.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/FolderExclusionName.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/FolderLogName.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/FolderName.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/FolderSinkName.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetExclusionRequest.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetExclusionRequestOrBuilder.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetLogMetricRequest.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetLogMetricRequestOrBuilder.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetSinkRequest.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetSinkRequestOrBuilder.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListExclusionsRequest.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListExclusionsRequestOrBuilder.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListExclusionsResponse.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListExclusionsResponseOrBuilder.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogEntriesRequest.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogEntriesRequestOrBuilder.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogEntriesResponse.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogEntriesResponseOrBuilder.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogMetricsRequest.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogMetricsRequestOrBuilder.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogMetricsResponse.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogMetricsResponseOrBuilder.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogsRequest.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogsRequestOrBuilder.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogsResponse.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogsResponseOrBuilder.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsRequest.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsRequestOrBuilder.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsResponse.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsResponseOrBuilder.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListSinksRequest.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListSinksRequestOrBuilder.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListSinksResponse.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListSinksResponseOrBuilder.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntry.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryOperation.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryOperationOrBuilder.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryOrBuilder.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryProto.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntrySourceLocation.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntrySourceLocationOrBuilder.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogExclusion.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogExclusionOrBuilder.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogMetric.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogMetricOrBuilder.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogName.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogNames.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogSink.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogSinkOrBuilder.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingConfigProto.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingMetricsProto.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingProto.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/MetricName.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/MetricNames.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/OrganizationExclusionName.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/OrganizationLogName.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/OrganizationName.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/OrganizationSinkName.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ParentName.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ParentNames.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ProjectExclusionName.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ProjectLogName.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ProjectMetricName.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ProjectName.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ProjectSinkName.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/SinkName.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/SinkNames.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UntypedExclusionName.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UntypedLogName.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UntypedMetricName.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UntypedParentName.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UntypedSinkName.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateExclusionRequest.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateExclusionRequestOrBuilder.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateLogMetricRequest.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateLogMetricRequestOrBuilder.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateSinkRequest.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateSinkRequestOrBuilder.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesPartialErrors.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesPartialErrorsOrBuilder.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesRequest.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesRequestOrBuilder.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesResponse.java create mode 100644 proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesResponseOrBuilder.java create mode 100644 proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/log_entry.proto create mode 100644 proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/logging.proto create mode 100644 proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/logging_config.proto create mode 100644 proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/logging_metrics.proto diff --git a/grpc-google-cloud-logging-v2/pom.xml b/grpc-google-cloud-logging-v2/pom.xml new file mode 100644 index 000000000000..e32bf29feb65 --- /dev/null +++ b/grpc-google-cloud-logging-v2/pom.xml @@ -0,0 +1,31 @@ + + 4.0.0 + grpc-google-cloud-logging-v2 + 0.11.1-SNAPSHOT + grpc-google-cloud-logging-v2 + GRPC library for grpc-google-cloud-logging-v2 + + com.google.api.grpc + google-api-grpc-pom + 0.11.1-SNAPSHOT + + + + io.grpc + grpc-stub + compile + + + io.grpc + grpc-protobuf + compile + + + com.google.api.grpc + proto-google-cloud-logging-v2 + compile + + + \ No newline at end of file diff --git a/grpc-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ConfigServiceV2Grpc.java b/grpc-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ConfigServiceV2Grpc.java new file mode 100644 index 000000000000..b51c56ef5522 --- /dev/null +++ b/grpc-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ConfigServiceV2Grpc.java @@ -0,0 +1,1182 @@ +package com.google.logging.v2; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; +import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; +import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + *

+ * Service for configuring sinks used to export log entries outside of
+ * Stackdriver Logging.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.10.0)", + comments = "Source: google/logging/v2/logging_config.proto") +public final class ConfigServiceV2Grpc { + + private ConfigServiceV2Grpc() {} + + public static final String SERVICE_NAME = "google.logging.v2.ConfigServiceV2"; + + // Static method descriptors that strictly reflect the proto. + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListSinksMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_LIST_SINKS = getListSinksMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getListSinksMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getListSinksMethod() { + return getListSinksMethodHelper(); + } + + private static io.grpc.MethodDescriptor getListSinksMethodHelper() { + io.grpc.MethodDescriptor getListSinksMethod; + if ((getListSinksMethod = ConfigServiceV2Grpc.getListSinksMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getListSinksMethod = ConfigServiceV2Grpc.getListSinksMethod) == null) { + ConfigServiceV2Grpc.getListSinksMethod = getListSinksMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.logging.v2.ConfigServiceV2", "ListSinks")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.ListSinksRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.ListSinksResponse.getDefaultInstance())) + .setSchemaDescriptor(new ConfigServiceV2MethodDescriptorSupplier("ListSinks")) + .build(); + } + } + } + return getListSinksMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetSinkMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_GET_SINK = getGetSinkMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getGetSinkMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getGetSinkMethod() { + return getGetSinkMethodHelper(); + } + + private static io.grpc.MethodDescriptor getGetSinkMethodHelper() { + io.grpc.MethodDescriptor getGetSinkMethod; + if ((getGetSinkMethod = ConfigServiceV2Grpc.getGetSinkMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getGetSinkMethod = ConfigServiceV2Grpc.getGetSinkMethod) == null) { + ConfigServiceV2Grpc.getGetSinkMethod = getGetSinkMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.logging.v2.ConfigServiceV2", "GetSink")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.GetSinkRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.LogSink.getDefaultInstance())) + .setSchemaDescriptor(new ConfigServiceV2MethodDescriptorSupplier("GetSink")) + .build(); + } + } + } + return getGetSinkMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getCreateSinkMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_CREATE_SINK = getCreateSinkMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getCreateSinkMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getCreateSinkMethod() { + return getCreateSinkMethodHelper(); + } + + private static io.grpc.MethodDescriptor getCreateSinkMethodHelper() { + io.grpc.MethodDescriptor getCreateSinkMethod; + if ((getCreateSinkMethod = ConfigServiceV2Grpc.getCreateSinkMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getCreateSinkMethod = ConfigServiceV2Grpc.getCreateSinkMethod) == null) { + ConfigServiceV2Grpc.getCreateSinkMethod = getCreateSinkMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.logging.v2.ConfigServiceV2", "CreateSink")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.CreateSinkRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.LogSink.getDefaultInstance())) + .setSchemaDescriptor(new ConfigServiceV2MethodDescriptorSupplier("CreateSink")) + .build(); + } + } + } + return getCreateSinkMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getUpdateSinkMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_UPDATE_SINK = getUpdateSinkMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getUpdateSinkMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getUpdateSinkMethod() { + return getUpdateSinkMethodHelper(); + } + + private static io.grpc.MethodDescriptor getUpdateSinkMethodHelper() { + io.grpc.MethodDescriptor getUpdateSinkMethod; + if ((getUpdateSinkMethod = ConfigServiceV2Grpc.getUpdateSinkMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getUpdateSinkMethod = ConfigServiceV2Grpc.getUpdateSinkMethod) == null) { + ConfigServiceV2Grpc.getUpdateSinkMethod = getUpdateSinkMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.logging.v2.ConfigServiceV2", "UpdateSink")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.UpdateSinkRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.LogSink.getDefaultInstance())) + .setSchemaDescriptor(new ConfigServiceV2MethodDescriptorSupplier("UpdateSink")) + .build(); + } + } + } + return getUpdateSinkMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getDeleteSinkMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_DELETE_SINK = getDeleteSinkMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getDeleteSinkMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getDeleteSinkMethod() { + return getDeleteSinkMethodHelper(); + } + + private static io.grpc.MethodDescriptor getDeleteSinkMethodHelper() { + io.grpc.MethodDescriptor getDeleteSinkMethod; + if ((getDeleteSinkMethod = ConfigServiceV2Grpc.getDeleteSinkMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getDeleteSinkMethod = ConfigServiceV2Grpc.getDeleteSinkMethod) == null) { + ConfigServiceV2Grpc.getDeleteSinkMethod = getDeleteSinkMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.logging.v2.ConfigServiceV2", "DeleteSink")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.DeleteSinkRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new ConfigServiceV2MethodDescriptorSupplier("DeleteSink")) + .build(); + } + } + } + return getDeleteSinkMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListExclusionsMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_LIST_EXCLUSIONS = getListExclusionsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getListExclusionsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getListExclusionsMethod() { + return getListExclusionsMethodHelper(); + } + + private static io.grpc.MethodDescriptor getListExclusionsMethodHelper() { + io.grpc.MethodDescriptor getListExclusionsMethod; + if ((getListExclusionsMethod = ConfigServiceV2Grpc.getListExclusionsMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getListExclusionsMethod = ConfigServiceV2Grpc.getListExclusionsMethod) == null) { + ConfigServiceV2Grpc.getListExclusionsMethod = getListExclusionsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.logging.v2.ConfigServiceV2", "ListExclusions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.ListExclusionsRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.ListExclusionsResponse.getDefaultInstance())) + .setSchemaDescriptor(new ConfigServiceV2MethodDescriptorSupplier("ListExclusions")) + .build(); + } + } + } + return getListExclusionsMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetExclusionMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_GET_EXCLUSION = getGetExclusionMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getGetExclusionMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getGetExclusionMethod() { + return getGetExclusionMethodHelper(); + } + + private static io.grpc.MethodDescriptor getGetExclusionMethodHelper() { + io.grpc.MethodDescriptor getGetExclusionMethod; + if ((getGetExclusionMethod = ConfigServiceV2Grpc.getGetExclusionMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getGetExclusionMethod = ConfigServiceV2Grpc.getGetExclusionMethod) == null) { + ConfigServiceV2Grpc.getGetExclusionMethod = getGetExclusionMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.logging.v2.ConfigServiceV2", "GetExclusion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.GetExclusionRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.LogExclusion.getDefaultInstance())) + .setSchemaDescriptor(new ConfigServiceV2MethodDescriptorSupplier("GetExclusion")) + .build(); + } + } + } + return getGetExclusionMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getCreateExclusionMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_CREATE_EXCLUSION = getCreateExclusionMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getCreateExclusionMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getCreateExclusionMethod() { + return getCreateExclusionMethodHelper(); + } + + private static io.grpc.MethodDescriptor getCreateExclusionMethodHelper() { + io.grpc.MethodDescriptor getCreateExclusionMethod; + if ((getCreateExclusionMethod = ConfigServiceV2Grpc.getCreateExclusionMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getCreateExclusionMethod = ConfigServiceV2Grpc.getCreateExclusionMethod) == null) { + ConfigServiceV2Grpc.getCreateExclusionMethod = getCreateExclusionMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.logging.v2.ConfigServiceV2", "CreateExclusion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.CreateExclusionRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.LogExclusion.getDefaultInstance())) + .setSchemaDescriptor(new ConfigServiceV2MethodDescriptorSupplier("CreateExclusion")) + .build(); + } + } + } + return getCreateExclusionMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getUpdateExclusionMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_UPDATE_EXCLUSION = getUpdateExclusionMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getUpdateExclusionMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getUpdateExclusionMethod() { + return getUpdateExclusionMethodHelper(); + } + + private static io.grpc.MethodDescriptor getUpdateExclusionMethodHelper() { + io.grpc.MethodDescriptor getUpdateExclusionMethod; + if ((getUpdateExclusionMethod = ConfigServiceV2Grpc.getUpdateExclusionMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getUpdateExclusionMethod = ConfigServiceV2Grpc.getUpdateExclusionMethod) == null) { + ConfigServiceV2Grpc.getUpdateExclusionMethod = getUpdateExclusionMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.logging.v2.ConfigServiceV2", "UpdateExclusion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.UpdateExclusionRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.LogExclusion.getDefaultInstance())) + .setSchemaDescriptor(new ConfigServiceV2MethodDescriptorSupplier("UpdateExclusion")) + .build(); + } + } + } + return getUpdateExclusionMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getDeleteExclusionMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_DELETE_EXCLUSION = getDeleteExclusionMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getDeleteExclusionMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getDeleteExclusionMethod() { + return getDeleteExclusionMethodHelper(); + } + + private static io.grpc.MethodDescriptor getDeleteExclusionMethodHelper() { + io.grpc.MethodDescriptor getDeleteExclusionMethod; + if ((getDeleteExclusionMethod = ConfigServiceV2Grpc.getDeleteExclusionMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getDeleteExclusionMethod = ConfigServiceV2Grpc.getDeleteExclusionMethod) == null) { + ConfigServiceV2Grpc.getDeleteExclusionMethod = getDeleteExclusionMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.logging.v2.ConfigServiceV2", "DeleteExclusion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.DeleteExclusionRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new ConfigServiceV2MethodDescriptorSupplier("DeleteExclusion")) + .build(); + } + } + } + return getDeleteExclusionMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static ConfigServiceV2Stub newStub(io.grpc.Channel channel) { + return new ConfigServiceV2Stub(channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static ConfigServiceV2BlockingStub newBlockingStub( + io.grpc.Channel channel) { + return new ConfigServiceV2BlockingStub(channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static ConfigServiceV2FutureStub newFutureStub( + io.grpc.Channel channel) { + return new ConfigServiceV2FutureStub(channel); + } + + /** + *
+   * Service for configuring sinks used to export log entries outside of
+   * Stackdriver Logging.
+   * 
+ */ + public static abstract class ConfigServiceV2ImplBase implements io.grpc.BindableService { + + /** + *
+     * Lists sinks.
+     * 
+ */ + public void listSinks(com.google.logging.v2.ListSinksRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getListSinksMethodHelper(), responseObserver); + } + + /** + *
+     * Gets a sink.
+     * 
+ */ + public void getSink(com.google.logging.v2.GetSinkRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetSinkMethodHelper(), responseObserver); + } + + /** + *
+     * Creates a sink that exports specified log entries to a destination.  The
+     * export of newly-ingested log entries begins immediately, unless the sink's
+     * `writer_identity` is not permitted to write to the destination.  A sink can
+     * export log entries only from the resource owning the sink.
+     * 
+ */ + public void createSink(com.google.logging.v2.CreateSinkRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCreateSinkMethodHelper(), responseObserver); + } + + /** + *
+     * Updates a sink.  This method replaces the following fields in the existing
+     * sink with values from the new sink: `destination`, and `filter`.
+     * The updated sink might also have a new `writer_identity`; see the
+     * `unique_writer_identity` field.
+     * 
+ */ + public void updateSink(com.google.logging.v2.UpdateSinkRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getUpdateSinkMethodHelper(), responseObserver); + } + + /** + *
+     * Deletes a sink. If the sink has a unique `writer_identity`, then that
+     * service account is also deleted.
+     * 
+ */ + public void deleteSink(com.google.logging.v2.DeleteSinkRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteSinkMethodHelper(), responseObserver); + } + + /** + *
+     * Lists all the exclusions in a parent resource.
+     * 
+ */ + public void listExclusions(com.google.logging.v2.ListExclusionsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getListExclusionsMethodHelper(), responseObserver); + } + + /** + *
+     * Gets the description of an exclusion.
+     * 
+ */ + public void getExclusion(com.google.logging.v2.GetExclusionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetExclusionMethodHelper(), responseObserver); + } + + /** + *
+     * Creates a new exclusion in a specified parent resource.
+     * Only log entries belonging to that resource can be excluded.
+     * You can have up to 10 exclusions in a resource.
+     * 
+ */ + public void createExclusion(com.google.logging.v2.CreateExclusionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCreateExclusionMethodHelper(), responseObserver); + } + + /** + *
+     * Changes one or more properties of an existing exclusion.
+     * 
+ */ + public void updateExclusion(com.google.logging.v2.UpdateExclusionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getUpdateExclusionMethodHelper(), responseObserver); + } + + /** + *
+     * Deletes an exclusion.
+     * 
+ */ + public void deleteExclusion(com.google.logging.v2.DeleteExclusionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteExclusionMethodHelper(), responseObserver); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListSinksMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.ListSinksRequest, + com.google.logging.v2.ListSinksResponse>( + this, METHODID_LIST_SINKS))) + .addMethod( + getGetSinkMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.GetSinkRequest, + com.google.logging.v2.LogSink>( + this, METHODID_GET_SINK))) + .addMethod( + getCreateSinkMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.CreateSinkRequest, + com.google.logging.v2.LogSink>( + this, METHODID_CREATE_SINK))) + .addMethod( + getUpdateSinkMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.UpdateSinkRequest, + com.google.logging.v2.LogSink>( + this, METHODID_UPDATE_SINK))) + .addMethod( + getDeleteSinkMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.DeleteSinkRequest, + com.google.protobuf.Empty>( + this, METHODID_DELETE_SINK))) + .addMethod( + getListExclusionsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.ListExclusionsRequest, + com.google.logging.v2.ListExclusionsResponse>( + this, METHODID_LIST_EXCLUSIONS))) + .addMethod( + getGetExclusionMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.GetExclusionRequest, + com.google.logging.v2.LogExclusion>( + this, METHODID_GET_EXCLUSION))) + .addMethod( + getCreateExclusionMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.CreateExclusionRequest, + com.google.logging.v2.LogExclusion>( + this, METHODID_CREATE_EXCLUSION))) + .addMethod( + getUpdateExclusionMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.UpdateExclusionRequest, + com.google.logging.v2.LogExclusion>( + this, METHODID_UPDATE_EXCLUSION))) + .addMethod( + getDeleteExclusionMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.DeleteExclusionRequest, + com.google.protobuf.Empty>( + this, METHODID_DELETE_EXCLUSION))) + .build(); + } + } + + /** + *
+   * Service for configuring sinks used to export log entries outside of
+   * Stackdriver Logging.
+   * 
+ */ + public static final class ConfigServiceV2Stub extends io.grpc.stub.AbstractStub { + private ConfigServiceV2Stub(io.grpc.Channel channel) { + super(channel); + } + + private ConfigServiceV2Stub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ConfigServiceV2Stub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new ConfigServiceV2Stub(channel, callOptions); + } + + /** + *
+     * Lists sinks.
+     * 
+ */ + public void listSinks(com.google.logging.v2.ListSinksRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListSinksMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Gets a sink.
+     * 
+ */ + public void getSink(com.google.logging.v2.GetSinkRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetSinkMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Creates a sink that exports specified log entries to a destination.  The
+     * export of newly-ingested log entries begins immediately, unless the sink's
+     * `writer_identity` is not permitted to write to the destination.  A sink can
+     * export log entries only from the resource owning the sink.
+     * 
+ */ + public void createSink(com.google.logging.v2.CreateSinkRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateSinkMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Updates a sink.  This method replaces the following fields in the existing
+     * sink with values from the new sink: `destination`, and `filter`.
+     * The updated sink might also have a new `writer_identity`; see the
+     * `unique_writer_identity` field.
+     * 
+ */ + public void updateSink(com.google.logging.v2.UpdateSinkRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateSinkMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Deletes a sink. If the sink has a unique `writer_identity`, then that
+     * service account is also deleted.
+     * 
+ */ + public void deleteSink(com.google.logging.v2.DeleteSinkRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteSinkMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Lists all the exclusions in a parent resource.
+     * 
+ */ + public void listExclusions(com.google.logging.v2.ListExclusionsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListExclusionsMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Gets the description of an exclusion.
+     * 
+ */ + public void getExclusion(com.google.logging.v2.GetExclusionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetExclusionMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Creates a new exclusion in a specified parent resource.
+     * Only log entries belonging to that resource can be excluded.
+     * You can have up to 10 exclusions in a resource.
+     * 
+ */ + public void createExclusion(com.google.logging.v2.CreateExclusionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateExclusionMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Changes one or more properties of an existing exclusion.
+     * 
+ */ + public void updateExclusion(com.google.logging.v2.UpdateExclusionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateExclusionMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Deletes an exclusion.
+     * 
+ */ + public void deleteExclusion(com.google.logging.v2.DeleteExclusionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteExclusionMethodHelper(), getCallOptions()), request, responseObserver); + } + } + + /** + *
+   * Service for configuring sinks used to export log entries outside of
+   * Stackdriver Logging.
+   * 
+ */ + public static final class ConfigServiceV2BlockingStub extends io.grpc.stub.AbstractStub { + private ConfigServiceV2BlockingStub(io.grpc.Channel channel) { + super(channel); + } + + private ConfigServiceV2BlockingStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ConfigServiceV2BlockingStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new ConfigServiceV2BlockingStub(channel, callOptions); + } + + /** + *
+     * Lists sinks.
+     * 
+ */ + public com.google.logging.v2.ListSinksResponse listSinks(com.google.logging.v2.ListSinksRequest request) { + return blockingUnaryCall( + getChannel(), getListSinksMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Gets a sink.
+     * 
+ */ + public com.google.logging.v2.LogSink getSink(com.google.logging.v2.GetSinkRequest request) { + return blockingUnaryCall( + getChannel(), getGetSinkMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Creates a sink that exports specified log entries to a destination.  The
+     * export of newly-ingested log entries begins immediately, unless the sink's
+     * `writer_identity` is not permitted to write to the destination.  A sink can
+     * export log entries only from the resource owning the sink.
+     * 
+ */ + public com.google.logging.v2.LogSink createSink(com.google.logging.v2.CreateSinkRequest request) { + return blockingUnaryCall( + getChannel(), getCreateSinkMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Updates a sink.  This method replaces the following fields in the existing
+     * sink with values from the new sink: `destination`, and `filter`.
+     * The updated sink might also have a new `writer_identity`; see the
+     * `unique_writer_identity` field.
+     * 
+ */ + public com.google.logging.v2.LogSink updateSink(com.google.logging.v2.UpdateSinkRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateSinkMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Deletes a sink. If the sink has a unique `writer_identity`, then that
+     * service account is also deleted.
+     * 
+ */ + public com.google.protobuf.Empty deleteSink(com.google.logging.v2.DeleteSinkRequest request) { + return blockingUnaryCall( + getChannel(), getDeleteSinkMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Lists all the exclusions in a parent resource.
+     * 
+ */ + public com.google.logging.v2.ListExclusionsResponse listExclusions(com.google.logging.v2.ListExclusionsRequest request) { + return blockingUnaryCall( + getChannel(), getListExclusionsMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Gets the description of an exclusion.
+     * 
+ */ + public com.google.logging.v2.LogExclusion getExclusion(com.google.logging.v2.GetExclusionRequest request) { + return blockingUnaryCall( + getChannel(), getGetExclusionMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Creates a new exclusion in a specified parent resource.
+     * Only log entries belonging to that resource can be excluded.
+     * You can have up to 10 exclusions in a resource.
+     * 
+ */ + public com.google.logging.v2.LogExclusion createExclusion(com.google.logging.v2.CreateExclusionRequest request) { + return blockingUnaryCall( + getChannel(), getCreateExclusionMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Changes one or more properties of an existing exclusion.
+     * 
+ */ + public com.google.logging.v2.LogExclusion updateExclusion(com.google.logging.v2.UpdateExclusionRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateExclusionMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Deletes an exclusion.
+     * 
+ */ + public com.google.protobuf.Empty deleteExclusion(com.google.logging.v2.DeleteExclusionRequest request) { + return blockingUnaryCall( + getChannel(), getDeleteExclusionMethodHelper(), getCallOptions(), request); + } + } + + /** + *
+   * Service for configuring sinks used to export log entries outside of
+   * Stackdriver Logging.
+   * 
+ */ + public static final class ConfigServiceV2FutureStub extends io.grpc.stub.AbstractStub { + private ConfigServiceV2FutureStub(io.grpc.Channel channel) { + super(channel); + } + + private ConfigServiceV2FutureStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ConfigServiceV2FutureStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new ConfigServiceV2FutureStub(channel, callOptions); + } + + /** + *
+     * Lists sinks.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture listSinks( + com.google.logging.v2.ListSinksRequest request) { + return futureUnaryCall( + getChannel().newCall(getListSinksMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Gets a sink.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getSink( + com.google.logging.v2.GetSinkRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetSinkMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Creates a sink that exports specified log entries to a destination.  The
+     * export of newly-ingested log entries begins immediately, unless the sink's
+     * `writer_identity` is not permitted to write to the destination.  A sink can
+     * export log entries only from the resource owning the sink.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture createSink( + com.google.logging.v2.CreateSinkRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateSinkMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Updates a sink.  This method replaces the following fields in the existing
+     * sink with values from the new sink: `destination`, and `filter`.
+     * The updated sink might also have a new `writer_identity`; see the
+     * `unique_writer_identity` field.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture updateSink( + com.google.logging.v2.UpdateSinkRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateSinkMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Deletes a sink. If the sink has a unique `writer_identity`, then that
+     * service account is also deleted.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture deleteSink( + com.google.logging.v2.DeleteSinkRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteSinkMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Lists all the exclusions in a parent resource.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture listExclusions( + com.google.logging.v2.ListExclusionsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListExclusionsMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Gets the description of an exclusion.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getExclusion( + com.google.logging.v2.GetExclusionRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetExclusionMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Creates a new exclusion in a specified parent resource.
+     * Only log entries belonging to that resource can be excluded.
+     * You can have up to 10 exclusions in a resource.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture createExclusion( + com.google.logging.v2.CreateExclusionRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateExclusionMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Changes one or more properties of an existing exclusion.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture updateExclusion( + com.google.logging.v2.UpdateExclusionRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateExclusionMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Deletes an exclusion.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture deleteExclusion( + com.google.logging.v2.DeleteExclusionRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteExclusionMethodHelper(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_SINKS = 0; + private static final int METHODID_GET_SINK = 1; + private static final int METHODID_CREATE_SINK = 2; + private static final int METHODID_UPDATE_SINK = 3; + private static final int METHODID_DELETE_SINK = 4; + private static final int METHODID_LIST_EXCLUSIONS = 5; + private static final int METHODID_GET_EXCLUSION = 6; + private static final int METHODID_CREATE_EXCLUSION = 7; + private static final int METHODID_UPDATE_EXCLUSION = 8; + private static final int METHODID_DELETE_EXCLUSION = 9; + + private static final class MethodHandlers implements + io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final ConfigServiceV2ImplBase serviceImpl; + private final int methodId; + + MethodHandlers(ConfigServiceV2ImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_LIST_SINKS: + serviceImpl.listSinks((com.google.logging.v2.ListSinksRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_SINK: + serviceImpl.getSink((com.google.logging.v2.GetSinkRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_SINK: + serviceImpl.createSink((com.google.logging.v2.CreateSinkRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_SINK: + serviceImpl.updateSink((com.google.logging.v2.UpdateSinkRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_SINK: + serviceImpl.deleteSink((com.google.logging.v2.DeleteSinkRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_EXCLUSIONS: + serviceImpl.listExclusions((com.google.logging.v2.ListExclusionsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_EXCLUSION: + serviceImpl.getExclusion((com.google.logging.v2.GetExclusionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_EXCLUSION: + serviceImpl.createExclusion((com.google.logging.v2.CreateExclusionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_EXCLUSION: + serviceImpl.updateExclusion((com.google.logging.v2.UpdateExclusionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_EXCLUSION: + serviceImpl.deleteExclusion((com.google.logging.v2.DeleteExclusionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private static abstract class ConfigServiceV2BaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + ConfigServiceV2BaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.logging.v2.LoggingConfigProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("ConfigServiceV2"); + } + } + + private static final class ConfigServiceV2FileDescriptorSupplier + extends ConfigServiceV2BaseDescriptorSupplier { + ConfigServiceV2FileDescriptorSupplier() {} + } + + private static final class ConfigServiceV2MethodDescriptorSupplier + extends ConfigServiceV2BaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + ConfigServiceV2MethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (ConfigServiceV2Grpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new ConfigServiceV2FileDescriptorSupplier()) + .addMethod(getListSinksMethodHelper()) + .addMethod(getGetSinkMethodHelper()) + .addMethod(getCreateSinkMethodHelper()) + .addMethod(getUpdateSinkMethodHelper()) + .addMethod(getDeleteSinkMethodHelper()) + .addMethod(getListExclusionsMethodHelper()) + .addMethod(getGetExclusionMethodHelper()) + .addMethod(getCreateExclusionMethodHelper()) + .addMethod(getUpdateExclusionMethodHelper()) + .addMethod(getDeleteExclusionMethodHelper()) + .build(); + } + } + } + return result; + } +} diff --git a/grpc-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingServiceV2Grpc.java b/grpc-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingServiceV2Grpc.java new file mode 100644 index 000000000000..9972029726d2 --- /dev/null +++ b/grpc-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingServiceV2Grpc.java @@ -0,0 +1,729 @@ +package com.google.logging.v2; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; +import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; +import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + *
+ * Service for ingesting and querying logs.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.10.0)", + comments = "Source: google/logging/v2/logging.proto") +public final class LoggingServiceV2Grpc { + + private LoggingServiceV2Grpc() {} + + public static final String SERVICE_NAME = "google.logging.v2.LoggingServiceV2"; + + // Static method descriptors that strictly reflect the proto. + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getDeleteLogMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_DELETE_LOG = getDeleteLogMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getDeleteLogMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getDeleteLogMethod() { + return getDeleteLogMethodHelper(); + } + + private static io.grpc.MethodDescriptor getDeleteLogMethodHelper() { + io.grpc.MethodDescriptor getDeleteLogMethod; + if ((getDeleteLogMethod = LoggingServiceV2Grpc.getDeleteLogMethod) == null) { + synchronized (LoggingServiceV2Grpc.class) { + if ((getDeleteLogMethod = LoggingServiceV2Grpc.getDeleteLogMethod) == null) { + LoggingServiceV2Grpc.getDeleteLogMethod = getDeleteLogMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.logging.v2.LoggingServiceV2", "DeleteLog")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.DeleteLogRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new LoggingServiceV2MethodDescriptorSupplier("DeleteLog")) + .build(); + } + } + } + return getDeleteLogMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getWriteLogEntriesMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_WRITE_LOG_ENTRIES = getWriteLogEntriesMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getWriteLogEntriesMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getWriteLogEntriesMethod() { + return getWriteLogEntriesMethodHelper(); + } + + private static io.grpc.MethodDescriptor getWriteLogEntriesMethodHelper() { + io.grpc.MethodDescriptor getWriteLogEntriesMethod; + if ((getWriteLogEntriesMethod = LoggingServiceV2Grpc.getWriteLogEntriesMethod) == null) { + synchronized (LoggingServiceV2Grpc.class) { + if ((getWriteLogEntriesMethod = LoggingServiceV2Grpc.getWriteLogEntriesMethod) == null) { + LoggingServiceV2Grpc.getWriteLogEntriesMethod = getWriteLogEntriesMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.logging.v2.LoggingServiceV2", "WriteLogEntries")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.WriteLogEntriesRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.WriteLogEntriesResponse.getDefaultInstance())) + .setSchemaDescriptor(new LoggingServiceV2MethodDescriptorSupplier("WriteLogEntries")) + .build(); + } + } + } + return getWriteLogEntriesMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListLogEntriesMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_LIST_LOG_ENTRIES = getListLogEntriesMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getListLogEntriesMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getListLogEntriesMethod() { + return getListLogEntriesMethodHelper(); + } + + private static io.grpc.MethodDescriptor getListLogEntriesMethodHelper() { + io.grpc.MethodDescriptor getListLogEntriesMethod; + if ((getListLogEntriesMethod = LoggingServiceV2Grpc.getListLogEntriesMethod) == null) { + synchronized (LoggingServiceV2Grpc.class) { + if ((getListLogEntriesMethod = LoggingServiceV2Grpc.getListLogEntriesMethod) == null) { + LoggingServiceV2Grpc.getListLogEntriesMethod = getListLogEntriesMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.logging.v2.LoggingServiceV2", "ListLogEntries")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.ListLogEntriesRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.ListLogEntriesResponse.getDefaultInstance())) + .setSchemaDescriptor(new LoggingServiceV2MethodDescriptorSupplier("ListLogEntries")) + .build(); + } + } + } + return getListLogEntriesMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListMonitoredResourceDescriptorsMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_LIST_MONITORED_RESOURCE_DESCRIPTORS = getListMonitoredResourceDescriptorsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getListMonitoredResourceDescriptorsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getListMonitoredResourceDescriptorsMethod() { + return getListMonitoredResourceDescriptorsMethodHelper(); + } + + private static io.grpc.MethodDescriptor getListMonitoredResourceDescriptorsMethodHelper() { + io.grpc.MethodDescriptor getListMonitoredResourceDescriptorsMethod; + if ((getListMonitoredResourceDescriptorsMethod = LoggingServiceV2Grpc.getListMonitoredResourceDescriptorsMethod) == null) { + synchronized (LoggingServiceV2Grpc.class) { + if ((getListMonitoredResourceDescriptorsMethod = LoggingServiceV2Grpc.getListMonitoredResourceDescriptorsMethod) == null) { + LoggingServiceV2Grpc.getListMonitoredResourceDescriptorsMethod = getListMonitoredResourceDescriptorsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.logging.v2.LoggingServiceV2", "ListMonitoredResourceDescriptors")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.ListMonitoredResourceDescriptorsRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.ListMonitoredResourceDescriptorsResponse.getDefaultInstance())) + .setSchemaDescriptor(new LoggingServiceV2MethodDescriptorSupplier("ListMonitoredResourceDescriptors")) + .build(); + } + } + } + return getListMonitoredResourceDescriptorsMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListLogsMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_LIST_LOGS = getListLogsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getListLogsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getListLogsMethod() { + return getListLogsMethodHelper(); + } + + private static io.grpc.MethodDescriptor getListLogsMethodHelper() { + io.grpc.MethodDescriptor getListLogsMethod; + if ((getListLogsMethod = LoggingServiceV2Grpc.getListLogsMethod) == null) { + synchronized (LoggingServiceV2Grpc.class) { + if ((getListLogsMethod = LoggingServiceV2Grpc.getListLogsMethod) == null) { + LoggingServiceV2Grpc.getListLogsMethod = getListLogsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.logging.v2.LoggingServiceV2", "ListLogs")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.ListLogsRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.ListLogsResponse.getDefaultInstance())) + .setSchemaDescriptor(new LoggingServiceV2MethodDescriptorSupplier("ListLogs")) + .build(); + } + } + } + return getListLogsMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static LoggingServiceV2Stub newStub(io.grpc.Channel channel) { + return new LoggingServiceV2Stub(channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static LoggingServiceV2BlockingStub newBlockingStub( + io.grpc.Channel channel) { + return new LoggingServiceV2BlockingStub(channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static LoggingServiceV2FutureStub newFutureStub( + io.grpc.Channel channel) { + return new LoggingServiceV2FutureStub(channel); + } + + /** + *
+   * Service for ingesting and querying logs.
+   * 
+ */ + public static abstract class LoggingServiceV2ImplBase implements io.grpc.BindableService { + + /** + *
+     * Deletes all the log entries in a log.
+     * The log reappears if it receives new entries.
+     * Log entries written shortly before the delete operation might not be
+     * deleted.
+     * 
+ */ + public void deleteLog(com.google.logging.v2.DeleteLogRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteLogMethodHelper(), responseObserver); + } + + /** + *
+     * ## Log entry resources
+     * Writes log entries to Stackdriver Logging. This API method is the
+     * only way to send log entries to Stackdriver Logging. This method
+     * is used, directly or indirectly, by the Stackdriver Logging agent
+     * (fluentd) and all logging libraries configured to use Stackdriver
+     * Logging.
+     * 
+ */ + public void writeLogEntries(com.google.logging.v2.WriteLogEntriesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getWriteLogEntriesMethodHelper(), responseObserver); + } + + /** + *
+     * Lists log entries.  Use this method to retrieve log entries from
+     * Stackdriver Logging.  For ways to export log entries, see
+     * [Exporting Logs](/logging/docs/export).
+     * 
+ */ + public void listLogEntries(com.google.logging.v2.ListLogEntriesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getListLogEntriesMethodHelper(), responseObserver); + } + + /** + *
+     * Lists the descriptors for monitored resource types used by Stackdriver
+     * Logging.
+     * 
+ */ + public void listMonitoredResourceDescriptors(com.google.logging.v2.ListMonitoredResourceDescriptorsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getListMonitoredResourceDescriptorsMethodHelper(), responseObserver); + } + + /** + *
+     * Lists the logs in projects, organizations, folders, or billing accounts.
+     * Only logs that have entries are listed.
+     * 
+ */ + public void listLogs(com.google.logging.v2.ListLogsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getListLogsMethodHelper(), responseObserver); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getDeleteLogMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.DeleteLogRequest, + com.google.protobuf.Empty>( + this, METHODID_DELETE_LOG))) + .addMethod( + getWriteLogEntriesMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.WriteLogEntriesRequest, + com.google.logging.v2.WriteLogEntriesResponse>( + this, METHODID_WRITE_LOG_ENTRIES))) + .addMethod( + getListLogEntriesMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.ListLogEntriesRequest, + com.google.logging.v2.ListLogEntriesResponse>( + this, METHODID_LIST_LOG_ENTRIES))) + .addMethod( + getListMonitoredResourceDescriptorsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.ListMonitoredResourceDescriptorsRequest, + com.google.logging.v2.ListMonitoredResourceDescriptorsResponse>( + this, METHODID_LIST_MONITORED_RESOURCE_DESCRIPTORS))) + .addMethod( + getListLogsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.ListLogsRequest, + com.google.logging.v2.ListLogsResponse>( + this, METHODID_LIST_LOGS))) + .build(); + } + } + + /** + *
+   * Service for ingesting and querying logs.
+   * 
+ */ + public static final class LoggingServiceV2Stub extends io.grpc.stub.AbstractStub { + private LoggingServiceV2Stub(io.grpc.Channel channel) { + super(channel); + } + + private LoggingServiceV2Stub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected LoggingServiceV2Stub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new LoggingServiceV2Stub(channel, callOptions); + } + + /** + *
+     * Deletes all the log entries in a log.
+     * The log reappears if it receives new entries.
+     * Log entries written shortly before the delete operation might not be
+     * deleted.
+     * 
+ */ + public void deleteLog(com.google.logging.v2.DeleteLogRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteLogMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * ## Log entry resources
+     * Writes log entries to Stackdriver Logging. This API method is the
+     * only way to send log entries to Stackdriver Logging. This method
+     * is used, directly or indirectly, by the Stackdriver Logging agent
+     * (fluentd) and all logging libraries configured to use Stackdriver
+     * Logging.
+     * 
+ */ + public void writeLogEntries(com.google.logging.v2.WriteLogEntriesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getWriteLogEntriesMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Lists log entries.  Use this method to retrieve log entries from
+     * Stackdriver Logging.  For ways to export log entries, see
+     * [Exporting Logs](/logging/docs/export).
+     * 
+ */ + public void listLogEntries(com.google.logging.v2.ListLogEntriesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListLogEntriesMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Lists the descriptors for monitored resource types used by Stackdriver
+     * Logging.
+     * 
+ */ + public void listMonitoredResourceDescriptors(com.google.logging.v2.ListMonitoredResourceDescriptorsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListMonitoredResourceDescriptorsMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Lists the logs in projects, organizations, folders, or billing accounts.
+     * Only logs that have entries are listed.
+     * 
+ */ + public void listLogs(com.google.logging.v2.ListLogsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListLogsMethodHelper(), getCallOptions()), request, responseObserver); + } + } + + /** + *
+   * Service for ingesting and querying logs.
+   * 
+ */ + public static final class LoggingServiceV2BlockingStub extends io.grpc.stub.AbstractStub { + private LoggingServiceV2BlockingStub(io.grpc.Channel channel) { + super(channel); + } + + private LoggingServiceV2BlockingStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected LoggingServiceV2BlockingStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new LoggingServiceV2BlockingStub(channel, callOptions); + } + + /** + *
+     * Deletes all the log entries in a log.
+     * The log reappears if it receives new entries.
+     * Log entries written shortly before the delete operation might not be
+     * deleted.
+     * 
+ */ + public com.google.protobuf.Empty deleteLog(com.google.logging.v2.DeleteLogRequest request) { + return blockingUnaryCall( + getChannel(), getDeleteLogMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * ## Log entry resources
+     * Writes log entries to Stackdriver Logging. This API method is the
+     * only way to send log entries to Stackdriver Logging. This method
+     * is used, directly or indirectly, by the Stackdriver Logging agent
+     * (fluentd) and all logging libraries configured to use Stackdriver
+     * Logging.
+     * 
+ */ + public com.google.logging.v2.WriteLogEntriesResponse writeLogEntries(com.google.logging.v2.WriteLogEntriesRequest request) { + return blockingUnaryCall( + getChannel(), getWriteLogEntriesMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Lists log entries.  Use this method to retrieve log entries from
+     * Stackdriver Logging.  For ways to export log entries, see
+     * [Exporting Logs](/logging/docs/export).
+     * 
+ */ + public com.google.logging.v2.ListLogEntriesResponse listLogEntries(com.google.logging.v2.ListLogEntriesRequest request) { + return blockingUnaryCall( + getChannel(), getListLogEntriesMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Lists the descriptors for monitored resource types used by Stackdriver
+     * Logging.
+     * 
+ */ + public com.google.logging.v2.ListMonitoredResourceDescriptorsResponse listMonitoredResourceDescriptors(com.google.logging.v2.ListMonitoredResourceDescriptorsRequest request) { + return blockingUnaryCall( + getChannel(), getListMonitoredResourceDescriptorsMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Lists the logs in projects, organizations, folders, or billing accounts.
+     * Only logs that have entries are listed.
+     * 
+ */ + public com.google.logging.v2.ListLogsResponse listLogs(com.google.logging.v2.ListLogsRequest request) { + return blockingUnaryCall( + getChannel(), getListLogsMethodHelper(), getCallOptions(), request); + } + } + + /** + *
+   * Service for ingesting and querying logs.
+   * 
+ */ + public static final class LoggingServiceV2FutureStub extends io.grpc.stub.AbstractStub { + private LoggingServiceV2FutureStub(io.grpc.Channel channel) { + super(channel); + } + + private LoggingServiceV2FutureStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected LoggingServiceV2FutureStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new LoggingServiceV2FutureStub(channel, callOptions); + } + + /** + *
+     * Deletes all the log entries in a log.
+     * The log reappears if it receives new entries.
+     * Log entries written shortly before the delete operation might not be
+     * deleted.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture deleteLog( + com.google.logging.v2.DeleteLogRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteLogMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * ## Log entry resources
+     * Writes log entries to Stackdriver Logging. This API method is the
+     * only way to send log entries to Stackdriver Logging. This method
+     * is used, directly or indirectly, by the Stackdriver Logging agent
+     * (fluentd) and all logging libraries configured to use Stackdriver
+     * Logging.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture writeLogEntries( + com.google.logging.v2.WriteLogEntriesRequest request) { + return futureUnaryCall( + getChannel().newCall(getWriteLogEntriesMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Lists log entries.  Use this method to retrieve log entries from
+     * Stackdriver Logging.  For ways to export log entries, see
+     * [Exporting Logs](/logging/docs/export).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture listLogEntries( + com.google.logging.v2.ListLogEntriesRequest request) { + return futureUnaryCall( + getChannel().newCall(getListLogEntriesMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Lists the descriptors for monitored resource types used by Stackdriver
+     * Logging.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture listMonitoredResourceDescriptors( + com.google.logging.v2.ListMonitoredResourceDescriptorsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListMonitoredResourceDescriptorsMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Lists the logs in projects, organizations, folders, or billing accounts.
+     * Only logs that have entries are listed.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture listLogs( + com.google.logging.v2.ListLogsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListLogsMethodHelper(), getCallOptions()), request); + } + } + + private static final int METHODID_DELETE_LOG = 0; + private static final int METHODID_WRITE_LOG_ENTRIES = 1; + private static final int METHODID_LIST_LOG_ENTRIES = 2; + private static final int METHODID_LIST_MONITORED_RESOURCE_DESCRIPTORS = 3; + private static final int METHODID_LIST_LOGS = 4; + + private static final class MethodHandlers implements + io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final LoggingServiceV2ImplBase serviceImpl; + private final int methodId; + + MethodHandlers(LoggingServiceV2ImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_DELETE_LOG: + serviceImpl.deleteLog((com.google.logging.v2.DeleteLogRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_WRITE_LOG_ENTRIES: + serviceImpl.writeLogEntries((com.google.logging.v2.WriteLogEntriesRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_LOG_ENTRIES: + serviceImpl.listLogEntries((com.google.logging.v2.ListLogEntriesRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_MONITORED_RESOURCE_DESCRIPTORS: + serviceImpl.listMonitoredResourceDescriptors((com.google.logging.v2.ListMonitoredResourceDescriptorsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_LOGS: + serviceImpl.listLogs((com.google.logging.v2.ListLogsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private static abstract class LoggingServiceV2BaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + LoggingServiceV2BaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.logging.v2.LoggingProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("LoggingServiceV2"); + } + } + + private static final class LoggingServiceV2FileDescriptorSupplier + extends LoggingServiceV2BaseDescriptorSupplier { + LoggingServiceV2FileDescriptorSupplier() {} + } + + private static final class LoggingServiceV2MethodDescriptorSupplier + extends LoggingServiceV2BaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + LoggingServiceV2MethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (LoggingServiceV2Grpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new LoggingServiceV2FileDescriptorSupplier()) + .addMethod(getDeleteLogMethodHelper()) + .addMethod(getWriteLogEntriesMethodHelper()) + .addMethod(getListLogEntriesMethodHelper()) + .addMethod(getListMonitoredResourceDescriptorsMethodHelper()) + .addMethod(getListLogsMethodHelper()) + .build(); + } + } + } + return result; + } +} diff --git a/grpc-google-cloud-logging-v2/src/main/java/com/google/logging/v2/MetricsServiceV2Grpc.java b/grpc-google-cloud-logging-v2/src/main/java/com/google/logging/v2/MetricsServiceV2Grpc.java new file mode 100644 index 000000000000..3ffa85f6643a --- /dev/null +++ b/grpc-google-cloud-logging-v2/src/main/java/com/google/logging/v2/MetricsServiceV2Grpc.java @@ -0,0 +1,681 @@ +package com.google.logging.v2; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; +import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; +import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + *
+ * Service for configuring logs-based metrics.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.10.0)", + comments = "Source: google/logging/v2/logging_metrics.proto") +public final class MetricsServiceV2Grpc { + + private MetricsServiceV2Grpc() {} + + public static final String SERVICE_NAME = "google.logging.v2.MetricsServiceV2"; + + // Static method descriptors that strictly reflect the proto. + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListLogMetricsMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_LIST_LOG_METRICS = getListLogMetricsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getListLogMetricsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getListLogMetricsMethod() { + return getListLogMetricsMethodHelper(); + } + + private static io.grpc.MethodDescriptor getListLogMetricsMethodHelper() { + io.grpc.MethodDescriptor getListLogMetricsMethod; + if ((getListLogMetricsMethod = MetricsServiceV2Grpc.getListLogMetricsMethod) == null) { + synchronized (MetricsServiceV2Grpc.class) { + if ((getListLogMetricsMethod = MetricsServiceV2Grpc.getListLogMetricsMethod) == null) { + MetricsServiceV2Grpc.getListLogMetricsMethod = getListLogMetricsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.logging.v2.MetricsServiceV2", "ListLogMetrics")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.ListLogMetricsRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.ListLogMetricsResponse.getDefaultInstance())) + .setSchemaDescriptor(new MetricsServiceV2MethodDescriptorSupplier("ListLogMetrics")) + .build(); + } + } + } + return getListLogMetricsMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetLogMetricMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_GET_LOG_METRIC = getGetLogMetricMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getGetLogMetricMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getGetLogMetricMethod() { + return getGetLogMetricMethodHelper(); + } + + private static io.grpc.MethodDescriptor getGetLogMetricMethodHelper() { + io.grpc.MethodDescriptor getGetLogMetricMethod; + if ((getGetLogMetricMethod = MetricsServiceV2Grpc.getGetLogMetricMethod) == null) { + synchronized (MetricsServiceV2Grpc.class) { + if ((getGetLogMetricMethod = MetricsServiceV2Grpc.getGetLogMetricMethod) == null) { + MetricsServiceV2Grpc.getGetLogMetricMethod = getGetLogMetricMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.logging.v2.MetricsServiceV2", "GetLogMetric")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.GetLogMetricRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.LogMetric.getDefaultInstance())) + .setSchemaDescriptor(new MetricsServiceV2MethodDescriptorSupplier("GetLogMetric")) + .build(); + } + } + } + return getGetLogMetricMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getCreateLogMetricMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_CREATE_LOG_METRIC = getCreateLogMetricMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getCreateLogMetricMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getCreateLogMetricMethod() { + return getCreateLogMetricMethodHelper(); + } + + private static io.grpc.MethodDescriptor getCreateLogMetricMethodHelper() { + io.grpc.MethodDescriptor getCreateLogMetricMethod; + if ((getCreateLogMetricMethod = MetricsServiceV2Grpc.getCreateLogMetricMethod) == null) { + synchronized (MetricsServiceV2Grpc.class) { + if ((getCreateLogMetricMethod = MetricsServiceV2Grpc.getCreateLogMetricMethod) == null) { + MetricsServiceV2Grpc.getCreateLogMetricMethod = getCreateLogMetricMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.logging.v2.MetricsServiceV2", "CreateLogMetric")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.CreateLogMetricRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.LogMetric.getDefaultInstance())) + .setSchemaDescriptor(new MetricsServiceV2MethodDescriptorSupplier("CreateLogMetric")) + .build(); + } + } + } + return getCreateLogMetricMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getUpdateLogMetricMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_UPDATE_LOG_METRIC = getUpdateLogMetricMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getUpdateLogMetricMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getUpdateLogMetricMethod() { + return getUpdateLogMetricMethodHelper(); + } + + private static io.grpc.MethodDescriptor getUpdateLogMetricMethodHelper() { + io.grpc.MethodDescriptor getUpdateLogMetricMethod; + if ((getUpdateLogMetricMethod = MetricsServiceV2Grpc.getUpdateLogMetricMethod) == null) { + synchronized (MetricsServiceV2Grpc.class) { + if ((getUpdateLogMetricMethod = MetricsServiceV2Grpc.getUpdateLogMetricMethod) == null) { + MetricsServiceV2Grpc.getUpdateLogMetricMethod = getUpdateLogMetricMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.logging.v2.MetricsServiceV2", "UpdateLogMetric")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.UpdateLogMetricRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.LogMetric.getDefaultInstance())) + .setSchemaDescriptor(new MetricsServiceV2MethodDescriptorSupplier("UpdateLogMetric")) + .build(); + } + } + } + return getUpdateLogMetricMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getDeleteLogMetricMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_DELETE_LOG_METRIC = getDeleteLogMetricMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getDeleteLogMetricMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getDeleteLogMetricMethod() { + return getDeleteLogMetricMethodHelper(); + } + + private static io.grpc.MethodDescriptor getDeleteLogMetricMethodHelper() { + io.grpc.MethodDescriptor getDeleteLogMetricMethod; + if ((getDeleteLogMetricMethod = MetricsServiceV2Grpc.getDeleteLogMetricMethod) == null) { + synchronized (MetricsServiceV2Grpc.class) { + if ((getDeleteLogMetricMethod = MetricsServiceV2Grpc.getDeleteLogMetricMethod) == null) { + MetricsServiceV2Grpc.getDeleteLogMetricMethod = getDeleteLogMetricMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.logging.v2.MetricsServiceV2", "DeleteLogMetric")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.DeleteLogMetricRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new MetricsServiceV2MethodDescriptorSupplier("DeleteLogMetric")) + .build(); + } + } + } + return getDeleteLogMetricMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static MetricsServiceV2Stub newStub(io.grpc.Channel channel) { + return new MetricsServiceV2Stub(channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static MetricsServiceV2BlockingStub newBlockingStub( + io.grpc.Channel channel) { + return new MetricsServiceV2BlockingStub(channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static MetricsServiceV2FutureStub newFutureStub( + io.grpc.Channel channel) { + return new MetricsServiceV2FutureStub(channel); + } + + /** + *
+   * Service for configuring logs-based metrics.
+   * 
+ */ + public static abstract class MetricsServiceV2ImplBase implements io.grpc.BindableService { + + /** + *
+     * Lists logs-based metrics.
+     * 
+ */ + public void listLogMetrics(com.google.logging.v2.ListLogMetricsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getListLogMetricsMethodHelper(), responseObserver); + } + + /** + *
+     * Gets a logs-based metric.
+     * 
+ */ + public void getLogMetric(com.google.logging.v2.GetLogMetricRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetLogMetricMethodHelper(), responseObserver); + } + + /** + *
+     * Creates a logs-based metric.
+     * 
+ */ + public void createLogMetric(com.google.logging.v2.CreateLogMetricRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCreateLogMetricMethodHelper(), responseObserver); + } + + /** + *
+     * Creates or updates a logs-based metric.
+     * 
+ */ + public void updateLogMetric(com.google.logging.v2.UpdateLogMetricRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getUpdateLogMetricMethodHelper(), responseObserver); + } + + /** + *
+     * Deletes a logs-based metric.
+     * 
+ */ + public void deleteLogMetric(com.google.logging.v2.DeleteLogMetricRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteLogMetricMethodHelper(), responseObserver); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListLogMetricsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.ListLogMetricsRequest, + com.google.logging.v2.ListLogMetricsResponse>( + this, METHODID_LIST_LOG_METRICS))) + .addMethod( + getGetLogMetricMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.GetLogMetricRequest, + com.google.logging.v2.LogMetric>( + this, METHODID_GET_LOG_METRIC))) + .addMethod( + getCreateLogMetricMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.CreateLogMetricRequest, + com.google.logging.v2.LogMetric>( + this, METHODID_CREATE_LOG_METRIC))) + .addMethod( + getUpdateLogMetricMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.UpdateLogMetricRequest, + com.google.logging.v2.LogMetric>( + this, METHODID_UPDATE_LOG_METRIC))) + .addMethod( + getDeleteLogMetricMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.DeleteLogMetricRequest, + com.google.protobuf.Empty>( + this, METHODID_DELETE_LOG_METRIC))) + .build(); + } + } + + /** + *
+   * Service for configuring logs-based metrics.
+   * 
+ */ + public static final class MetricsServiceV2Stub extends io.grpc.stub.AbstractStub { + private MetricsServiceV2Stub(io.grpc.Channel channel) { + super(channel); + } + + private MetricsServiceV2Stub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MetricsServiceV2Stub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new MetricsServiceV2Stub(channel, callOptions); + } + + /** + *
+     * Lists logs-based metrics.
+     * 
+ */ + public void listLogMetrics(com.google.logging.v2.ListLogMetricsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListLogMetricsMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Gets a logs-based metric.
+     * 
+ */ + public void getLogMetric(com.google.logging.v2.GetLogMetricRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetLogMetricMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Creates a logs-based metric.
+     * 
+ */ + public void createLogMetric(com.google.logging.v2.CreateLogMetricRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateLogMetricMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Creates or updates a logs-based metric.
+     * 
+ */ + public void updateLogMetric(com.google.logging.v2.UpdateLogMetricRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateLogMetricMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Deletes a logs-based metric.
+     * 
+ */ + public void deleteLogMetric(com.google.logging.v2.DeleteLogMetricRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteLogMetricMethodHelper(), getCallOptions()), request, responseObserver); + } + } + + /** + *
+   * Service for configuring logs-based metrics.
+   * 
+ */ + public static final class MetricsServiceV2BlockingStub extends io.grpc.stub.AbstractStub { + private MetricsServiceV2BlockingStub(io.grpc.Channel channel) { + super(channel); + } + + private MetricsServiceV2BlockingStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MetricsServiceV2BlockingStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new MetricsServiceV2BlockingStub(channel, callOptions); + } + + /** + *
+     * Lists logs-based metrics.
+     * 
+ */ + public com.google.logging.v2.ListLogMetricsResponse listLogMetrics(com.google.logging.v2.ListLogMetricsRequest request) { + return blockingUnaryCall( + getChannel(), getListLogMetricsMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Gets a logs-based metric.
+     * 
+ */ + public com.google.logging.v2.LogMetric getLogMetric(com.google.logging.v2.GetLogMetricRequest request) { + return blockingUnaryCall( + getChannel(), getGetLogMetricMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Creates a logs-based metric.
+     * 
+ */ + public com.google.logging.v2.LogMetric createLogMetric(com.google.logging.v2.CreateLogMetricRequest request) { + return blockingUnaryCall( + getChannel(), getCreateLogMetricMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Creates or updates a logs-based metric.
+     * 
+ */ + public com.google.logging.v2.LogMetric updateLogMetric(com.google.logging.v2.UpdateLogMetricRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateLogMetricMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Deletes a logs-based metric.
+     * 
+ */ + public com.google.protobuf.Empty deleteLogMetric(com.google.logging.v2.DeleteLogMetricRequest request) { + return blockingUnaryCall( + getChannel(), getDeleteLogMetricMethodHelper(), getCallOptions(), request); + } + } + + /** + *
+   * Service for configuring logs-based metrics.
+   * 
+ */ + public static final class MetricsServiceV2FutureStub extends io.grpc.stub.AbstractStub { + private MetricsServiceV2FutureStub(io.grpc.Channel channel) { + super(channel); + } + + private MetricsServiceV2FutureStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MetricsServiceV2FutureStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new MetricsServiceV2FutureStub(channel, callOptions); + } + + /** + *
+     * Lists logs-based metrics.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture listLogMetrics( + com.google.logging.v2.ListLogMetricsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListLogMetricsMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Gets a logs-based metric.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getLogMetric( + com.google.logging.v2.GetLogMetricRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetLogMetricMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Creates a logs-based metric.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture createLogMetric( + com.google.logging.v2.CreateLogMetricRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateLogMetricMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Creates or updates a logs-based metric.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture updateLogMetric( + com.google.logging.v2.UpdateLogMetricRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateLogMetricMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Deletes a logs-based metric.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture deleteLogMetric( + com.google.logging.v2.DeleteLogMetricRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteLogMetricMethodHelper(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_LOG_METRICS = 0; + private static final int METHODID_GET_LOG_METRIC = 1; + private static final int METHODID_CREATE_LOG_METRIC = 2; + private static final int METHODID_UPDATE_LOG_METRIC = 3; + private static final int METHODID_DELETE_LOG_METRIC = 4; + + private static final class MethodHandlers implements + io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final MetricsServiceV2ImplBase serviceImpl; + private final int methodId; + + MethodHandlers(MetricsServiceV2ImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_LIST_LOG_METRICS: + serviceImpl.listLogMetrics((com.google.logging.v2.ListLogMetricsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_LOG_METRIC: + serviceImpl.getLogMetric((com.google.logging.v2.GetLogMetricRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_LOG_METRIC: + serviceImpl.createLogMetric((com.google.logging.v2.CreateLogMetricRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_LOG_METRIC: + serviceImpl.updateLogMetric((com.google.logging.v2.UpdateLogMetricRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_LOG_METRIC: + serviceImpl.deleteLogMetric((com.google.logging.v2.DeleteLogMetricRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private static abstract class MetricsServiceV2BaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + MetricsServiceV2BaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.logging.v2.LoggingMetricsProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("MetricsServiceV2"); + } + } + + private static final class MetricsServiceV2FileDescriptorSupplier + extends MetricsServiceV2BaseDescriptorSupplier { + MetricsServiceV2FileDescriptorSupplier() {} + } + + private static final class MetricsServiceV2MethodDescriptorSupplier + extends MetricsServiceV2BaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + MetricsServiceV2MethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (MetricsServiceV2Grpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new MetricsServiceV2FileDescriptorSupplier()) + .addMethod(getListLogMetricsMethodHelper()) + .addMethod(getGetLogMetricMethodHelper()) + .addMethod(getCreateLogMetricMethodHelper()) + .addMethod(getUpdateLogMetricMethodHelper()) + .addMethod(getDeleteLogMetricMethodHelper()) + .build(); + } + } + } + return result; + } +} diff --git a/proto-google-cloud-logging-v2/pom.xml b/proto-google-cloud-logging-v2/pom.xml new file mode 100644 index 000000000000..6f6b57d204cf --- /dev/null +++ b/proto-google-cloud-logging-v2/pom.xml @@ -0,0 +1,31 @@ + + 4.0.0 + proto-google-cloud-logging-v2 + 0.11.1-SNAPSHOT + proto-google-cloud-logging-v2 + PROTO library for proto-google-cloud-logging-v2 + + com.google.api.grpc + google-api-grpc-pom + 0.11.1-SNAPSHOT + + + + com.google.protobuf + protobuf-java + compile + + + com.google.api + api-common + compile + + + com.google.api.grpc + proto-google-common-protos + compile + + + \ No newline at end of file diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BillingExclusionName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BillingExclusionName.java new file mode 100644 index 000000000000..b91fa35bdf18 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BillingExclusionName.java @@ -0,0 +1,198 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.logging.v2; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameType; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class BillingExclusionName extends ExclusionName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("billingAccounts/{billing_account}/exclusions/{exclusion}"); + + private volatile Map fieldValuesMap; + + private final String billingAccount; + private final String exclusion; + + public String getBillingAccount() { + return billingAccount; + } + + public String getExclusion() { + return exclusion; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private BillingExclusionName(Builder builder) { + billingAccount = Preconditions.checkNotNull(builder.getBillingAccount()); + exclusion = Preconditions.checkNotNull(builder.getExclusion()); + } + + public static BillingExclusionName of(String billingAccount, String exclusion) { + return newBuilder() + .setBillingAccount(billingAccount) + .setExclusion(exclusion) + .build(); + } + + public static String format(String billingAccount, String exclusion) { + return newBuilder() + .setBillingAccount(billingAccount) + .setExclusion(exclusion) + .build() + .toString(); + } + + public static BillingExclusionName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "BillingExclusionName.parse: formattedString not in valid format"); + return of(matchMap.get("billing_account"), matchMap.get("exclusion")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (BillingExclusionName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("billingAccount", billingAccount); + fieldMapBuilder.put("exclusion", exclusion); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + /** + * @deprecated This method is only present to satisfy the ResourceName interface. + */ + @Deprecated + public ResourceNameType getType() { + throw new UnsupportedOperationException("BillingExclusionName.getType() not supported"); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("billing_account", billingAccount, "exclusion", exclusion); + } + + /** Builder for BillingExclusionName. */ + public static class Builder { + + private String billingAccount; + private String exclusion; + + public String getBillingAccount() { + return billingAccount; + } + + public String getExclusion() { + return exclusion; + } + + public Builder setBillingAccount(String billingAccount) { + this.billingAccount = billingAccount; + return this; + } + + public Builder setExclusion(String exclusion) { + this.exclusion = exclusion; + return this; + } + + private Builder() { + } + + private Builder(BillingExclusionName billingExclusionName) { + billingAccount = billingExclusionName.billingAccount; + exclusion = billingExclusionName.exclusion; + } + + public BillingExclusionName build() { + return new BillingExclusionName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof BillingExclusionName) { + BillingExclusionName that = (BillingExclusionName) o; + return (this.billingAccount.equals(that.billingAccount)) + && (this.exclusion.equals(that.exclusion)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= billingAccount.hashCode(); + h *= 1000003; + h ^= exclusion.hashCode(); + return h; + } +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BillingLogName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BillingLogName.java new file mode 100644 index 000000000000..d437bb0135b9 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BillingLogName.java @@ -0,0 +1,198 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.logging.v2; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameType; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class BillingLogName extends LogName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("billingAccounts/{billing_account}/logs/{log}"); + + private volatile Map fieldValuesMap; + + private final String billingAccount; + private final String log; + + public String getBillingAccount() { + return billingAccount; + } + + public String getLog() { + return log; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private BillingLogName(Builder builder) { + billingAccount = Preconditions.checkNotNull(builder.getBillingAccount()); + log = Preconditions.checkNotNull(builder.getLog()); + } + + public static BillingLogName of(String billingAccount, String log) { + return newBuilder() + .setBillingAccount(billingAccount) + .setLog(log) + .build(); + } + + public static String format(String billingAccount, String log) { + return newBuilder() + .setBillingAccount(billingAccount) + .setLog(log) + .build() + .toString(); + } + + public static BillingLogName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "BillingLogName.parse: formattedString not in valid format"); + return of(matchMap.get("billing_account"), matchMap.get("log")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (BillingLogName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("billingAccount", billingAccount); + fieldMapBuilder.put("log", log); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + /** + * @deprecated This method is only present to satisfy the ResourceName interface. + */ + @Deprecated + public ResourceNameType getType() { + throw new UnsupportedOperationException("BillingLogName.getType() not supported"); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("billing_account", billingAccount, "log", log); + } + + /** Builder for BillingLogName. */ + public static class Builder { + + private String billingAccount; + private String log; + + public String getBillingAccount() { + return billingAccount; + } + + public String getLog() { + return log; + } + + public Builder setBillingAccount(String billingAccount) { + this.billingAccount = billingAccount; + return this; + } + + public Builder setLog(String log) { + this.log = log; + return this; + } + + private Builder() { + } + + private Builder(BillingLogName billingLogName) { + billingAccount = billingLogName.billingAccount; + log = billingLogName.log; + } + + public BillingLogName build() { + return new BillingLogName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof BillingLogName) { + BillingLogName that = (BillingLogName) o; + return (this.billingAccount.equals(that.billingAccount)) + && (this.log.equals(that.log)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= billingAccount.hashCode(); + h *= 1000003; + h ^= log.hashCode(); + return h; + } +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BillingName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BillingName.java new file mode 100644 index 000000000000..847b0eb3e92f --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BillingName.java @@ -0,0 +1,175 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.logging.v2; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameType; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class BillingName extends ParentName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("billingAccounts/{billing_account}"); + + private volatile Map fieldValuesMap; + + private final String billingAccount; + + public String getBillingAccount() { + return billingAccount; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private BillingName(Builder builder) { + billingAccount = Preconditions.checkNotNull(builder.getBillingAccount()); + } + + public static BillingName of(String billingAccount) { + return newBuilder() + .setBillingAccount(billingAccount) + .build(); + } + + public static String format(String billingAccount) { + return newBuilder() + .setBillingAccount(billingAccount) + .build() + .toString(); + } + + public static BillingName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "BillingName.parse: formattedString not in valid format"); + return of(matchMap.get("billing_account")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (BillingName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("billingAccount", billingAccount); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + /** + * @deprecated This method is only present to satisfy the ResourceName interface. + */ + @Deprecated + public ResourceNameType getType() { + throw new UnsupportedOperationException("BillingName.getType() not supported"); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("billing_account", billingAccount); + } + + /** Builder for BillingName. */ + public static class Builder { + + private String billingAccount; + + public String getBillingAccount() { + return billingAccount; + } + + public Builder setBillingAccount(String billingAccount) { + this.billingAccount = billingAccount; + return this; + } + + private Builder() { + } + + private Builder(BillingName billingName) { + billingAccount = billingName.billingAccount; + } + + public BillingName build() { + return new BillingName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof BillingName) { + BillingName that = (BillingName) o; + return (this.billingAccount.equals(that.billingAccount)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= billingAccount.hashCode(); + return h; + } +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BillingSinkName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BillingSinkName.java new file mode 100644 index 000000000000..332145fee079 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BillingSinkName.java @@ -0,0 +1,198 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.logging.v2; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameType; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class BillingSinkName extends SinkName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("billingAccounts/{billing_account}/sinks/{sink}"); + + private volatile Map fieldValuesMap; + + private final String billingAccount; + private final String sink; + + public String getBillingAccount() { + return billingAccount; + } + + public String getSink() { + return sink; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private BillingSinkName(Builder builder) { + billingAccount = Preconditions.checkNotNull(builder.getBillingAccount()); + sink = Preconditions.checkNotNull(builder.getSink()); + } + + public static BillingSinkName of(String billingAccount, String sink) { + return newBuilder() + .setBillingAccount(billingAccount) + .setSink(sink) + .build(); + } + + public static String format(String billingAccount, String sink) { + return newBuilder() + .setBillingAccount(billingAccount) + .setSink(sink) + .build() + .toString(); + } + + public static BillingSinkName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "BillingSinkName.parse: formattedString not in valid format"); + return of(matchMap.get("billing_account"), matchMap.get("sink")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (BillingSinkName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("billingAccount", billingAccount); + fieldMapBuilder.put("sink", sink); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + /** + * @deprecated This method is only present to satisfy the ResourceName interface. + */ + @Deprecated + public ResourceNameType getType() { + throw new UnsupportedOperationException("BillingSinkName.getType() not supported"); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("billing_account", billingAccount, "sink", sink); + } + + /** Builder for BillingSinkName. */ + public static class Builder { + + private String billingAccount; + private String sink; + + public String getBillingAccount() { + return billingAccount; + } + + public String getSink() { + return sink; + } + + public Builder setBillingAccount(String billingAccount) { + this.billingAccount = billingAccount; + return this; + } + + public Builder setSink(String sink) { + this.sink = sink; + return this; + } + + private Builder() { + } + + private Builder(BillingSinkName billingSinkName) { + billingAccount = billingSinkName.billingAccount; + sink = billingSinkName.sink; + } + + public BillingSinkName build() { + return new BillingSinkName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof BillingSinkName) { + BillingSinkName that = (BillingSinkName) o; + return (this.billingAccount.equals(that.billingAccount)) + && (this.sink.equals(that.sink)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= billingAccount.hashCode(); + h *= 1000003; + h ^= sink.hashCode(); + return h; + } +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateExclusionRequest.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateExclusionRequest.java new file mode 100644 index 000000000000..9f61bec7c249 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateExclusionRequest.java @@ -0,0 +1,828 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_config.proto + +package com.google.logging.v2; + +/** + *
+ * The parameters to `CreateExclusion`.
+ * 
+ * + * Protobuf type {@code google.logging.v2.CreateExclusionRequest} + */ +public final class CreateExclusionRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.logging.v2.CreateExclusionRequest) + CreateExclusionRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use CreateExclusionRequest.newBuilder() to construct. + private CreateExclusionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CreateExclusionRequest() { + parent_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CreateExclusionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: { + com.google.logging.v2.LogExclusion.Builder subBuilder = null; + if (exclusion_ != null) { + subBuilder = exclusion_.toBuilder(); + } + exclusion_ = input.readMessage(com.google.logging.v2.LogExclusion.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(exclusion_); + exclusion_ = subBuilder.buildPartial(); + } + + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_CreateExclusionRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_CreateExclusionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.CreateExclusionRequest.class, com.google.logging.v2.CreateExclusionRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * Required. The parent resource in which to create the exclusion:
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   * Examples: `"projects/my-logging-project"`, `"organizations/123456789"`.
+   * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + *
+   * Required. The parent resource in which to create the exclusion:
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   * Examples: `"projects/my-logging-project"`, `"organizations/123456789"`.
+   * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXCLUSION_FIELD_NUMBER = 2; + private com.google.logging.v2.LogExclusion exclusion_; + /** + *
+   * Required. The new exclusion, whose `name` parameter is an exclusion name
+   * that is not already used in the parent resource.
+   * 
+ * + * .google.logging.v2.LogExclusion exclusion = 2; + */ + public boolean hasExclusion() { + return exclusion_ != null; + } + /** + *
+   * Required. The new exclusion, whose `name` parameter is an exclusion name
+   * that is not already used in the parent resource.
+   * 
+ * + * .google.logging.v2.LogExclusion exclusion = 2; + */ + public com.google.logging.v2.LogExclusion getExclusion() { + return exclusion_ == null ? com.google.logging.v2.LogExclusion.getDefaultInstance() : exclusion_; + } + /** + *
+   * Required. The new exclusion, whose `name` parameter is an exclusion name
+   * that is not already used in the parent resource.
+   * 
+ * + * .google.logging.v2.LogExclusion exclusion = 2; + */ + public com.google.logging.v2.LogExclusionOrBuilder getExclusionOrBuilder() { + return getExclusion(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (exclusion_ != null) { + output.writeMessage(2, getExclusion()); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (exclusion_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getExclusion()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.logging.v2.CreateExclusionRequest)) { + return super.equals(obj); + } + com.google.logging.v2.CreateExclusionRequest other = (com.google.logging.v2.CreateExclusionRequest) obj; + + boolean result = true; + result = result && getParent() + .equals(other.getParent()); + result = result && (hasExclusion() == other.hasExclusion()); + if (hasExclusion()) { + result = result && getExclusion() + .equals(other.getExclusion()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasExclusion()) { + hash = (37 * hash) + EXCLUSION_FIELD_NUMBER; + hash = (53 * hash) + getExclusion().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.CreateExclusionRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.CreateExclusionRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.CreateExclusionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.CreateExclusionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.CreateExclusionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.CreateExclusionRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.CreateExclusionRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.CreateExclusionRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.CreateExclusionRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.logging.v2.CreateExclusionRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.CreateExclusionRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.CreateExclusionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.logging.v2.CreateExclusionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * The parameters to `CreateExclusion`.
+   * 
+ * + * Protobuf type {@code google.logging.v2.CreateExclusionRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.CreateExclusionRequest) + com.google.logging.v2.CreateExclusionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_CreateExclusionRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_CreateExclusionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.CreateExclusionRequest.class, com.google.logging.v2.CreateExclusionRequest.Builder.class); + } + + // Construct using com.google.logging.v2.CreateExclusionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + parent_ = ""; + + if (exclusionBuilder_ == null) { + exclusion_ = null; + } else { + exclusion_ = null; + exclusionBuilder_ = null; + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_CreateExclusionRequest_descriptor; + } + + public com.google.logging.v2.CreateExclusionRequest getDefaultInstanceForType() { + return com.google.logging.v2.CreateExclusionRequest.getDefaultInstance(); + } + + public com.google.logging.v2.CreateExclusionRequest build() { + com.google.logging.v2.CreateExclusionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.logging.v2.CreateExclusionRequest buildPartial() { + com.google.logging.v2.CreateExclusionRequest result = new com.google.logging.v2.CreateExclusionRequest(this); + result.parent_ = parent_; + if (exclusionBuilder_ == null) { + result.exclusion_ = exclusion_; + } else { + result.exclusion_ = exclusionBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.logging.v2.CreateExclusionRequest) { + return mergeFrom((com.google.logging.v2.CreateExclusionRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.CreateExclusionRequest other) { + if (other == com.google.logging.v2.CreateExclusionRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasExclusion()) { + mergeExclusion(other.getExclusion()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.logging.v2.CreateExclusionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.logging.v2.CreateExclusionRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+     * Required. The parent resource in which to create the exclusion:
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * Examples: `"projects/my-logging-project"`, `"organizations/123456789"`.
+     * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The parent resource in which to create the exclusion:
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * Examples: `"projects/my-logging-project"`, `"organizations/123456789"`.
+     * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The parent resource in which to create the exclusion:
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * Examples: `"projects/my-logging-project"`, `"organizations/123456789"`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The parent resource in which to create the exclusion:
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * Examples: `"projects/my-logging-project"`, `"organizations/123456789"`.
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+     * Required. The parent resource in which to create the exclusion:
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * Examples: `"projects/my-logging-project"`, `"organizations/123456789"`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private com.google.logging.v2.LogExclusion exclusion_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogExclusion, com.google.logging.v2.LogExclusion.Builder, com.google.logging.v2.LogExclusionOrBuilder> exclusionBuilder_; + /** + *
+     * Required. The new exclusion, whose `name` parameter is an exclusion name
+     * that is not already used in the parent resource.
+     * 
+ * + * .google.logging.v2.LogExclusion exclusion = 2; + */ + public boolean hasExclusion() { + return exclusionBuilder_ != null || exclusion_ != null; + } + /** + *
+     * Required. The new exclusion, whose `name` parameter is an exclusion name
+     * that is not already used in the parent resource.
+     * 
+ * + * .google.logging.v2.LogExclusion exclusion = 2; + */ + public com.google.logging.v2.LogExclusion getExclusion() { + if (exclusionBuilder_ == null) { + return exclusion_ == null ? com.google.logging.v2.LogExclusion.getDefaultInstance() : exclusion_; + } else { + return exclusionBuilder_.getMessage(); + } + } + /** + *
+     * Required. The new exclusion, whose `name` parameter is an exclusion name
+     * that is not already used in the parent resource.
+     * 
+ * + * .google.logging.v2.LogExclusion exclusion = 2; + */ + public Builder setExclusion(com.google.logging.v2.LogExclusion value) { + if (exclusionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + exclusion_ = value; + onChanged(); + } else { + exclusionBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Required. The new exclusion, whose `name` parameter is an exclusion name
+     * that is not already used in the parent resource.
+     * 
+ * + * .google.logging.v2.LogExclusion exclusion = 2; + */ + public Builder setExclusion( + com.google.logging.v2.LogExclusion.Builder builderForValue) { + if (exclusionBuilder_ == null) { + exclusion_ = builderForValue.build(); + onChanged(); + } else { + exclusionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Required. The new exclusion, whose `name` parameter is an exclusion name
+     * that is not already used in the parent resource.
+     * 
+ * + * .google.logging.v2.LogExclusion exclusion = 2; + */ + public Builder mergeExclusion(com.google.logging.v2.LogExclusion value) { + if (exclusionBuilder_ == null) { + if (exclusion_ != null) { + exclusion_ = + com.google.logging.v2.LogExclusion.newBuilder(exclusion_).mergeFrom(value).buildPartial(); + } else { + exclusion_ = value; + } + onChanged(); + } else { + exclusionBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Required. The new exclusion, whose `name` parameter is an exclusion name
+     * that is not already used in the parent resource.
+     * 
+ * + * .google.logging.v2.LogExclusion exclusion = 2; + */ + public Builder clearExclusion() { + if (exclusionBuilder_ == null) { + exclusion_ = null; + onChanged(); + } else { + exclusion_ = null; + exclusionBuilder_ = null; + } + + return this; + } + /** + *
+     * Required. The new exclusion, whose `name` parameter is an exclusion name
+     * that is not already used in the parent resource.
+     * 
+ * + * .google.logging.v2.LogExclusion exclusion = 2; + */ + public com.google.logging.v2.LogExclusion.Builder getExclusionBuilder() { + + onChanged(); + return getExclusionFieldBuilder().getBuilder(); + } + /** + *
+     * Required. The new exclusion, whose `name` parameter is an exclusion name
+     * that is not already used in the parent resource.
+     * 
+ * + * .google.logging.v2.LogExclusion exclusion = 2; + */ + public com.google.logging.v2.LogExclusionOrBuilder getExclusionOrBuilder() { + if (exclusionBuilder_ != null) { + return exclusionBuilder_.getMessageOrBuilder(); + } else { + return exclusion_ == null ? + com.google.logging.v2.LogExclusion.getDefaultInstance() : exclusion_; + } + } + /** + *
+     * Required. The new exclusion, whose `name` parameter is an exclusion name
+     * that is not already used in the parent resource.
+     * 
+ * + * .google.logging.v2.LogExclusion exclusion = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogExclusion, com.google.logging.v2.LogExclusion.Builder, com.google.logging.v2.LogExclusionOrBuilder> + getExclusionFieldBuilder() { + if (exclusionBuilder_ == null) { + exclusionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogExclusion, com.google.logging.v2.LogExclusion.Builder, com.google.logging.v2.LogExclusionOrBuilder>( + getExclusion(), + getParentForChildren(), + isClean()); + exclusion_ = null; + } + return exclusionBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.logging.v2.CreateExclusionRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.CreateExclusionRequest) + private static final com.google.logging.v2.CreateExclusionRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.logging.v2.CreateExclusionRequest(); + } + + public static com.google.logging.v2.CreateExclusionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public CreateExclusionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateExclusionRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.logging.v2.CreateExclusionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateExclusionRequestOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateExclusionRequestOrBuilder.java new file mode 100644 index 000000000000..36356712e8c6 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateExclusionRequestOrBuilder.java @@ -0,0 +1,65 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_config.proto + +package com.google.logging.v2; + +public interface CreateExclusionRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.CreateExclusionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The parent resource in which to create the exclusion:
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   * Examples: `"projects/my-logging-project"`, `"organizations/123456789"`.
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + *
+   * Required. The parent resource in which to create the exclusion:
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   * Examples: `"projects/my-logging-project"`, `"organizations/123456789"`.
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * Required. The new exclusion, whose `name` parameter is an exclusion name
+   * that is not already used in the parent resource.
+   * 
+ * + * .google.logging.v2.LogExclusion exclusion = 2; + */ + boolean hasExclusion(); + /** + *
+   * Required. The new exclusion, whose `name` parameter is an exclusion name
+   * that is not already used in the parent resource.
+   * 
+ * + * .google.logging.v2.LogExclusion exclusion = 2; + */ + com.google.logging.v2.LogExclusion getExclusion(); + /** + *
+   * Required. The new exclusion, whose `name` parameter is an exclusion name
+   * that is not already used in the parent resource.
+   * 
+ * + * .google.logging.v2.LogExclusion exclusion = 2; + */ + com.google.logging.v2.LogExclusionOrBuilder getExclusionOrBuilder(); +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateLogMetricRequest.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateLogMetricRequest.java new file mode 100644 index 000000000000..cc5a6e06a05b --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateLogMetricRequest.java @@ -0,0 +1,807 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_metrics.proto + +package com.google.logging.v2; + +/** + *
+ * The parameters to CreateLogMetric.
+ * 
+ * + * Protobuf type {@code google.logging.v2.CreateLogMetricRequest} + */ +public final class CreateLogMetricRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.logging.v2.CreateLogMetricRequest) + CreateLogMetricRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use CreateLogMetricRequest.newBuilder() to construct. + private CreateLogMetricRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CreateLogMetricRequest() { + parent_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CreateLogMetricRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: { + com.google.logging.v2.LogMetric.Builder subBuilder = null; + if (metric_ != null) { + subBuilder = metric_.toBuilder(); + } + metric_ = input.readMessage(com.google.logging.v2.LogMetric.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(metric_); + metric_ = subBuilder.buildPartial(); + } + + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingMetricsProto.internal_static_google_logging_v2_CreateLogMetricRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingMetricsProto.internal_static_google_logging_v2_CreateLogMetricRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.CreateLogMetricRequest.class, com.google.logging.v2.CreateLogMetricRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * The resource name of the project in which to create the metric:
+   *     "projects/[PROJECT_ID]"
+   * The new metric must be provided in the request.
+   * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + *
+   * The resource name of the project in which to create the metric:
+   *     "projects/[PROJECT_ID]"
+   * The new metric must be provided in the request.
+   * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int METRIC_FIELD_NUMBER = 2; + private com.google.logging.v2.LogMetric metric_; + /** + *
+   * The new logs-based metric, which must not have an identifier that
+   * already exists.
+   * 
+ * + * .google.logging.v2.LogMetric metric = 2; + */ + public boolean hasMetric() { + return metric_ != null; + } + /** + *
+   * The new logs-based metric, which must not have an identifier that
+   * already exists.
+   * 
+ * + * .google.logging.v2.LogMetric metric = 2; + */ + public com.google.logging.v2.LogMetric getMetric() { + return metric_ == null ? com.google.logging.v2.LogMetric.getDefaultInstance() : metric_; + } + /** + *
+   * The new logs-based metric, which must not have an identifier that
+   * already exists.
+   * 
+ * + * .google.logging.v2.LogMetric metric = 2; + */ + public com.google.logging.v2.LogMetricOrBuilder getMetricOrBuilder() { + return getMetric(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (metric_ != null) { + output.writeMessage(2, getMetric()); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (metric_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getMetric()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.logging.v2.CreateLogMetricRequest)) { + return super.equals(obj); + } + com.google.logging.v2.CreateLogMetricRequest other = (com.google.logging.v2.CreateLogMetricRequest) obj; + + boolean result = true; + result = result && getParent() + .equals(other.getParent()); + result = result && (hasMetric() == other.hasMetric()); + if (hasMetric()) { + result = result && getMetric() + .equals(other.getMetric()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasMetric()) { + hash = (37 * hash) + METRIC_FIELD_NUMBER; + hash = (53 * hash) + getMetric().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.CreateLogMetricRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.CreateLogMetricRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.CreateLogMetricRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.CreateLogMetricRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.CreateLogMetricRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.CreateLogMetricRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.CreateLogMetricRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.CreateLogMetricRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.CreateLogMetricRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.logging.v2.CreateLogMetricRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.CreateLogMetricRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.CreateLogMetricRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.logging.v2.CreateLogMetricRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * The parameters to CreateLogMetric.
+   * 
+ * + * Protobuf type {@code google.logging.v2.CreateLogMetricRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.CreateLogMetricRequest) + com.google.logging.v2.CreateLogMetricRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingMetricsProto.internal_static_google_logging_v2_CreateLogMetricRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingMetricsProto.internal_static_google_logging_v2_CreateLogMetricRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.CreateLogMetricRequest.class, com.google.logging.v2.CreateLogMetricRequest.Builder.class); + } + + // Construct using com.google.logging.v2.CreateLogMetricRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + parent_ = ""; + + if (metricBuilder_ == null) { + metric_ = null; + } else { + metric_ = null; + metricBuilder_ = null; + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.logging.v2.LoggingMetricsProto.internal_static_google_logging_v2_CreateLogMetricRequest_descriptor; + } + + public com.google.logging.v2.CreateLogMetricRequest getDefaultInstanceForType() { + return com.google.logging.v2.CreateLogMetricRequest.getDefaultInstance(); + } + + public com.google.logging.v2.CreateLogMetricRequest build() { + com.google.logging.v2.CreateLogMetricRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.logging.v2.CreateLogMetricRequest buildPartial() { + com.google.logging.v2.CreateLogMetricRequest result = new com.google.logging.v2.CreateLogMetricRequest(this); + result.parent_ = parent_; + if (metricBuilder_ == null) { + result.metric_ = metric_; + } else { + result.metric_ = metricBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.logging.v2.CreateLogMetricRequest) { + return mergeFrom((com.google.logging.v2.CreateLogMetricRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.CreateLogMetricRequest other) { + if (other == com.google.logging.v2.CreateLogMetricRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasMetric()) { + mergeMetric(other.getMetric()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.logging.v2.CreateLogMetricRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.logging.v2.CreateLogMetricRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+     * The resource name of the project in which to create the metric:
+     *     "projects/[PROJECT_ID]"
+     * The new metric must be provided in the request.
+     * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The resource name of the project in which to create the metric:
+     *     "projects/[PROJECT_ID]"
+     * The new metric must be provided in the request.
+     * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The resource name of the project in which to create the metric:
+     *     "projects/[PROJECT_ID]"
+     * The new metric must be provided in the request.
+     * 
+ * + * string parent = 1; + */ + public Builder setParent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + *
+     * The resource name of the project in which to create the metric:
+     *     "projects/[PROJECT_ID]"
+     * The new metric must be provided in the request.
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+     * The resource name of the project in which to create the metric:
+     *     "projects/[PROJECT_ID]"
+     * The new metric must be provided in the request.
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private com.google.logging.v2.LogMetric metric_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogMetric, com.google.logging.v2.LogMetric.Builder, com.google.logging.v2.LogMetricOrBuilder> metricBuilder_; + /** + *
+     * The new logs-based metric, which must not have an identifier that
+     * already exists.
+     * 
+ * + * .google.logging.v2.LogMetric metric = 2; + */ + public boolean hasMetric() { + return metricBuilder_ != null || metric_ != null; + } + /** + *
+     * The new logs-based metric, which must not have an identifier that
+     * already exists.
+     * 
+ * + * .google.logging.v2.LogMetric metric = 2; + */ + public com.google.logging.v2.LogMetric getMetric() { + if (metricBuilder_ == null) { + return metric_ == null ? com.google.logging.v2.LogMetric.getDefaultInstance() : metric_; + } else { + return metricBuilder_.getMessage(); + } + } + /** + *
+     * The new logs-based metric, which must not have an identifier that
+     * already exists.
+     * 
+ * + * .google.logging.v2.LogMetric metric = 2; + */ + public Builder setMetric(com.google.logging.v2.LogMetric value) { + if (metricBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metric_ = value; + onChanged(); + } else { + metricBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The new logs-based metric, which must not have an identifier that
+     * already exists.
+     * 
+ * + * .google.logging.v2.LogMetric metric = 2; + */ + public Builder setMetric( + com.google.logging.v2.LogMetric.Builder builderForValue) { + if (metricBuilder_ == null) { + metric_ = builderForValue.build(); + onChanged(); + } else { + metricBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The new logs-based metric, which must not have an identifier that
+     * already exists.
+     * 
+ * + * .google.logging.v2.LogMetric metric = 2; + */ + public Builder mergeMetric(com.google.logging.v2.LogMetric value) { + if (metricBuilder_ == null) { + if (metric_ != null) { + metric_ = + com.google.logging.v2.LogMetric.newBuilder(metric_).mergeFrom(value).buildPartial(); + } else { + metric_ = value; + } + onChanged(); + } else { + metricBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The new logs-based metric, which must not have an identifier that
+     * already exists.
+     * 
+ * + * .google.logging.v2.LogMetric metric = 2; + */ + public Builder clearMetric() { + if (metricBuilder_ == null) { + metric_ = null; + onChanged(); + } else { + metric_ = null; + metricBuilder_ = null; + } + + return this; + } + /** + *
+     * The new logs-based metric, which must not have an identifier that
+     * already exists.
+     * 
+ * + * .google.logging.v2.LogMetric metric = 2; + */ + public com.google.logging.v2.LogMetric.Builder getMetricBuilder() { + + onChanged(); + return getMetricFieldBuilder().getBuilder(); + } + /** + *
+     * The new logs-based metric, which must not have an identifier that
+     * already exists.
+     * 
+ * + * .google.logging.v2.LogMetric metric = 2; + */ + public com.google.logging.v2.LogMetricOrBuilder getMetricOrBuilder() { + if (metricBuilder_ != null) { + return metricBuilder_.getMessageOrBuilder(); + } else { + return metric_ == null ? + com.google.logging.v2.LogMetric.getDefaultInstance() : metric_; + } + } + /** + *
+     * The new logs-based metric, which must not have an identifier that
+     * already exists.
+     * 
+ * + * .google.logging.v2.LogMetric metric = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogMetric, com.google.logging.v2.LogMetric.Builder, com.google.logging.v2.LogMetricOrBuilder> + getMetricFieldBuilder() { + if (metricBuilder_ == null) { + metricBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogMetric, com.google.logging.v2.LogMetric.Builder, com.google.logging.v2.LogMetricOrBuilder>( + getMetric(), + getParentForChildren(), + isClean()); + metric_ = null; + } + return metricBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.logging.v2.CreateLogMetricRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.CreateLogMetricRequest) + private static final com.google.logging.v2.CreateLogMetricRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.logging.v2.CreateLogMetricRequest(); + } + + public static com.google.logging.v2.CreateLogMetricRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public CreateLogMetricRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateLogMetricRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.logging.v2.CreateLogMetricRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateLogMetricRequestOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateLogMetricRequestOrBuilder.java new file mode 100644 index 000000000000..8e609c762288 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateLogMetricRequestOrBuilder.java @@ -0,0 +1,59 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_metrics.proto + +package com.google.logging.v2; + +public interface CreateLogMetricRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.CreateLogMetricRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The resource name of the project in which to create the metric:
+   *     "projects/[PROJECT_ID]"
+   * The new metric must be provided in the request.
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + *
+   * The resource name of the project in which to create the metric:
+   *     "projects/[PROJECT_ID]"
+   * The new metric must be provided in the request.
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * The new logs-based metric, which must not have an identifier that
+   * already exists.
+   * 
+ * + * .google.logging.v2.LogMetric metric = 2; + */ + boolean hasMetric(); + /** + *
+   * The new logs-based metric, which must not have an identifier that
+   * already exists.
+   * 
+ * + * .google.logging.v2.LogMetric metric = 2; + */ + com.google.logging.v2.LogMetric getMetric(); + /** + *
+   * The new logs-based metric, which must not have an identifier that
+   * already exists.
+   * 
+ * + * .google.logging.v2.LogMetric metric = 2; + */ + com.google.logging.v2.LogMetricOrBuilder getMetricOrBuilder(); +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateSinkRequest.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateSinkRequest.java new file mode 100644 index 000000000000..d2b76a787b3e --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateSinkRequest.java @@ -0,0 +1,939 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_config.proto + +package com.google.logging.v2; + +/** + *
+ * The parameters to `CreateSink`.
+ * 
+ * + * Protobuf type {@code google.logging.v2.CreateSinkRequest} + */ +public final class CreateSinkRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.logging.v2.CreateSinkRequest) + CreateSinkRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use CreateSinkRequest.newBuilder() to construct. + private CreateSinkRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CreateSinkRequest() { + parent_ = ""; + uniqueWriterIdentity_ = false; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CreateSinkRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: { + com.google.logging.v2.LogSink.Builder subBuilder = null; + if (sink_ != null) { + subBuilder = sink_.toBuilder(); + } + sink_ = input.readMessage(com.google.logging.v2.LogSink.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(sink_); + sink_ = subBuilder.buildPartial(); + } + + break; + } + case 24: { + + uniqueWriterIdentity_ = input.readBool(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_CreateSinkRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_CreateSinkRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.CreateSinkRequest.class, com.google.logging.v2.CreateSinkRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * Required. The resource in which to create the sink:
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   * Examples: `"projects/my-logging-project"`, `"organizations/123456789"`.
+   * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + *
+   * Required. The resource in which to create the sink:
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   * Examples: `"projects/my-logging-project"`, `"organizations/123456789"`.
+   * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SINK_FIELD_NUMBER = 2; + private com.google.logging.v2.LogSink sink_; + /** + *
+   * Required. The new sink, whose `name` parameter is a sink identifier that
+   * is not already in use.
+   * 
+ * + * .google.logging.v2.LogSink sink = 2; + */ + public boolean hasSink() { + return sink_ != null; + } + /** + *
+   * Required. The new sink, whose `name` parameter is a sink identifier that
+   * is not already in use.
+   * 
+ * + * .google.logging.v2.LogSink sink = 2; + */ + public com.google.logging.v2.LogSink getSink() { + return sink_ == null ? com.google.logging.v2.LogSink.getDefaultInstance() : sink_; + } + /** + *
+   * Required. The new sink, whose `name` parameter is a sink identifier that
+   * is not already in use.
+   * 
+ * + * .google.logging.v2.LogSink sink = 2; + */ + public com.google.logging.v2.LogSinkOrBuilder getSinkOrBuilder() { + return getSink(); + } + + public static final int UNIQUE_WRITER_IDENTITY_FIELD_NUMBER = 3; + private boolean uniqueWriterIdentity_; + /** + *
+   * Optional. Determines the kind of IAM identity returned as `writer_identity`
+   * in the new sink.  If this value is omitted or set to false, and if the
+   * sink's parent is a project, then the value returned as `writer_identity` is
+   * the same group or service account used by Stackdriver Logging before the
+   * addition of writer identities to this API. The sink's destination must be
+   * in the same project as the sink itself.
+   * If this field is set to true, or if the sink is owned by a non-project
+   * resource such as an organization, then the value of `writer_identity` will
+   * be a unique service account used only for exports from the new sink.  For
+   * more information, see `writer_identity` in [LogSink][google.logging.v2.LogSink].
+   * 
+ * + * bool unique_writer_identity = 3; + */ + public boolean getUniqueWriterIdentity() { + return uniqueWriterIdentity_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (sink_ != null) { + output.writeMessage(2, getSink()); + } + if (uniqueWriterIdentity_ != false) { + output.writeBool(3, uniqueWriterIdentity_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (sink_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getSink()); + } + if (uniqueWriterIdentity_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, uniqueWriterIdentity_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.logging.v2.CreateSinkRequest)) { + return super.equals(obj); + } + com.google.logging.v2.CreateSinkRequest other = (com.google.logging.v2.CreateSinkRequest) obj; + + boolean result = true; + result = result && getParent() + .equals(other.getParent()); + result = result && (hasSink() == other.hasSink()); + if (hasSink()) { + result = result && getSink() + .equals(other.getSink()); + } + result = result && (getUniqueWriterIdentity() + == other.getUniqueWriterIdentity()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasSink()) { + hash = (37 * hash) + SINK_FIELD_NUMBER; + hash = (53 * hash) + getSink().hashCode(); + } + hash = (37 * hash) + UNIQUE_WRITER_IDENTITY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getUniqueWriterIdentity()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.CreateSinkRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.CreateSinkRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.CreateSinkRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.CreateSinkRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.CreateSinkRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.CreateSinkRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.CreateSinkRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.CreateSinkRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.CreateSinkRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.logging.v2.CreateSinkRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.CreateSinkRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.CreateSinkRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.logging.v2.CreateSinkRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * The parameters to `CreateSink`.
+   * 
+ * + * Protobuf type {@code google.logging.v2.CreateSinkRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.CreateSinkRequest) + com.google.logging.v2.CreateSinkRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_CreateSinkRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_CreateSinkRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.CreateSinkRequest.class, com.google.logging.v2.CreateSinkRequest.Builder.class); + } + + // Construct using com.google.logging.v2.CreateSinkRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + parent_ = ""; + + if (sinkBuilder_ == null) { + sink_ = null; + } else { + sink_ = null; + sinkBuilder_ = null; + } + uniqueWriterIdentity_ = false; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_CreateSinkRequest_descriptor; + } + + public com.google.logging.v2.CreateSinkRequest getDefaultInstanceForType() { + return com.google.logging.v2.CreateSinkRequest.getDefaultInstance(); + } + + public com.google.logging.v2.CreateSinkRequest build() { + com.google.logging.v2.CreateSinkRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.logging.v2.CreateSinkRequest buildPartial() { + com.google.logging.v2.CreateSinkRequest result = new com.google.logging.v2.CreateSinkRequest(this); + result.parent_ = parent_; + if (sinkBuilder_ == null) { + result.sink_ = sink_; + } else { + result.sink_ = sinkBuilder_.build(); + } + result.uniqueWriterIdentity_ = uniqueWriterIdentity_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.logging.v2.CreateSinkRequest) { + return mergeFrom((com.google.logging.v2.CreateSinkRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.CreateSinkRequest other) { + if (other == com.google.logging.v2.CreateSinkRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasSink()) { + mergeSink(other.getSink()); + } + if (other.getUniqueWriterIdentity() != false) { + setUniqueWriterIdentity(other.getUniqueWriterIdentity()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.logging.v2.CreateSinkRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.logging.v2.CreateSinkRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+     * Required. The resource in which to create the sink:
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * Examples: `"projects/my-logging-project"`, `"organizations/123456789"`.
+     * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The resource in which to create the sink:
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * Examples: `"projects/my-logging-project"`, `"organizations/123456789"`.
+     * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The resource in which to create the sink:
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * Examples: `"projects/my-logging-project"`, `"organizations/123456789"`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The resource in which to create the sink:
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * Examples: `"projects/my-logging-project"`, `"organizations/123456789"`.
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+     * Required. The resource in which to create the sink:
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * Examples: `"projects/my-logging-project"`, `"organizations/123456789"`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private com.google.logging.v2.LogSink sink_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogSink, com.google.logging.v2.LogSink.Builder, com.google.logging.v2.LogSinkOrBuilder> sinkBuilder_; + /** + *
+     * Required. The new sink, whose `name` parameter is a sink identifier that
+     * is not already in use.
+     * 
+ * + * .google.logging.v2.LogSink sink = 2; + */ + public boolean hasSink() { + return sinkBuilder_ != null || sink_ != null; + } + /** + *
+     * Required. The new sink, whose `name` parameter is a sink identifier that
+     * is not already in use.
+     * 
+ * + * .google.logging.v2.LogSink sink = 2; + */ + public com.google.logging.v2.LogSink getSink() { + if (sinkBuilder_ == null) { + return sink_ == null ? com.google.logging.v2.LogSink.getDefaultInstance() : sink_; + } else { + return sinkBuilder_.getMessage(); + } + } + /** + *
+     * Required. The new sink, whose `name` parameter is a sink identifier that
+     * is not already in use.
+     * 
+ * + * .google.logging.v2.LogSink sink = 2; + */ + public Builder setSink(com.google.logging.v2.LogSink value) { + if (sinkBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sink_ = value; + onChanged(); + } else { + sinkBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Required. The new sink, whose `name` parameter is a sink identifier that
+     * is not already in use.
+     * 
+ * + * .google.logging.v2.LogSink sink = 2; + */ + public Builder setSink( + com.google.logging.v2.LogSink.Builder builderForValue) { + if (sinkBuilder_ == null) { + sink_ = builderForValue.build(); + onChanged(); + } else { + sinkBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Required. The new sink, whose `name` parameter is a sink identifier that
+     * is not already in use.
+     * 
+ * + * .google.logging.v2.LogSink sink = 2; + */ + public Builder mergeSink(com.google.logging.v2.LogSink value) { + if (sinkBuilder_ == null) { + if (sink_ != null) { + sink_ = + com.google.logging.v2.LogSink.newBuilder(sink_).mergeFrom(value).buildPartial(); + } else { + sink_ = value; + } + onChanged(); + } else { + sinkBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Required. The new sink, whose `name` parameter is a sink identifier that
+     * is not already in use.
+     * 
+ * + * .google.logging.v2.LogSink sink = 2; + */ + public Builder clearSink() { + if (sinkBuilder_ == null) { + sink_ = null; + onChanged(); + } else { + sink_ = null; + sinkBuilder_ = null; + } + + return this; + } + /** + *
+     * Required. The new sink, whose `name` parameter is a sink identifier that
+     * is not already in use.
+     * 
+ * + * .google.logging.v2.LogSink sink = 2; + */ + public com.google.logging.v2.LogSink.Builder getSinkBuilder() { + + onChanged(); + return getSinkFieldBuilder().getBuilder(); + } + /** + *
+     * Required. The new sink, whose `name` parameter is a sink identifier that
+     * is not already in use.
+     * 
+ * + * .google.logging.v2.LogSink sink = 2; + */ + public com.google.logging.v2.LogSinkOrBuilder getSinkOrBuilder() { + if (sinkBuilder_ != null) { + return sinkBuilder_.getMessageOrBuilder(); + } else { + return sink_ == null ? + com.google.logging.v2.LogSink.getDefaultInstance() : sink_; + } + } + /** + *
+     * Required. The new sink, whose `name` parameter is a sink identifier that
+     * is not already in use.
+     * 
+ * + * .google.logging.v2.LogSink sink = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogSink, com.google.logging.v2.LogSink.Builder, com.google.logging.v2.LogSinkOrBuilder> + getSinkFieldBuilder() { + if (sinkBuilder_ == null) { + sinkBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogSink, com.google.logging.v2.LogSink.Builder, com.google.logging.v2.LogSinkOrBuilder>( + getSink(), + getParentForChildren(), + isClean()); + sink_ = null; + } + return sinkBuilder_; + } + + private boolean uniqueWriterIdentity_ ; + /** + *
+     * Optional. Determines the kind of IAM identity returned as `writer_identity`
+     * in the new sink.  If this value is omitted or set to false, and if the
+     * sink's parent is a project, then the value returned as `writer_identity` is
+     * the same group or service account used by Stackdriver Logging before the
+     * addition of writer identities to this API. The sink's destination must be
+     * in the same project as the sink itself.
+     * If this field is set to true, or if the sink is owned by a non-project
+     * resource such as an organization, then the value of `writer_identity` will
+     * be a unique service account used only for exports from the new sink.  For
+     * more information, see `writer_identity` in [LogSink][google.logging.v2.LogSink].
+     * 
+ * + * bool unique_writer_identity = 3; + */ + public boolean getUniqueWriterIdentity() { + return uniqueWriterIdentity_; + } + /** + *
+     * Optional. Determines the kind of IAM identity returned as `writer_identity`
+     * in the new sink.  If this value is omitted or set to false, and if the
+     * sink's parent is a project, then the value returned as `writer_identity` is
+     * the same group or service account used by Stackdriver Logging before the
+     * addition of writer identities to this API. The sink's destination must be
+     * in the same project as the sink itself.
+     * If this field is set to true, or if the sink is owned by a non-project
+     * resource such as an organization, then the value of `writer_identity` will
+     * be a unique service account used only for exports from the new sink.  For
+     * more information, see `writer_identity` in [LogSink][google.logging.v2.LogSink].
+     * 
+ * + * bool unique_writer_identity = 3; + */ + public Builder setUniqueWriterIdentity(boolean value) { + + uniqueWriterIdentity_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. Determines the kind of IAM identity returned as `writer_identity`
+     * in the new sink.  If this value is omitted or set to false, and if the
+     * sink's parent is a project, then the value returned as `writer_identity` is
+     * the same group or service account used by Stackdriver Logging before the
+     * addition of writer identities to this API. The sink's destination must be
+     * in the same project as the sink itself.
+     * If this field is set to true, or if the sink is owned by a non-project
+     * resource such as an organization, then the value of `writer_identity` will
+     * be a unique service account used only for exports from the new sink.  For
+     * more information, see `writer_identity` in [LogSink][google.logging.v2.LogSink].
+     * 
+ * + * bool unique_writer_identity = 3; + */ + public Builder clearUniqueWriterIdentity() { + + uniqueWriterIdentity_ = false; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.logging.v2.CreateSinkRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.CreateSinkRequest) + private static final com.google.logging.v2.CreateSinkRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.logging.v2.CreateSinkRequest(); + } + + public static com.google.logging.v2.CreateSinkRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public CreateSinkRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateSinkRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.logging.v2.CreateSinkRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateSinkRequestOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateSinkRequestOrBuilder.java new file mode 100644 index 000000000000..03a4ff28917e --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateSinkRequestOrBuilder.java @@ -0,0 +1,83 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_config.proto + +package com.google.logging.v2; + +public interface CreateSinkRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.CreateSinkRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The resource in which to create the sink:
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   * Examples: `"projects/my-logging-project"`, `"organizations/123456789"`.
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + *
+   * Required. The resource in which to create the sink:
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   * Examples: `"projects/my-logging-project"`, `"organizations/123456789"`.
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * Required. The new sink, whose `name` parameter is a sink identifier that
+   * is not already in use.
+   * 
+ * + * .google.logging.v2.LogSink sink = 2; + */ + boolean hasSink(); + /** + *
+   * Required. The new sink, whose `name` parameter is a sink identifier that
+   * is not already in use.
+   * 
+ * + * .google.logging.v2.LogSink sink = 2; + */ + com.google.logging.v2.LogSink getSink(); + /** + *
+   * Required. The new sink, whose `name` parameter is a sink identifier that
+   * is not already in use.
+   * 
+ * + * .google.logging.v2.LogSink sink = 2; + */ + com.google.logging.v2.LogSinkOrBuilder getSinkOrBuilder(); + + /** + *
+   * Optional. Determines the kind of IAM identity returned as `writer_identity`
+   * in the new sink.  If this value is omitted or set to false, and if the
+   * sink's parent is a project, then the value returned as `writer_identity` is
+   * the same group or service account used by Stackdriver Logging before the
+   * addition of writer identities to this API. The sink's destination must be
+   * in the same project as the sink itself.
+   * If this field is set to true, or if the sink is owned by a non-project
+   * resource such as an organization, then the value of `writer_identity` will
+   * be a unique service account used only for exports from the new sink.  For
+   * more information, see `writer_identity` in [LogSink][google.logging.v2.LogSink].
+   * 
+ * + * bool unique_writer_identity = 3; + */ + boolean getUniqueWriterIdentity(); +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteExclusionRequest.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteExclusionRequest.java new file mode 100644 index 000000000000..401fa96a2a9b --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteExclusionRequest.java @@ -0,0 +1,587 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_config.proto + +package com.google.logging.v2; + +/** + *
+ * The parameters to `DeleteExclusion`.
+ * 
+ * + * Protobuf type {@code google.logging.v2.DeleteExclusionRequest} + */ +public final class DeleteExclusionRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.logging.v2.DeleteExclusionRequest) + DeleteExclusionRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use DeleteExclusionRequest.newBuilder() to construct. + private DeleteExclusionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DeleteExclusionRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DeleteExclusionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_DeleteExclusionRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_DeleteExclusionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.DeleteExclusionRequest.class, com.google.logging.v2.DeleteExclusionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Required. The resource name of an existing exclusion to delete:
+   *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+   * Example: `"projects/my-project-id/exclusions/my-exclusion-id"`.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * Required. The resource name of an existing exclusion to delete:
+   *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+   * Example: `"projects/my-project-id/exclusions/my-exclusion-id"`.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.logging.v2.DeleteExclusionRequest)) { + return super.equals(obj); + } + com.google.logging.v2.DeleteExclusionRequest other = (com.google.logging.v2.DeleteExclusionRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.DeleteExclusionRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.DeleteExclusionRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.DeleteExclusionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.DeleteExclusionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.DeleteExclusionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.DeleteExclusionRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.DeleteExclusionRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.DeleteExclusionRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.DeleteExclusionRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.logging.v2.DeleteExclusionRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.DeleteExclusionRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.DeleteExclusionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.logging.v2.DeleteExclusionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * The parameters to `DeleteExclusion`.
+   * 
+ * + * Protobuf type {@code google.logging.v2.DeleteExclusionRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.DeleteExclusionRequest) + com.google.logging.v2.DeleteExclusionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_DeleteExclusionRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_DeleteExclusionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.DeleteExclusionRequest.class, com.google.logging.v2.DeleteExclusionRequest.Builder.class); + } + + // Construct using com.google.logging.v2.DeleteExclusionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_DeleteExclusionRequest_descriptor; + } + + public com.google.logging.v2.DeleteExclusionRequest getDefaultInstanceForType() { + return com.google.logging.v2.DeleteExclusionRequest.getDefaultInstance(); + } + + public com.google.logging.v2.DeleteExclusionRequest build() { + com.google.logging.v2.DeleteExclusionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.logging.v2.DeleteExclusionRequest buildPartial() { + com.google.logging.v2.DeleteExclusionRequest result = new com.google.logging.v2.DeleteExclusionRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.logging.v2.DeleteExclusionRequest) { + return mergeFrom((com.google.logging.v2.DeleteExclusionRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.DeleteExclusionRequest other) { + if (other == com.google.logging.v2.DeleteExclusionRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.logging.v2.DeleteExclusionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.logging.v2.DeleteExclusionRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * Required. The resource name of an existing exclusion to delete:
+     *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+     * Example: `"projects/my-project-id/exclusions/my-exclusion-id"`.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The resource name of an existing exclusion to delete:
+     *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+     * Example: `"projects/my-project-id/exclusions/my-exclusion-id"`.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The resource name of an existing exclusion to delete:
+     *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+     * Example: `"projects/my-project-id/exclusions/my-exclusion-id"`.
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The resource name of an existing exclusion to delete:
+     *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+     * Example: `"projects/my-project-id/exclusions/my-exclusion-id"`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Required. The resource name of an existing exclusion to delete:
+     *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+     * Example: `"projects/my-project-id/exclusions/my-exclusion-id"`.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.logging.v2.DeleteExclusionRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.DeleteExclusionRequest) + private static final com.google.logging.v2.DeleteExclusionRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.logging.v2.DeleteExclusionRequest(); + } + + public static com.google.logging.v2.DeleteExclusionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public DeleteExclusionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteExclusionRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.logging.v2.DeleteExclusionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteExclusionRequestOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteExclusionRequestOrBuilder.java new file mode 100644 index 000000000000..bf7173cae0d5 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteExclusionRequestOrBuilder.java @@ -0,0 +1,37 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_config.proto + +package com.google.logging.v2; + +public interface DeleteExclusionRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.DeleteExclusionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The resource name of an existing exclusion to delete:
+   *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+   * Example: `"projects/my-project-id/exclusions/my-exclusion-id"`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * Required. The resource name of an existing exclusion to delete:
+   *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+   * Example: `"projects/my-project-id/exclusions/my-exclusion-id"`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteLogMetricRequest.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteLogMetricRequest.java new file mode 100644 index 000000000000..1bc434af0cb5 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteLogMetricRequest.java @@ -0,0 +1,559 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_metrics.proto + +package com.google.logging.v2; + +/** + *
+ * The parameters to DeleteLogMetric.
+ * 
+ * + * Protobuf type {@code google.logging.v2.DeleteLogMetricRequest} + */ +public final class DeleteLogMetricRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.logging.v2.DeleteLogMetricRequest) + DeleteLogMetricRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use DeleteLogMetricRequest.newBuilder() to construct. + private DeleteLogMetricRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DeleteLogMetricRequest() { + metricName_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DeleteLogMetricRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + metricName_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingMetricsProto.internal_static_google_logging_v2_DeleteLogMetricRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingMetricsProto.internal_static_google_logging_v2_DeleteLogMetricRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.DeleteLogMetricRequest.class, com.google.logging.v2.DeleteLogMetricRequest.Builder.class); + } + + public static final int METRIC_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object metricName_; + /** + *
+   * The resource name of the metric to delete:
+   *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+   * 
+ * + * string metric_name = 1; + */ + public java.lang.String getMetricName() { + java.lang.Object ref = metricName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + metricName_ = s; + return s; + } + } + /** + *
+   * The resource name of the metric to delete:
+   *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+   * 
+ * + * string metric_name = 1; + */ + public com.google.protobuf.ByteString + getMetricNameBytes() { + java.lang.Object ref = metricName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + metricName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getMetricNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, metricName_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getMetricNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, metricName_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.logging.v2.DeleteLogMetricRequest)) { + return super.equals(obj); + } + com.google.logging.v2.DeleteLogMetricRequest other = (com.google.logging.v2.DeleteLogMetricRequest) obj; + + boolean result = true; + result = result && getMetricName() + .equals(other.getMetricName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + METRIC_NAME_FIELD_NUMBER; + hash = (53 * hash) + getMetricName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.DeleteLogMetricRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.DeleteLogMetricRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.DeleteLogMetricRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.DeleteLogMetricRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.DeleteLogMetricRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.DeleteLogMetricRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.DeleteLogMetricRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.DeleteLogMetricRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.DeleteLogMetricRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.logging.v2.DeleteLogMetricRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.DeleteLogMetricRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.DeleteLogMetricRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.logging.v2.DeleteLogMetricRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * The parameters to DeleteLogMetric.
+   * 
+ * + * Protobuf type {@code google.logging.v2.DeleteLogMetricRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.DeleteLogMetricRequest) + com.google.logging.v2.DeleteLogMetricRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingMetricsProto.internal_static_google_logging_v2_DeleteLogMetricRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingMetricsProto.internal_static_google_logging_v2_DeleteLogMetricRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.DeleteLogMetricRequest.class, com.google.logging.v2.DeleteLogMetricRequest.Builder.class); + } + + // Construct using com.google.logging.v2.DeleteLogMetricRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + metricName_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.logging.v2.LoggingMetricsProto.internal_static_google_logging_v2_DeleteLogMetricRequest_descriptor; + } + + public com.google.logging.v2.DeleteLogMetricRequest getDefaultInstanceForType() { + return com.google.logging.v2.DeleteLogMetricRequest.getDefaultInstance(); + } + + public com.google.logging.v2.DeleteLogMetricRequest build() { + com.google.logging.v2.DeleteLogMetricRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.logging.v2.DeleteLogMetricRequest buildPartial() { + com.google.logging.v2.DeleteLogMetricRequest result = new com.google.logging.v2.DeleteLogMetricRequest(this); + result.metricName_ = metricName_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.logging.v2.DeleteLogMetricRequest) { + return mergeFrom((com.google.logging.v2.DeleteLogMetricRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.DeleteLogMetricRequest other) { + if (other == com.google.logging.v2.DeleteLogMetricRequest.getDefaultInstance()) return this; + if (!other.getMetricName().isEmpty()) { + metricName_ = other.metricName_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.logging.v2.DeleteLogMetricRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.logging.v2.DeleteLogMetricRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object metricName_ = ""; + /** + *
+     * The resource name of the metric to delete:
+     *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+     * 
+ * + * string metric_name = 1; + */ + public java.lang.String getMetricName() { + java.lang.Object ref = metricName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + metricName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The resource name of the metric to delete:
+     *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+     * 
+ * + * string metric_name = 1; + */ + public com.google.protobuf.ByteString + getMetricNameBytes() { + java.lang.Object ref = metricName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + metricName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The resource name of the metric to delete:
+     *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+     * 
+ * + * string metric_name = 1; + */ + public Builder setMetricName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + metricName_ = value; + onChanged(); + return this; + } + /** + *
+     * The resource name of the metric to delete:
+     *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+     * 
+ * + * string metric_name = 1; + */ + public Builder clearMetricName() { + + metricName_ = getDefaultInstance().getMetricName(); + onChanged(); + return this; + } + /** + *
+     * The resource name of the metric to delete:
+     *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+     * 
+ * + * string metric_name = 1; + */ + public Builder setMetricNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + metricName_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.logging.v2.DeleteLogMetricRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.DeleteLogMetricRequest) + private static final com.google.logging.v2.DeleteLogMetricRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.logging.v2.DeleteLogMetricRequest(); + } + + public static com.google.logging.v2.DeleteLogMetricRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public DeleteLogMetricRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteLogMetricRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.logging.v2.DeleteLogMetricRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteLogMetricRequestOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteLogMetricRequestOrBuilder.java new file mode 100644 index 000000000000..eb4fded0f074 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteLogMetricRequestOrBuilder.java @@ -0,0 +1,29 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_metrics.proto + +package com.google.logging.v2; + +public interface DeleteLogMetricRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.DeleteLogMetricRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The resource name of the metric to delete:
+   *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+   * 
+ * + * string metric_name = 1; + */ + java.lang.String getMetricName(); + /** + *
+   * The resource name of the metric to delete:
+   *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+   * 
+ * + * string metric_name = 1; + */ + com.google.protobuf.ByteString + getMetricNameBytes(); +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteLogRequest.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteLogRequest.java new file mode 100644 index 000000000000..2f7d243c0688 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteLogRequest.java @@ -0,0 +1,615 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging.proto + +package com.google.logging.v2; + +/** + *
+ * The parameters to DeleteLog.
+ * 
+ * + * Protobuf type {@code google.logging.v2.DeleteLogRequest} + */ +public final class DeleteLogRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.logging.v2.DeleteLogRequest) + DeleteLogRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use DeleteLogRequest.newBuilder() to construct. + private DeleteLogRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DeleteLogRequest() { + logName_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DeleteLogRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + logName_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_DeleteLogRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_DeleteLogRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.DeleteLogRequest.class, com.google.logging.v2.DeleteLogRequest.Builder.class); + } + + public static final int LOG_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object logName_; + /** + *
+   * Required. The resource name of the log to delete:
+   *     "projects/[PROJECT_ID]/logs/[LOG_ID]"
+   *     "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
+   *     "folders/[FOLDER_ID]/logs/[LOG_ID]"
+   * `[LOG_ID]` must be URL-encoded. For example,
+   * `"projects/my-project-id/logs/syslog"`,
+   * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+   * For more information about log names, see
+   * [LogEntry][google.logging.v2.LogEntry].
+   * 
+ * + * string log_name = 1; + */ + public java.lang.String getLogName() { + java.lang.Object ref = logName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + logName_ = s; + return s; + } + } + /** + *
+   * Required. The resource name of the log to delete:
+   *     "projects/[PROJECT_ID]/logs/[LOG_ID]"
+   *     "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
+   *     "folders/[FOLDER_ID]/logs/[LOG_ID]"
+   * `[LOG_ID]` must be URL-encoded. For example,
+   * `"projects/my-project-id/logs/syslog"`,
+   * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+   * For more information about log names, see
+   * [LogEntry][google.logging.v2.LogEntry].
+   * 
+ * + * string log_name = 1; + */ + public com.google.protobuf.ByteString + getLogNameBytes() { + java.lang.Object ref = logName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + logName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getLogNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, logName_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getLogNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, logName_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.logging.v2.DeleteLogRequest)) { + return super.equals(obj); + } + com.google.logging.v2.DeleteLogRequest other = (com.google.logging.v2.DeleteLogRequest) obj; + + boolean result = true; + result = result && getLogName() + .equals(other.getLogName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + LOG_NAME_FIELD_NUMBER; + hash = (53 * hash) + getLogName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.DeleteLogRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.DeleteLogRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.DeleteLogRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.DeleteLogRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.DeleteLogRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.DeleteLogRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.DeleteLogRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.DeleteLogRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.DeleteLogRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.logging.v2.DeleteLogRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.DeleteLogRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.DeleteLogRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.logging.v2.DeleteLogRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * The parameters to DeleteLog.
+   * 
+ * + * Protobuf type {@code google.logging.v2.DeleteLogRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.DeleteLogRequest) + com.google.logging.v2.DeleteLogRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_DeleteLogRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_DeleteLogRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.DeleteLogRequest.class, com.google.logging.v2.DeleteLogRequest.Builder.class); + } + + // Construct using com.google.logging.v2.DeleteLogRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + logName_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_DeleteLogRequest_descriptor; + } + + public com.google.logging.v2.DeleteLogRequest getDefaultInstanceForType() { + return com.google.logging.v2.DeleteLogRequest.getDefaultInstance(); + } + + public com.google.logging.v2.DeleteLogRequest build() { + com.google.logging.v2.DeleteLogRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.logging.v2.DeleteLogRequest buildPartial() { + com.google.logging.v2.DeleteLogRequest result = new com.google.logging.v2.DeleteLogRequest(this); + result.logName_ = logName_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.logging.v2.DeleteLogRequest) { + return mergeFrom((com.google.logging.v2.DeleteLogRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.DeleteLogRequest other) { + if (other == com.google.logging.v2.DeleteLogRequest.getDefaultInstance()) return this; + if (!other.getLogName().isEmpty()) { + logName_ = other.logName_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.logging.v2.DeleteLogRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.logging.v2.DeleteLogRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object logName_ = ""; + /** + *
+     * Required. The resource name of the log to delete:
+     *     "projects/[PROJECT_ID]/logs/[LOG_ID]"
+     *     "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
+     *     "folders/[FOLDER_ID]/logs/[LOG_ID]"
+     * `[LOG_ID]` must be URL-encoded. For example,
+     * `"projects/my-project-id/logs/syslog"`,
+     * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+     * For more information about log names, see
+     * [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * string log_name = 1; + */ + public java.lang.String getLogName() { + java.lang.Object ref = logName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + logName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The resource name of the log to delete:
+     *     "projects/[PROJECT_ID]/logs/[LOG_ID]"
+     *     "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
+     *     "folders/[FOLDER_ID]/logs/[LOG_ID]"
+     * `[LOG_ID]` must be URL-encoded. For example,
+     * `"projects/my-project-id/logs/syslog"`,
+     * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+     * For more information about log names, see
+     * [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * string log_name = 1; + */ + public com.google.protobuf.ByteString + getLogNameBytes() { + java.lang.Object ref = logName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + logName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The resource name of the log to delete:
+     *     "projects/[PROJECT_ID]/logs/[LOG_ID]"
+     *     "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
+     *     "folders/[FOLDER_ID]/logs/[LOG_ID]"
+     * `[LOG_ID]` must be URL-encoded. For example,
+     * `"projects/my-project-id/logs/syslog"`,
+     * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+     * For more information about log names, see
+     * [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * string log_name = 1; + */ + public Builder setLogName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + logName_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The resource name of the log to delete:
+     *     "projects/[PROJECT_ID]/logs/[LOG_ID]"
+     *     "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
+     *     "folders/[FOLDER_ID]/logs/[LOG_ID]"
+     * `[LOG_ID]` must be URL-encoded. For example,
+     * `"projects/my-project-id/logs/syslog"`,
+     * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+     * For more information about log names, see
+     * [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * string log_name = 1; + */ + public Builder clearLogName() { + + logName_ = getDefaultInstance().getLogName(); + onChanged(); + return this; + } + /** + *
+     * Required. The resource name of the log to delete:
+     *     "projects/[PROJECT_ID]/logs/[LOG_ID]"
+     *     "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
+     *     "folders/[FOLDER_ID]/logs/[LOG_ID]"
+     * `[LOG_ID]` must be URL-encoded. For example,
+     * `"projects/my-project-id/logs/syslog"`,
+     * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+     * For more information about log names, see
+     * [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * string log_name = 1; + */ + public Builder setLogNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + logName_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.logging.v2.DeleteLogRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.DeleteLogRequest) + private static final com.google.logging.v2.DeleteLogRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.logging.v2.DeleteLogRequest(); + } + + public static com.google.logging.v2.DeleteLogRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public DeleteLogRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteLogRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.logging.v2.DeleteLogRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteLogRequestOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteLogRequestOrBuilder.java new file mode 100644 index 000000000000..6c2a769424fb --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteLogRequestOrBuilder.java @@ -0,0 +1,45 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging.proto + +package com.google.logging.v2; + +public interface DeleteLogRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.DeleteLogRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The resource name of the log to delete:
+   *     "projects/[PROJECT_ID]/logs/[LOG_ID]"
+   *     "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
+   *     "folders/[FOLDER_ID]/logs/[LOG_ID]"
+   * `[LOG_ID]` must be URL-encoded. For example,
+   * `"projects/my-project-id/logs/syslog"`,
+   * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+   * For more information about log names, see
+   * [LogEntry][google.logging.v2.LogEntry].
+   * 
+ * + * string log_name = 1; + */ + java.lang.String getLogName(); + /** + *
+   * Required. The resource name of the log to delete:
+   *     "projects/[PROJECT_ID]/logs/[LOG_ID]"
+   *     "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
+   *     "folders/[FOLDER_ID]/logs/[LOG_ID]"
+   * `[LOG_ID]` must be URL-encoded. For example,
+   * `"projects/my-project-id/logs/syslog"`,
+   * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+   * For more information about log names, see
+   * [LogEntry][google.logging.v2.LogEntry].
+   * 
+ * + * string log_name = 1; + */ + com.google.protobuf.ByteString + getLogNameBytes(); +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteSinkRequest.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteSinkRequest.java new file mode 100644 index 000000000000..44bf390eab11 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteSinkRequest.java @@ -0,0 +1,594 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_config.proto + +package com.google.logging.v2; + +/** + *
+ * The parameters to `DeleteSink`.
+ * 
+ * + * Protobuf type {@code google.logging.v2.DeleteSinkRequest} + */ +public final class DeleteSinkRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.logging.v2.DeleteSinkRequest) + DeleteSinkRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use DeleteSinkRequest.newBuilder() to construct. + private DeleteSinkRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DeleteSinkRequest() { + sinkName_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DeleteSinkRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + sinkName_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_DeleteSinkRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_DeleteSinkRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.DeleteSinkRequest.class, com.google.logging.v2.DeleteSinkRequest.Builder.class); + } + + public static final int SINK_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object sinkName_; + /** + *
+   * Required. The full resource name of the sink to delete, including the
+   * parent resource and the sink identifier:
+   *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+   *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+   *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+   * Example: `"projects/my-project-id/sinks/my-sink-id"`.
+   * 
+ * + * string sink_name = 1; + */ + public java.lang.String getSinkName() { + java.lang.Object ref = sinkName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sinkName_ = s; + return s; + } + } + /** + *
+   * Required. The full resource name of the sink to delete, including the
+   * parent resource and the sink identifier:
+   *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+   *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+   *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+   * Example: `"projects/my-project-id/sinks/my-sink-id"`.
+   * 
+ * + * string sink_name = 1; + */ + public com.google.protobuf.ByteString + getSinkNameBytes() { + java.lang.Object ref = sinkName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + sinkName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getSinkNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, sinkName_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getSinkNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, sinkName_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.logging.v2.DeleteSinkRequest)) { + return super.equals(obj); + } + com.google.logging.v2.DeleteSinkRequest other = (com.google.logging.v2.DeleteSinkRequest) obj; + + boolean result = true; + result = result && getSinkName() + .equals(other.getSinkName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SINK_NAME_FIELD_NUMBER; + hash = (53 * hash) + getSinkName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.DeleteSinkRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.DeleteSinkRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.DeleteSinkRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.DeleteSinkRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.DeleteSinkRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.DeleteSinkRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.DeleteSinkRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.DeleteSinkRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.DeleteSinkRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.logging.v2.DeleteSinkRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.DeleteSinkRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.DeleteSinkRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.logging.v2.DeleteSinkRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * The parameters to `DeleteSink`.
+   * 
+ * + * Protobuf type {@code google.logging.v2.DeleteSinkRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.DeleteSinkRequest) + com.google.logging.v2.DeleteSinkRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_DeleteSinkRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_DeleteSinkRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.DeleteSinkRequest.class, com.google.logging.v2.DeleteSinkRequest.Builder.class); + } + + // Construct using com.google.logging.v2.DeleteSinkRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + sinkName_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_DeleteSinkRequest_descriptor; + } + + public com.google.logging.v2.DeleteSinkRequest getDefaultInstanceForType() { + return com.google.logging.v2.DeleteSinkRequest.getDefaultInstance(); + } + + public com.google.logging.v2.DeleteSinkRequest build() { + com.google.logging.v2.DeleteSinkRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.logging.v2.DeleteSinkRequest buildPartial() { + com.google.logging.v2.DeleteSinkRequest result = new com.google.logging.v2.DeleteSinkRequest(this); + result.sinkName_ = sinkName_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.logging.v2.DeleteSinkRequest) { + return mergeFrom((com.google.logging.v2.DeleteSinkRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.DeleteSinkRequest other) { + if (other == com.google.logging.v2.DeleteSinkRequest.getDefaultInstance()) return this; + if (!other.getSinkName().isEmpty()) { + sinkName_ = other.sinkName_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.logging.v2.DeleteSinkRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.logging.v2.DeleteSinkRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object sinkName_ = ""; + /** + *
+     * Required. The full resource name of the sink to delete, including the
+     * parent resource and the sink identifier:
+     *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+     *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+     *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+     * Example: `"projects/my-project-id/sinks/my-sink-id"`.
+     * 
+ * + * string sink_name = 1; + */ + public java.lang.String getSinkName() { + java.lang.Object ref = sinkName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sinkName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The full resource name of the sink to delete, including the
+     * parent resource and the sink identifier:
+     *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+     *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+     *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+     * Example: `"projects/my-project-id/sinks/my-sink-id"`.
+     * 
+ * + * string sink_name = 1; + */ + public com.google.protobuf.ByteString + getSinkNameBytes() { + java.lang.Object ref = sinkName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + sinkName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The full resource name of the sink to delete, including the
+     * parent resource and the sink identifier:
+     *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+     *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+     *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+     * Example: `"projects/my-project-id/sinks/my-sink-id"`.
+     * 
+ * + * string sink_name = 1; + */ + public Builder setSinkName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + sinkName_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The full resource name of the sink to delete, including the
+     * parent resource and the sink identifier:
+     *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+     *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+     *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+     * Example: `"projects/my-project-id/sinks/my-sink-id"`.
+     * 
+ * + * string sink_name = 1; + */ + public Builder clearSinkName() { + + sinkName_ = getDefaultInstance().getSinkName(); + onChanged(); + return this; + } + /** + *
+     * Required. The full resource name of the sink to delete, including the
+     * parent resource and the sink identifier:
+     *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+     *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+     *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+     * Example: `"projects/my-project-id/sinks/my-sink-id"`.
+     * 
+ * + * string sink_name = 1; + */ + public Builder setSinkNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + sinkName_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.logging.v2.DeleteSinkRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.DeleteSinkRequest) + private static final com.google.logging.v2.DeleteSinkRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.logging.v2.DeleteSinkRequest(); + } + + public static com.google.logging.v2.DeleteSinkRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public DeleteSinkRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteSinkRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.logging.v2.DeleteSinkRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteSinkRequestOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteSinkRequestOrBuilder.java new file mode 100644 index 000000000000..f70c47fc4e22 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteSinkRequestOrBuilder.java @@ -0,0 +1,39 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_config.proto + +package com.google.logging.v2; + +public interface DeleteSinkRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.DeleteSinkRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The full resource name of the sink to delete, including the
+   * parent resource and the sink identifier:
+   *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+   *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+   *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+   * Example: `"projects/my-project-id/sinks/my-sink-id"`.
+   * 
+ * + * string sink_name = 1; + */ + java.lang.String getSinkName(); + /** + *
+   * Required. The full resource name of the sink to delete, including the
+   * parent resource and the sink identifier:
+   *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+   *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+   *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+   * Example: `"projects/my-project-id/sinks/my-sink-id"`.
+   * 
+ * + * string sink_name = 1; + */ + com.google.protobuf.ByteString + getSinkNameBytes(); +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ExclusionName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ExclusionName.java new file mode 100644 index 000000000000..3d8d63bbe4cc --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ExclusionName.java @@ -0,0 +1,23 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.logging.v2; + +import com.google.api.resourcenames.ResourceName; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public abstract class ExclusionName implements ResourceName { + protected ExclusionName() {} +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ExclusionNames.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ExclusionNames.java new file mode 100644 index 000000000000..9c8a63209576 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ExclusionNames.java @@ -0,0 +1,39 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.logging.v2; + +import com.google.api.resourcenames.ResourceName; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class ExclusionNames { + private ExclusionNames() {} + + public static ExclusionName parse(String resourceNameString) { + if (ProjectExclusionName.isParsableFrom(resourceNameString)) { + return ProjectExclusionName.parse(resourceNameString); + } + if (OrganizationExclusionName.isParsableFrom(resourceNameString)) { + return OrganizationExclusionName.parse(resourceNameString); + } + if (FolderExclusionName.isParsableFrom(resourceNameString)) { + return FolderExclusionName.parse(resourceNameString); + } + if (BillingExclusionName.isParsableFrom(resourceNameString)) { + return BillingExclusionName.parse(resourceNameString); + } + return UntypedExclusionName.parse(resourceNameString); + } +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/FolderExclusionName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/FolderExclusionName.java new file mode 100644 index 000000000000..fa42a81884a4 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/FolderExclusionName.java @@ -0,0 +1,198 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.logging.v2; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameType; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class FolderExclusionName extends ExclusionName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("folders/{folder}/exclusions/{exclusion}"); + + private volatile Map fieldValuesMap; + + private final String folder; + private final String exclusion; + + public String getFolder() { + return folder; + } + + public String getExclusion() { + return exclusion; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private FolderExclusionName(Builder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + exclusion = Preconditions.checkNotNull(builder.getExclusion()); + } + + public static FolderExclusionName of(String folder, String exclusion) { + return newBuilder() + .setFolder(folder) + .setExclusion(exclusion) + .build(); + } + + public static String format(String folder, String exclusion) { + return newBuilder() + .setFolder(folder) + .setExclusion(exclusion) + .build() + .toString(); + } + + public static FolderExclusionName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "FolderExclusionName.parse: formattedString not in valid format"); + return of(matchMap.get("folder"), matchMap.get("exclusion")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (FolderExclusionName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("folder", folder); + fieldMapBuilder.put("exclusion", exclusion); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + /** + * @deprecated This method is only present to satisfy the ResourceName interface. + */ + @Deprecated + public ResourceNameType getType() { + throw new UnsupportedOperationException("FolderExclusionName.getType() not supported"); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("folder", folder, "exclusion", exclusion); + } + + /** Builder for FolderExclusionName. */ + public static class Builder { + + private String folder; + private String exclusion; + + public String getFolder() { + return folder; + } + + public String getExclusion() { + return exclusion; + } + + public Builder setFolder(String folder) { + this.folder = folder; + return this; + } + + public Builder setExclusion(String exclusion) { + this.exclusion = exclusion; + return this; + } + + private Builder() { + } + + private Builder(FolderExclusionName folderExclusionName) { + folder = folderExclusionName.folder; + exclusion = folderExclusionName.exclusion; + } + + public FolderExclusionName build() { + return new FolderExclusionName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof FolderExclusionName) { + FolderExclusionName that = (FolderExclusionName) o; + return (this.folder.equals(that.folder)) + && (this.exclusion.equals(that.exclusion)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= folder.hashCode(); + h *= 1000003; + h ^= exclusion.hashCode(); + return h; + } +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/FolderLogName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/FolderLogName.java new file mode 100644 index 000000000000..cd4b6644f7f8 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/FolderLogName.java @@ -0,0 +1,198 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.logging.v2; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameType; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class FolderLogName extends LogName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("folders/{folder}/logs/{log}"); + + private volatile Map fieldValuesMap; + + private final String folder; + private final String log; + + public String getFolder() { + return folder; + } + + public String getLog() { + return log; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private FolderLogName(Builder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + log = Preconditions.checkNotNull(builder.getLog()); + } + + public static FolderLogName of(String folder, String log) { + return newBuilder() + .setFolder(folder) + .setLog(log) + .build(); + } + + public static String format(String folder, String log) { + return newBuilder() + .setFolder(folder) + .setLog(log) + .build() + .toString(); + } + + public static FolderLogName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "FolderLogName.parse: formattedString not in valid format"); + return of(matchMap.get("folder"), matchMap.get("log")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (FolderLogName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("folder", folder); + fieldMapBuilder.put("log", log); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + /** + * @deprecated This method is only present to satisfy the ResourceName interface. + */ + @Deprecated + public ResourceNameType getType() { + throw new UnsupportedOperationException("FolderLogName.getType() not supported"); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("folder", folder, "log", log); + } + + /** Builder for FolderLogName. */ + public static class Builder { + + private String folder; + private String log; + + public String getFolder() { + return folder; + } + + public String getLog() { + return log; + } + + public Builder setFolder(String folder) { + this.folder = folder; + return this; + } + + public Builder setLog(String log) { + this.log = log; + return this; + } + + private Builder() { + } + + private Builder(FolderLogName folderLogName) { + folder = folderLogName.folder; + log = folderLogName.log; + } + + public FolderLogName build() { + return new FolderLogName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof FolderLogName) { + FolderLogName that = (FolderLogName) o; + return (this.folder.equals(that.folder)) + && (this.log.equals(that.log)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= folder.hashCode(); + h *= 1000003; + h ^= log.hashCode(); + return h; + } +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/FolderName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/FolderName.java new file mode 100644 index 000000000000..068c1e2fdb17 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/FolderName.java @@ -0,0 +1,175 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.logging.v2; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameType; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class FolderName extends ParentName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("folders/{folder}"); + + private volatile Map fieldValuesMap; + + private final String folder; + + public String getFolder() { + return folder; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private FolderName(Builder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + } + + public static FolderName of(String folder) { + return newBuilder() + .setFolder(folder) + .build(); + } + + public static String format(String folder) { + return newBuilder() + .setFolder(folder) + .build() + .toString(); + } + + public static FolderName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "FolderName.parse: formattedString not in valid format"); + return of(matchMap.get("folder")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (FolderName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("folder", folder); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + /** + * @deprecated This method is only present to satisfy the ResourceName interface. + */ + @Deprecated + public ResourceNameType getType() { + throw new UnsupportedOperationException("FolderName.getType() not supported"); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("folder", folder); + } + + /** Builder for FolderName. */ + public static class Builder { + + private String folder; + + public String getFolder() { + return folder; + } + + public Builder setFolder(String folder) { + this.folder = folder; + return this; + } + + private Builder() { + } + + private Builder(FolderName folderName) { + folder = folderName.folder; + } + + public FolderName build() { + return new FolderName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof FolderName) { + FolderName that = (FolderName) o; + return (this.folder.equals(that.folder)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= folder.hashCode(); + return h; + } +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/FolderSinkName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/FolderSinkName.java new file mode 100644 index 000000000000..667854dabe02 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/FolderSinkName.java @@ -0,0 +1,198 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.logging.v2; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameType; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class FolderSinkName extends SinkName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("folders/{folder}/sinks/{sink}"); + + private volatile Map fieldValuesMap; + + private final String folder; + private final String sink; + + public String getFolder() { + return folder; + } + + public String getSink() { + return sink; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private FolderSinkName(Builder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + sink = Preconditions.checkNotNull(builder.getSink()); + } + + public static FolderSinkName of(String folder, String sink) { + return newBuilder() + .setFolder(folder) + .setSink(sink) + .build(); + } + + public static String format(String folder, String sink) { + return newBuilder() + .setFolder(folder) + .setSink(sink) + .build() + .toString(); + } + + public static FolderSinkName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "FolderSinkName.parse: formattedString not in valid format"); + return of(matchMap.get("folder"), matchMap.get("sink")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (FolderSinkName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("folder", folder); + fieldMapBuilder.put("sink", sink); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + /** + * @deprecated This method is only present to satisfy the ResourceName interface. + */ + @Deprecated + public ResourceNameType getType() { + throw new UnsupportedOperationException("FolderSinkName.getType() not supported"); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("folder", folder, "sink", sink); + } + + /** Builder for FolderSinkName. */ + public static class Builder { + + private String folder; + private String sink; + + public String getFolder() { + return folder; + } + + public String getSink() { + return sink; + } + + public Builder setFolder(String folder) { + this.folder = folder; + return this; + } + + public Builder setSink(String sink) { + this.sink = sink; + return this; + } + + private Builder() { + } + + private Builder(FolderSinkName folderSinkName) { + folder = folderSinkName.folder; + sink = folderSinkName.sink; + } + + public FolderSinkName build() { + return new FolderSinkName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof FolderSinkName) { + FolderSinkName that = (FolderSinkName) o; + return (this.folder.equals(that.folder)) + && (this.sink.equals(that.sink)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= folder.hashCode(); + h *= 1000003; + h ^= sink.hashCode(); + return h; + } +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetExclusionRequest.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetExclusionRequest.java new file mode 100644 index 000000000000..07a28453c822 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetExclusionRequest.java @@ -0,0 +1,587 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_config.proto + +package com.google.logging.v2; + +/** + *
+ * The parameters to `GetExclusion`.
+ * 
+ * + * Protobuf type {@code google.logging.v2.GetExclusionRequest} + */ +public final class GetExclusionRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.logging.v2.GetExclusionRequest) + GetExclusionRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use GetExclusionRequest.newBuilder() to construct. + private GetExclusionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetExclusionRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetExclusionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_GetExclusionRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_GetExclusionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.GetExclusionRequest.class, com.google.logging.v2.GetExclusionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Required. The resource name of an existing exclusion:
+   *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+   * Example: `"projects/my-project-id/exclusions/my-exclusion-id"`.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * Required. The resource name of an existing exclusion:
+   *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+   * Example: `"projects/my-project-id/exclusions/my-exclusion-id"`.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.logging.v2.GetExclusionRequest)) { + return super.equals(obj); + } + com.google.logging.v2.GetExclusionRequest other = (com.google.logging.v2.GetExclusionRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.GetExclusionRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.GetExclusionRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.GetExclusionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.GetExclusionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.GetExclusionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.GetExclusionRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.GetExclusionRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.GetExclusionRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.GetExclusionRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.logging.v2.GetExclusionRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.GetExclusionRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.GetExclusionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.logging.v2.GetExclusionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * The parameters to `GetExclusion`.
+   * 
+ * + * Protobuf type {@code google.logging.v2.GetExclusionRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.GetExclusionRequest) + com.google.logging.v2.GetExclusionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_GetExclusionRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_GetExclusionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.GetExclusionRequest.class, com.google.logging.v2.GetExclusionRequest.Builder.class); + } + + // Construct using com.google.logging.v2.GetExclusionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_GetExclusionRequest_descriptor; + } + + public com.google.logging.v2.GetExclusionRequest getDefaultInstanceForType() { + return com.google.logging.v2.GetExclusionRequest.getDefaultInstance(); + } + + public com.google.logging.v2.GetExclusionRequest build() { + com.google.logging.v2.GetExclusionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.logging.v2.GetExclusionRequest buildPartial() { + com.google.logging.v2.GetExclusionRequest result = new com.google.logging.v2.GetExclusionRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.logging.v2.GetExclusionRequest) { + return mergeFrom((com.google.logging.v2.GetExclusionRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.GetExclusionRequest other) { + if (other == com.google.logging.v2.GetExclusionRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.logging.v2.GetExclusionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.logging.v2.GetExclusionRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * Required. The resource name of an existing exclusion:
+     *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+     * Example: `"projects/my-project-id/exclusions/my-exclusion-id"`.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The resource name of an existing exclusion:
+     *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+     * Example: `"projects/my-project-id/exclusions/my-exclusion-id"`.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The resource name of an existing exclusion:
+     *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+     * Example: `"projects/my-project-id/exclusions/my-exclusion-id"`.
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The resource name of an existing exclusion:
+     *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+     * Example: `"projects/my-project-id/exclusions/my-exclusion-id"`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Required. The resource name of an existing exclusion:
+     *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+     * Example: `"projects/my-project-id/exclusions/my-exclusion-id"`.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.logging.v2.GetExclusionRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.GetExclusionRequest) + private static final com.google.logging.v2.GetExclusionRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.logging.v2.GetExclusionRequest(); + } + + public static com.google.logging.v2.GetExclusionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public GetExclusionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetExclusionRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.logging.v2.GetExclusionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetExclusionRequestOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetExclusionRequestOrBuilder.java new file mode 100644 index 000000000000..fae8ae376d0f --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetExclusionRequestOrBuilder.java @@ -0,0 +1,37 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_config.proto + +package com.google.logging.v2; + +public interface GetExclusionRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.GetExclusionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The resource name of an existing exclusion:
+   *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+   * Example: `"projects/my-project-id/exclusions/my-exclusion-id"`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * Required. The resource name of an existing exclusion:
+   *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+   * Example: `"projects/my-project-id/exclusions/my-exclusion-id"`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetLogMetricRequest.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetLogMetricRequest.java new file mode 100644 index 000000000000..dfe219851d2f --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetLogMetricRequest.java @@ -0,0 +1,559 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_metrics.proto + +package com.google.logging.v2; + +/** + *
+ * The parameters to GetLogMetric.
+ * 
+ * + * Protobuf type {@code google.logging.v2.GetLogMetricRequest} + */ +public final class GetLogMetricRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.logging.v2.GetLogMetricRequest) + GetLogMetricRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use GetLogMetricRequest.newBuilder() to construct. + private GetLogMetricRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetLogMetricRequest() { + metricName_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetLogMetricRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + metricName_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingMetricsProto.internal_static_google_logging_v2_GetLogMetricRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingMetricsProto.internal_static_google_logging_v2_GetLogMetricRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.GetLogMetricRequest.class, com.google.logging.v2.GetLogMetricRequest.Builder.class); + } + + public static final int METRIC_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object metricName_; + /** + *
+   * The resource name of the desired metric:
+   *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+   * 
+ * + * string metric_name = 1; + */ + public java.lang.String getMetricName() { + java.lang.Object ref = metricName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + metricName_ = s; + return s; + } + } + /** + *
+   * The resource name of the desired metric:
+   *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+   * 
+ * + * string metric_name = 1; + */ + public com.google.protobuf.ByteString + getMetricNameBytes() { + java.lang.Object ref = metricName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + metricName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getMetricNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, metricName_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getMetricNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, metricName_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.logging.v2.GetLogMetricRequest)) { + return super.equals(obj); + } + com.google.logging.v2.GetLogMetricRequest other = (com.google.logging.v2.GetLogMetricRequest) obj; + + boolean result = true; + result = result && getMetricName() + .equals(other.getMetricName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + METRIC_NAME_FIELD_NUMBER; + hash = (53 * hash) + getMetricName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.GetLogMetricRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.GetLogMetricRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.GetLogMetricRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.GetLogMetricRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.GetLogMetricRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.GetLogMetricRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.GetLogMetricRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.GetLogMetricRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.GetLogMetricRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.logging.v2.GetLogMetricRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.GetLogMetricRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.GetLogMetricRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.logging.v2.GetLogMetricRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * The parameters to GetLogMetric.
+   * 
+ * + * Protobuf type {@code google.logging.v2.GetLogMetricRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.GetLogMetricRequest) + com.google.logging.v2.GetLogMetricRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingMetricsProto.internal_static_google_logging_v2_GetLogMetricRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingMetricsProto.internal_static_google_logging_v2_GetLogMetricRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.GetLogMetricRequest.class, com.google.logging.v2.GetLogMetricRequest.Builder.class); + } + + // Construct using com.google.logging.v2.GetLogMetricRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + metricName_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.logging.v2.LoggingMetricsProto.internal_static_google_logging_v2_GetLogMetricRequest_descriptor; + } + + public com.google.logging.v2.GetLogMetricRequest getDefaultInstanceForType() { + return com.google.logging.v2.GetLogMetricRequest.getDefaultInstance(); + } + + public com.google.logging.v2.GetLogMetricRequest build() { + com.google.logging.v2.GetLogMetricRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.logging.v2.GetLogMetricRequest buildPartial() { + com.google.logging.v2.GetLogMetricRequest result = new com.google.logging.v2.GetLogMetricRequest(this); + result.metricName_ = metricName_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.logging.v2.GetLogMetricRequest) { + return mergeFrom((com.google.logging.v2.GetLogMetricRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.GetLogMetricRequest other) { + if (other == com.google.logging.v2.GetLogMetricRequest.getDefaultInstance()) return this; + if (!other.getMetricName().isEmpty()) { + metricName_ = other.metricName_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.logging.v2.GetLogMetricRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.logging.v2.GetLogMetricRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object metricName_ = ""; + /** + *
+     * The resource name of the desired metric:
+     *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+     * 
+ * + * string metric_name = 1; + */ + public java.lang.String getMetricName() { + java.lang.Object ref = metricName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + metricName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The resource name of the desired metric:
+     *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+     * 
+ * + * string metric_name = 1; + */ + public com.google.protobuf.ByteString + getMetricNameBytes() { + java.lang.Object ref = metricName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + metricName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The resource name of the desired metric:
+     *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+     * 
+ * + * string metric_name = 1; + */ + public Builder setMetricName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + metricName_ = value; + onChanged(); + return this; + } + /** + *
+     * The resource name of the desired metric:
+     *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+     * 
+ * + * string metric_name = 1; + */ + public Builder clearMetricName() { + + metricName_ = getDefaultInstance().getMetricName(); + onChanged(); + return this; + } + /** + *
+     * The resource name of the desired metric:
+     *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+     * 
+ * + * string metric_name = 1; + */ + public Builder setMetricNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + metricName_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.logging.v2.GetLogMetricRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.GetLogMetricRequest) + private static final com.google.logging.v2.GetLogMetricRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.logging.v2.GetLogMetricRequest(); + } + + public static com.google.logging.v2.GetLogMetricRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public GetLogMetricRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetLogMetricRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.logging.v2.GetLogMetricRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetLogMetricRequestOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetLogMetricRequestOrBuilder.java new file mode 100644 index 000000000000..2c6f6ccaf190 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetLogMetricRequestOrBuilder.java @@ -0,0 +1,29 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_metrics.proto + +package com.google.logging.v2; + +public interface GetLogMetricRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.GetLogMetricRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The resource name of the desired metric:
+   *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+   * 
+ * + * string metric_name = 1; + */ + java.lang.String getMetricName(); + /** + *
+   * The resource name of the desired metric:
+   *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+   * 
+ * + * string metric_name = 1; + */ + com.google.protobuf.ByteString + getMetricNameBytes(); +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetSinkRequest.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetSinkRequest.java new file mode 100644 index 000000000000..46903bae84a7 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetSinkRequest.java @@ -0,0 +1,587 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_config.proto + +package com.google.logging.v2; + +/** + *
+ * The parameters to `GetSink`.
+ * 
+ * + * Protobuf type {@code google.logging.v2.GetSinkRequest} + */ +public final class GetSinkRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.logging.v2.GetSinkRequest) + GetSinkRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use GetSinkRequest.newBuilder() to construct. + private GetSinkRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetSinkRequest() { + sinkName_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetSinkRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + sinkName_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_GetSinkRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_GetSinkRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.GetSinkRequest.class, com.google.logging.v2.GetSinkRequest.Builder.class); + } + + public static final int SINK_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object sinkName_; + /** + *
+   * Required. The resource name of the sink:
+   *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+   *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+   *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+   * Example: `"projects/my-project-id/sinks/my-sink-id"`.
+   * 
+ * + * string sink_name = 1; + */ + public java.lang.String getSinkName() { + java.lang.Object ref = sinkName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sinkName_ = s; + return s; + } + } + /** + *
+   * Required. The resource name of the sink:
+   *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+   *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+   *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+   * Example: `"projects/my-project-id/sinks/my-sink-id"`.
+   * 
+ * + * string sink_name = 1; + */ + public com.google.protobuf.ByteString + getSinkNameBytes() { + java.lang.Object ref = sinkName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + sinkName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getSinkNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, sinkName_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getSinkNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, sinkName_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.logging.v2.GetSinkRequest)) { + return super.equals(obj); + } + com.google.logging.v2.GetSinkRequest other = (com.google.logging.v2.GetSinkRequest) obj; + + boolean result = true; + result = result && getSinkName() + .equals(other.getSinkName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SINK_NAME_FIELD_NUMBER; + hash = (53 * hash) + getSinkName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.GetSinkRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.GetSinkRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.GetSinkRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.GetSinkRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.GetSinkRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.GetSinkRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.GetSinkRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.GetSinkRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.GetSinkRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.logging.v2.GetSinkRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.GetSinkRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.GetSinkRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.logging.v2.GetSinkRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * The parameters to `GetSink`.
+   * 
+ * + * Protobuf type {@code google.logging.v2.GetSinkRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.GetSinkRequest) + com.google.logging.v2.GetSinkRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_GetSinkRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_GetSinkRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.GetSinkRequest.class, com.google.logging.v2.GetSinkRequest.Builder.class); + } + + // Construct using com.google.logging.v2.GetSinkRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + sinkName_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_GetSinkRequest_descriptor; + } + + public com.google.logging.v2.GetSinkRequest getDefaultInstanceForType() { + return com.google.logging.v2.GetSinkRequest.getDefaultInstance(); + } + + public com.google.logging.v2.GetSinkRequest build() { + com.google.logging.v2.GetSinkRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.logging.v2.GetSinkRequest buildPartial() { + com.google.logging.v2.GetSinkRequest result = new com.google.logging.v2.GetSinkRequest(this); + result.sinkName_ = sinkName_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.logging.v2.GetSinkRequest) { + return mergeFrom((com.google.logging.v2.GetSinkRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.GetSinkRequest other) { + if (other == com.google.logging.v2.GetSinkRequest.getDefaultInstance()) return this; + if (!other.getSinkName().isEmpty()) { + sinkName_ = other.sinkName_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.logging.v2.GetSinkRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.logging.v2.GetSinkRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object sinkName_ = ""; + /** + *
+     * Required. The resource name of the sink:
+     *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+     *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+     *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+     * Example: `"projects/my-project-id/sinks/my-sink-id"`.
+     * 
+ * + * string sink_name = 1; + */ + public java.lang.String getSinkName() { + java.lang.Object ref = sinkName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sinkName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The resource name of the sink:
+     *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+     *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+     *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+     * Example: `"projects/my-project-id/sinks/my-sink-id"`.
+     * 
+ * + * string sink_name = 1; + */ + public com.google.protobuf.ByteString + getSinkNameBytes() { + java.lang.Object ref = sinkName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + sinkName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The resource name of the sink:
+     *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+     *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+     *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+     * Example: `"projects/my-project-id/sinks/my-sink-id"`.
+     * 
+ * + * string sink_name = 1; + */ + public Builder setSinkName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + sinkName_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The resource name of the sink:
+     *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+     *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+     *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+     * Example: `"projects/my-project-id/sinks/my-sink-id"`.
+     * 
+ * + * string sink_name = 1; + */ + public Builder clearSinkName() { + + sinkName_ = getDefaultInstance().getSinkName(); + onChanged(); + return this; + } + /** + *
+     * Required. The resource name of the sink:
+     *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+     *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+     *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+     * Example: `"projects/my-project-id/sinks/my-sink-id"`.
+     * 
+ * + * string sink_name = 1; + */ + public Builder setSinkNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + sinkName_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.logging.v2.GetSinkRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.GetSinkRequest) + private static final com.google.logging.v2.GetSinkRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.logging.v2.GetSinkRequest(); + } + + public static com.google.logging.v2.GetSinkRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public GetSinkRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetSinkRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.logging.v2.GetSinkRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetSinkRequestOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetSinkRequestOrBuilder.java new file mode 100644 index 000000000000..f4044933e519 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetSinkRequestOrBuilder.java @@ -0,0 +1,37 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_config.proto + +package com.google.logging.v2; + +public interface GetSinkRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.GetSinkRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The resource name of the sink:
+   *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+   *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+   *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+   * Example: `"projects/my-project-id/sinks/my-sink-id"`.
+   * 
+ * + * string sink_name = 1; + */ + java.lang.String getSinkName(); + /** + *
+   * Required. The resource name of the sink:
+   *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+   *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+   *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+   * Example: `"projects/my-project-id/sinks/my-sink-id"`.
+   * 
+ * + * string sink_name = 1; + */ + com.google.protobuf.ByteString + getSinkNameBytes(); +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListExclusionsRequest.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListExclusionsRequest.java new file mode 100644 index 000000000000..052bd618f0f7 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListExclusionsRequest.java @@ -0,0 +1,838 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_config.proto + +package com.google.logging.v2; + +/** + *
+ * The parameters to `ListExclusions`.
+ * 
+ * + * Protobuf type {@code google.logging.v2.ListExclusionsRequest} + */ +public final class ListExclusionsRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.logging.v2.ListExclusionsRequest) + ListExclusionsRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListExclusionsRequest.newBuilder() to construct. + private ListExclusionsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListExclusionsRequest() { + parent_ = ""; + pageToken_ = ""; + pageSize_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListExclusionsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 24: { + + pageSize_ = input.readInt32(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_ListExclusionsRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_ListExclusionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListExclusionsRequest.class, com.google.logging.v2.ListExclusionsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * Required. The parent resource whose exclusions are to be listed.
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + *
+   * Required. The parent resource whose exclusions are to be listed.
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object pageToken_; + /** + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method.  `pageToken` must be the value of
+   * `nextPageToken` from the previous response.  The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method.  `pageToken` must be the value of
+   * `nextPageToken` from the previous response.  The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2; + */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_; + /** + *
+   * Optional. The maximum number of results to return from this request.
+   * Non-positive values are ignored.  The presence of `nextPageToken` in the
+   * response indicates that more results might be available.
+   * 
+ * + * int32 page_size = 3; + */ + public int getPageSize() { + return pageSize_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pageToken_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, pageToken_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, pageSize_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.logging.v2.ListExclusionsRequest)) { + return super.equals(obj); + } + com.google.logging.v2.ListExclusionsRequest other = (com.google.logging.v2.ListExclusionsRequest) obj; + + boolean result = true; + result = result && getParent() + .equals(other.getParent()); + result = result && getPageToken() + .equals(other.getPageToken()); + result = result && (getPageSize() + == other.getPageSize()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.ListExclusionsRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.ListExclusionsRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.ListExclusionsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.ListExclusionsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.ListExclusionsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.ListExclusionsRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.ListExclusionsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.ListExclusionsRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.ListExclusionsRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.logging.v2.ListExclusionsRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.ListExclusionsRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.ListExclusionsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.logging.v2.ListExclusionsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * The parameters to `ListExclusions`.
+   * 
+ * + * Protobuf type {@code google.logging.v2.ListExclusionsRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.ListExclusionsRequest) + com.google.logging.v2.ListExclusionsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_ListExclusionsRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_ListExclusionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListExclusionsRequest.class, com.google.logging.v2.ListExclusionsRequest.Builder.class); + } + + // Construct using com.google.logging.v2.ListExclusionsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + parent_ = ""; + + pageToken_ = ""; + + pageSize_ = 0; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_ListExclusionsRequest_descriptor; + } + + public com.google.logging.v2.ListExclusionsRequest getDefaultInstanceForType() { + return com.google.logging.v2.ListExclusionsRequest.getDefaultInstance(); + } + + public com.google.logging.v2.ListExclusionsRequest build() { + com.google.logging.v2.ListExclusionsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.logging.v2.ListExclusionsRequest buildPartial() { + com.google.logging.v2.ListExclusionsRequest result = new com.google.logging.v2.ListExclusionsRequest(this); + result.parent_ = parent_; + result.pageToken_ = pageToken_; + result.pageSize_ = pageSize_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.logging.v2.ListExclusionsRequest) { + return mergeFrom((com.google.logging.v2.ListExclusionsRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.ListExclusionsRequest other) { + if (other == com.google.logging.v2.ListExclusionsRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.logging.v2.ListExclusionsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.logging.v2.ListExclusionsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+     * Required. The parent resource whose exclusions are to be listed.
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The parent resource whose exclusions are to be listed.
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The parent resource whose exclusions are to be listed.
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * 
+ * + * string parent = 1; + */ + public Builder setParent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The parent resource whose exclusions are to be listed.
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+     * Required. The parent resource whose exclusions are to be listed.
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `pageToken` must be the value of
+     * `nextPageToken` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `pageToken` must be the value of
+     * `nextPageToken` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2; + */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `pageToken` must be the value of
+     * `nextPageToken` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2; + */ + public Builder setPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `pageToken` must be the value of
+     * `nextPageToken` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2; + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `pageToken` must be the value of
+     * `nextPageToken` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2; + */ + public Builder setPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private int pageSize_ ; + /** + *
+     * Optional. The maximum number of results to return from this request.
+     * Non-positive values are ignored.  The presence of `nextPageToken` in the
+     * response indicates that more results might be available.
+     * 
+ * + * int32 page_size = 3; + */ + public int getPageSize() { + return pageSize_; + } + /** + *
+     * Optional. The maximum number of results to return from this request.
+     * Non-positive values are ignored.  The presence of `nextPageToken` in the
+     * response indicates that more results might be available.
+     * 
+ * + * int32 page_size = 3; + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. The maximum number of results to return from this request.
+     * Non-positive values are ignored.  The presence of `nextPageToken` in the
+     * response indicates that more results might be available.
+     * 
+ * + * int32 page_size = 3; + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.logging.v2.ListExclusionsRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.ListExclusionsRequest) + private static final com.google.logging.v2.ListExclusionsRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.logging.v2.ListExclusionsRequest(); + } + + public static com.google.logging.v2.ListExclusionsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ListExclusionsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListExclusionsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.logging.v2.ListExclusionsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListExclusionsRequestOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListExclusionsRequestOrBuilder.java new file mode 100644 index 000000000000..e7158aceda40 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListExclusionsRequestOrBuilder.java @@ -0,0 +1,70 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_config.proto + +package com.google.logging.v2; + +public interface ListExclusionsRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.ListExclusionsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The parent resource whose exclusions are to be listed.
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + *
+   * Required. The parent resource whose exclusions are to be listed.
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method.  `pageToken` must be the value of
+   * `nextPageToken` from the previous response.  The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2; + */ + java.lang.String getPageToken(); + /** + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method.  `pageToken` must be the value of
+   * `nextPageToken` from the previous response.  The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2; + */ + com.google.protobuf.ByteString + getPageTokenBytes(); + + /** + *
+   * Optional. The maximum number of results to return from this request.
+   * Non-positive values are ignored.  The presence of `nextPageToken` in the
+   * response indicates that more results might be available.
+   * 
+ * + * int32 page_size = 3; + */ + int getPageSize(); +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListExclusionsResponse.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListExclusionsResponse.java new file mode 100644 index 000000000000..8ec5ebccadad --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListExclusionsResponse.java @@ -0,0 +1,1006 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_config.proto + +package com.google.logging.v2; + +/** + *
+ * Result returned from `ListExclusions`.
+ * 
+ * + * Protobuf type {@code google.logging.v2.ListExclusionsResponse} + */ +public final class ListExclusionsResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.logging.v2.ListExclusionsResponse) + ListExclusionsResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListExclusionsResponse.newBuilder() to construct. + private ListExclusionsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListExclusionsResponse() { + exclusions_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListExclusionsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + exclusions_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + exclusions_.add( + input.readMessage(com.google.logging.v2.LogExclusion.parser(), extensionRegistry)); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + exclusions_ = java.util.Collections.unmodifiableList(exclusions_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_ListExclusionsResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_ListExclusionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListExclusionsResponse.class, com.google.logging.v2.ListExclusionsResponse.Builder.class); + } + + private int bitField0_; + public static final int EXCLUSIONS_FIELD_NUMBER = 1; + private java.util.List exclusions_; + /** + *
+   * A list of exclusions.
+   * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + public java.util.List getExclusionsList() { + return exclusions_; + } + /** + *
+   * A list of exclusions.
+   * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + public java.util.List + getExclusionsOrBuilderList() { + return exclusions_; + } + /** + *
+   * A list of exclusions.
+   * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + public int getExclusionsCount() { + return exclusions_.size(); + } + /** + *
+   * A list of exclusions.
+   * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + public com.google.logging.v2.LogExclusion getExclusions(int index) { + return exclusions_.get(index); + } + /** + *
+   * A list of exclusions.
+   * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + public com.google.logging.v2.LogExclusionOrBuilder getExclusionsOrBuilder( + int index) { + return exclusions_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + *
+   * If there might be more results than appear in this response, then
+   * `nextPageToken` is included.  To get the next set of results, call the same
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + *
+   * If there might be more results than appear in this response, then
+   * `nextPageToken` is included.  To get the next set of results, call the same
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < exclusions_.size(); i++) { + output.writeMessage(1, exclusions_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < exclusions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, exclusions_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.logging.v2.ListExclusionsResponse)) { + return super.equals(obj); + } + com.google.logging.v2.ListExclusionsResponse other = (com.google.logging.v2.ListExclusionsResponse) obj; + + boolean result = true; + result = result && getExclusionsList() + .equals(other.getExclusionsList()); + result = result && getNextPageToken() + .equals(other.getNextPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getExclusionsCount() > 0) { + hash = (37 * hash) + EXCLUSIONS_FIELD_NUMBER; + hash = (53 * hash) + getExclusionsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.ListExclusionsResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.ListExclusionsResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.ListExclusionsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.ListExclusionsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.ListExclusionsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.ListExclusionsResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.ListExclusionsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.ListExclusionsResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.ListExclusionsResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.logging.v2.ListExclusionsResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.ListExclusionsResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.ListExclusionsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.logging.v2.ListExclusionsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Result returned from `ListExclusions`.
+   * 
+ * + * Protobuf type {@code google.logging.v2.ListExclusionsResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.ListExclusionsResponse) + com.google.logging.v2.ListExclusionsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_ListExclusionsResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_ListExclusionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListExclusionsResponse.class, com.google.logging.v2.ListExclusionsResponse.Builder.class); + } + + // Construct using com.google.logging.v2.ListExclusionsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getExclusionsFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (exclusionsBuilder_ == null) { + exclusions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + exclusionsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_ListExclusionsResponse_descriptor; + } + + public com.google.logging.v2.ListExclusionsResponse getDefaultInstanceForType() { + return com.google.logging.v2.ListExclusionsResponse.getDefaultInstance(); + } + + public com.google.logging.v2.ListExclusionsResponse build() { + com.google.logging.v2.ListExclusionsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.logging.v2.ListExclusionsResponse buildPartial() { + com.google.logging.v2.ListExclusionsResponse result = new com.google.logging.v2.ListExclusionsResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (exclusionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + exclusions_ = java.util.Collections.unmodifiableList(exclusions_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.exclusions_ = exclusions_; + } else { + result.exclusions_ = exclusionsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.logging.v2.ListExclusionsResponse) { + return mergeFrom((com.google.logging.v2.ListExclusionsResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.ListExclusionsResponse other) { + if (other == com.google.logging.v2.ListExclusionsResponse.getDefaultInstance()) return this; + if (exclusionsBuilder_ == null) { + if (!other.exclusions_.isEmpty()) { + if (exclusions_.isEmpty()) { + exclusions_ = other.exclusions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureExclusionsIsMutable(); + exclusions_.addAll(other.exclusions_); + } + onChanged(); + } + } else { + if (!other.exclusions_.isEmpty()) { + if (exclusionsBuilder_.isEmpty()) { + exclusionsBuilder_.dispose(); + exclusionsBuilder_ = null; + exclusions_ = other.exclusions_; + bitField0_ = (bitField0_ & ~0x00000001); + exclusionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getExclusionsFieldBuilder() : null; + } else { + exclusionsBuilder_.addAllMessages(other.exclusions_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.logging.v2.ListExclusionsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.logging.v2.ListExclusionsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List exclusions_ = + java.util.Collections.emptyList(); + private void ensureExclusionsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + exclusions_ = new java.util.ArrayList(exclusions_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogExclusion, com.google.logging.v2.LogExclusion.Builder, com.google.logging.v2.LogExclusionOrBuilder> exclusionsBuilder_; + + /** + *
+     * A list of exclusions.
+     * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + public java.util.List getExclusionsList() { + if (exclusionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(exclusions_); + } else { + return exclusionsBuilder_.getMessageList(); + } + } + /** + *
+     * A list of exclusions.
+     * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + public int getExclusionsCount() { + if (exclusionsBuilder_ == null) { + return exclusions_.size(); + } else { + return exclusionsBuilder_.getCount(); + } + } + /** + *
+     * A list of exclusions.
+     * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + public com.google.logging.v2.LogExclusion getExclusions(int index) { + if (exclusionsBuilder_ == null) { + return exclusions_.get(index); + } else { + return exclusionsBuilder_.getMessage(index); + } + } + /** + *
+     * A list of exclusions.
+     * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + public Builder setExclusions( + int index, com.google.logging.v2.LogExclusion value) { + if (exclusionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExclusionsIsMutable(); + exclusions_.set(index, value); + onChanged(); + } else { + exclusionsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * A list of exclusions.
+     * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + public Builder setExclusions( + int index, com.google.logging.v2.LogExclusion.Builder builderForValue) { + if (exclusionsBuilder_ == null) { + ensureExclusionsIsMutable(); + exclusions_.set(index, builderForValue.build()); + onChanged(); + } else { + exclusionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A list of exclusions.
+     * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + public Builder addExclusions(com.google.logging.v2.LogExclusion value) { + if (exclusionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExclusionsIsMutable(); + exclusions_.add(value); + onChanged(); + } else { + exclusionsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * A list of exclusions.
+     * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + public Builder addExclusions( + int index, com.google.logging.v2.LogExclusion value) { + if (exclusionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExclusionsIsMutable(); + exclusions_.add(index, value); + onChanged(); + } else { + exclusionsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * A list of exclusions.
+     * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + public Builder addExclusions( + com.google.logging.v2.LogExclusion.Builder builderForValue) { + if (exclusionsBuilder_ == null) { + ensureExclusionsIsMutable(); + exclusions_.add(builderForValue.build()); + onChanged(); + } else { + exclusionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * A list of exclusions.
+     * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + public Builder addExclusions( + int index, com.google.logging.v2.LogExclusion.Builder builderForValue) { + if (exclusionsBuilder_ == null) { + ensureExclusionsIsMutable(); + exclusions_.add(index, builderForValue.build()); + onChanged(); + } else { + exclusionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A list of exclusions.
+     * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + public Builder addAllExclusions( + java.lang.Iterable values) { + if (exclusionsBuilder_ == null) { + ensureExclusionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, exclusions_); + onChanged(); + } else { + exclusionsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * A list of exclusions.
+     * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + public Builder clearExclusions() { + if (exclusionsBuilder_ == null) { + exclusions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + exclusionsBuilder_.clear(); + } + return this; + } + /** + *
+     * A list of exclusions.
+     * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + public Builder removeExclusions(int index) { + if (exclusionsBuilder_ == null) { + ensureExclusionsIsMutable(); + exclusions_.remove(index); + onChanged(); + } else { + exclusionsBuilder_.remove(index); + } + return this; + } + /** + *
+     * A list of exclusions.
+     * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + public com.google.logging.v2.LogExclusion.Builder getExclusionsBuilder( + int index) { + return getExclusionsFieldBuilder().getBuilder(index); + } + /** + *
+     * A list of exclusions.
+     * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + public com.google.logging.v2.LogExclusionOrBuilder getExclusionsOrBuilder( + int index) { + if (exclusionsBuilder_ == null) { + return exclusions_.get(index); } else { + return exclusionsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * A list of exclusions.
+     * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + public java.util.List + getExclusionsOrBuilderList() { + if (exclusionsBuilder_ != null) { + return exclusionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(exclusions_); + } + } + /** + *
+     * A list of exclusions.
+     * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + public com.google.logging.v2.LogExclusion.Builder addExclusionsBuilder() { + return getExclusionsFieldBuilder().addBuilder( + com.google.logging.v2.LogExclusion.getDefaultInstance()); + } + /** + *
+     * A list of exclusions.
+     * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + public com.google.logging.v2.LogExclusion.Builder addExclusionsBuilder( + int index) { + return getExclusionsFieldBuilder().addBuilder( + index, com.google.logging.v2.LogExclusion.getDefaultInstance()); + } + /** + *
+     * A list of exclusions.
+     * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + public java.util.List + getExclusionsBuilderList() { + return getExclusionsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogExclusion, com.google.logging.v2.LogExclusion.Builder, com.google.logging.v2.LogExclusionOrBuilder> + getExclusionsFieldBuilder() { + if (exclusionsBuilder_ == null) { + exclusionsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogExclusion, com.google.logging.v2.LogExclusion.Builder, com.google.logging.v2.LogExclusionOrBuilder>( + exclusions_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + exclusions_ = null; + } + return exclusionsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call the same
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call the same
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call the same
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call the same
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call the same
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.logging.v2.ListExclusionsResponse) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.ListExclusionsResponse) + private static final com.google.logging.v2.ListExclusionsResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.logging.v2.ListExclusionsResponse(); + } + + public static com.google.logging.v2.ListExclusionsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ListExclusionsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListExclusionsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.logging.v2.ListExclusionsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListExclusionsResponseOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListExclusionsResponseOrBuilder.java new file mode 100644 index 000000000000..7bfcbac16f51 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListExclusionsResponseOrBuilder.java @@ -0,0 +1,75 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_config.proto + +package com.google.logging.v2; + +public interface ListExclusionsResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.ListExclusionsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * A list of exclusions.
+   * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + java.util.List + getExclusionsList(); + /** + *
+   * A list of exclusions.
+   * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + com.google.logging.v2.LogExclusion getExclusions(int index); + /** + *
+   * A list of exclusions.
+   * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + int getExclusionsCount(); + /** + *
+   * A list of exclusions.
+   * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + java.util.List + getExclusionsOrBuilderList(); + /** + *
+   * A list of exclusions.
+   * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + com.google.logging.v2.LogExclusionOrBuilder getExclusionsOrBuilder( + int index); + + /** + *
+   * If there might be more results than appear in this response, then
+   * `nextPageToken` is included.  To get the next set of results, call the same
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + */ + java.lang.String getNextPageToken(); + /** + *
+   * If there might be more results than appear in this response, then
+   * `nextPageToken` is included.  To get the next set of results, call the same
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + */ + com.google.protobuf.ByteString + getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogEntriesRequest.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogEntriesRequest.java new file mode 100644 index 000000000000..103bf7c4d1c1 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogEntriesRequest.java @@ -0,0 +1,1621 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging.proto + +package com.google.logging.v2; + +/** + *
+ * The parameters to `ListLogEntries`.
+ * 
+ * + * Protobuf type {@code google.logging.v2.ListLogEntriesRequest} + */ +public final class ListLogEntriesRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.logging.v2.ListLogEntriesRequest) + ListLogEntriesRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListLogEntriesRequest.newBuilder() to construct. + private ListLogEntriesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListLogEntriesRequest() { + projectIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + resourceNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; + filter_ = ""; + orderBy_ = ""; + pageSize_ = 0; + pageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListLogEntriesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + projectIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + projectIds_.add(s); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + orderBy_ = s; + break; + } + case 32: { + + pageSize_ = input.readInt32(); + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 66: { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + resourceNames_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + resourceNames_.add(s); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + projectIds_ = projectIds_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + resourceNames_ = resourceNames_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListLogEntriesRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListLogEntriesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListLogEntriesRequest.class, com.google.logging.v2.ListLogEntriesRequest.Builder.class); + } + + private int bitField0_; + public static final int PROJECT_IDS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList projectIds_; + /** + *
+   * Deprecated. Use `resource_names` instead.  One or more project identifiers
+   * or project numbers from which to retrieve log entries.  Example:
+   * `"my-project-1A"`. If present, these project identifiers are converted to
+   * resource name format and added to the list of resources in
+   * `resource_names`.
+   * 
+ * + * repeated string project_ids = 1; + */ + public com.google.protobuf.ProtocolStringList + getProjectIdsList() { + return projectIds_; + } + /** + *
+   * Deprecated. Use `resource_names` instead.  One or more project identifiers
+   * or project numbers from which to retrieve log entries.  Example:
+   * `"my-project-1A"`. If present, these project identifiers are converted to
+   * resource name format and added to the list of resources in
+   * `resource_names`.
+   * 
+ * + * repeated string project_ids = 1; + */ + public int getProjectIdsCount() { + return projectIds_.size(); + } + /** + *
+   * Deprecated. Use `resource_names` instead.  One or more project identifiers
+   * or project numbers from which to retrieve log entries.  Example:
+   * `"my-project-1A"`. If present, these project identifiers are converted to
+   * resource name format and added to the list of resources in
+   * `resource_names`.
+   * 
+ * + * repeated string project_ids = 1; + */ + public java.lang.String getProjectIds(int index) { + return projectIds_.get(index); + } + /** + *
+   * Deprecated. Use `resource_names` instead.  One or more project identifiers
+   * or project numbers from which to retrieve log entries.  Example:
+   * `"my-project-1A"`. If present, these project identifiers are converted to
+   * resource name format and added to the list of resources in
+   * `resource_names`.
+   * 
+ * + * repeated string project_ids = 1; + */ + public com.google.protobuf.ByteString + getProjectIdsBytes(int index) { + return projectIds_.getByteString(index); + } + + public static final int RESOURCE_NAMES_FIELD_NUMBER = 8; + private com.google.protobuf.LazyStringList resourceNames_; + /** + *
+   * Required. Names of one or more parent resources from which to
+   * retrieve log entries:
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   * Projects listed in the `project_ids` field are added to this list.
+   * 
+ * + * repeated string resource_names = 8; + */ + public com.google.protobuf.ProtocolStringList + getResourceNamesList() { + return resourceNames_; + } + /** + *
+   * Required. Names of one or more parent resources from which to
+   * retrieve log entries:
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   * Projects listed in the `project_ids` field are added to this list.
+   * 
+ * + * repeated string resource_names = 8; + */ + public int getResourceNamesCount() { + return resourceNames_.size(); + } + /** + *
+   * Required. Names of one or more parent resources from which to
+   * retrieve log entries:
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   * Projects listed in the `project_ids` field are added to this list.
+   * 
+ * + * repeated string resource_names = 8; + */ + public java.lang.String getResourceNames(int index) { + return resourceNames_.get(index); + } + /** + *
+   * Required. Names of one or more parent resources from which to
+   * retrieve log entries:
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   * Projects listed in the `project_ids` field are added to this list.
+   * 
+ * + * repeated string resource_names = 8; + */ + public com.google.protobuf.ByteString + getResourceNamesBytes(int index) { + return resourceNames_.getByteString(index); + } + + public static final int FILTER_FIELD_NUMBER = 2; + private volatile java.lang.Object filter_; + /** + *
+   * Optional. A filter that chooses which log entries to return.  See [Advanced
+   * Logs Filters](/logging/docs/view/advanced_filters).  Only log entries that
+   * match the filter are returned.  An empty filter matches all log entries in
+   * the resources listed in `resource_names`. Referencing a parent resource
+   * that is not listed in `resource_names` will cause the filter to return no
+   * results.
+   * The maximum length of the filter is 20000 characters.
+   * 
+ * + * string filter = 2; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + *
+   * Optional. A filter that chooses which log entries to return.  See [Advanced
+   * Logs Filters](/logging/docs/view/advanced_filters).  Only log entries that
+   * match the filter are returned.  An empty filter matches all log entries in
+   * the resources listed in `resource_names`. Referencing a parent resource
+   * that is not listed in `resource_names` will cause the filter to return no
+   * results.
+   * The maximum length of the filter is 20000 characters.
+   * 
+ * + * string filter = 2; + */ + public com.google.protobuf.ByteString + getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 3; + private volatile java.lang.Object orderBy_; + /** + *
+   * Optional. How the results should be sorted.  Presently, the only permitted
+   * values are `"timestamp asc"` (default) and `"timestamp desc"`. The first
+   * option returns entries in order of increasing values of
+   * `LogEntry.timestamp` (oldest first), and the second option returns entries
+   * in order of decreasing timestamps (newest first).  Entries with equal
+   * timestamps are returned in order of their `insert_id` values.
+   * 
+ * + * string order_by = 3; + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } + } + /** + *
+   * Optional. How the results should be sorted.  Presently, the only permitted
+   * values are `"timestamp asc"` (default) and `"timestamp desc"`. The first
+   * option returns entries in order of increasing values of
+   * `LogEntry.timestamp` (oldest first), and the second option returns entries
+   * in order of decreasing timestamps (newest first).  Entries with equal
+   * timestamps are returned in order of their `insert_id` values.
+   * 
+ * + * string order_by = 3; + */ + public com.google.protobuf.ByteString + getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 4; + private int pageSize_; + /** + *
+   * Optional. The maximum number of results to return from this request.
+   * Non-positive values are ignored.  The presence of `next_page_token` in the
+   * response indicates that more results might be available.
+   * 
+ * + * int32 page_size = 4; + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 5; + private volatile java.lang.Object pageToken_; + /** + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method.  `page_token` must be the value of
+   * `next_page_token` from the previous response.  The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 5; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method.  `page_token` must be the value of
+   * `next_page_token` from the previous response.  The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 5; + */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < projectIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, projectIds_.getRaw(i)); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + if (!getOrderByBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, orderBy_); + } + if (pageSize_ != 0) { + output.writeInt32(4, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, pageToken_); + } + for (int i = 0; i < resourceNames_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, resourceNames_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < projectIds_.size(); i++) { + dataSize += computeStringSizeNoTag(projectIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getProjectIdsList().size(); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + if (!getOrderByBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, orderBy_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, pageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < resourceNames_.size(); i++) { + dataSize += computeStringSizeNoTag(resourceNames_.getRaw(i)); + } + size += dataSize; + size += 1 * getResourceNamesList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.logging.v2.ListLogEntriesRequest)) { + return super.equals(obj); + } + com.google.logging.v2.ListLogEntriesRequest other = (com.google.logging.v2.ListLogEntriesRequest) obj; + + boolean result = true; + result = result && getProjectIdsList() + .equals(other.getProjectIdsList()); + result = result && getResourceNamesList() + .equals(other.getResourceNamesList()); + result = result && getFilter() + .equals(other.getFilter()); + result = result && getOrderBy() + .equals(other.getOrderBy()); + result = result && (getPageSize() + == other.getPageSize()); + result = result && getPageToken() + .equals(other.getPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getProjectIdsCount() > 0) { + hash = (37 * hash) + PROJECT_IDS_FIELD_NUMBER; + hash = (53 * hash) + getProjectIdsList().hashCode(); + } + if (getResourceNamesCount() > 0) { + hash = (37 * hash) + RESOURCE_NAMES_FIELD_NUMBER; + hash = (53 * hash) + getResourceNamesList().hashCode(); + } + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.ListLogEntriesRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.ListLogEntriesRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.ListLogEntriesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.ListLogEntriesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.ListLogEntriesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.ListLogEntriesRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.ListLogEntriesRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.ListLogEntriesRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.ListLogEntriesRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.logging.v2.ListLogEntriesRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.ListLogEntriesRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.ListLogEntriesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.logging.v2.ListLogEntriesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * The parameters to `ListLogEntries`.
+   * 
+ * + * Protobuf type {@code google.logging.v2.ListLogEntriesRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.ListLogEntriesRequest) + com.google.logging.v2.ListLogEntriesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListLogEntriesRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListLogEntriesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListLogEntriesRequest.class, com.google.logging.v2.ListLogEntriesRequest.Builder.class); + } + + // Construct using com.google.logging.v2.ListLogEntriesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + projectIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + resourceNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + filter_ = ""; + + orderBy_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListLogEntriesRequest_descriptor; + } + + public com.google.logging.v2.ListLogEntriesRequest getDefaultInstanceForType() { + return com.google.logging.v2.ListLogEntriesRequest.getDefaultInstance(); + } + + public com.google.logging.v2.ListLogEntriesRequest build() { + com.google.logging.v2.ListLogEntriesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.logging.v2.ListLogEntriesRequest buildPartial() { + com.google.logging.v2.ListLogEntriesRequest result = new com.google.logging.v2.ListLogEntriesRequest(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + projectIds_ = projectIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.projectIds_ = projectIds_; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + resourceNames_ = resourceNames_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.resourceNames_ = resourceNames_; + result.filter_ = filter_; + result.orderBy_ = orderBy_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.logging.v2.ListLogEntriesRequest) { + return mergeFrom((com.google.logging.v2.ListLogEntriesRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.ListLogEntriesRequest other) { + if (other == com.google.logging.v2.ListLogEntriesRequest.getDefaultInstance()) return this; + if (!other.projectIds_.isEmpty()) { + if (projectIds_.isEmpty()) { + projectIds_ = other.projectIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureProjectIdsIsMutable(); + projectIds_.addAll(other.projectIds_); + } + onChanged(); + } + if (!other.resourceNames_.isEmpty()) { + if (resourceNames_.isEmpty()) { + resourceNames_ = other.resourceNames_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureResourceNamesIsMutable(); + resourceNames_.addAll(other.resourceNames_); + } + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.logging.v2.ListLogEntriesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.logging.v2.ListLogEntriesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.LazyStringList projectIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureProjectIdsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + projectIds_ = new com.google.protobuf.LazyStringArrayList(projectIds_); + bitField0_ |= 0x00000001; + } + } + /** + *
+     * Deprecated. Use `resource_names` instead.  One or more project identifiers
+     * or project numbers from which to retrieve log entries.  Example:
+     * `"my-project-1A"`. If present, these project identifiers are converted to
+     * resource name format and added to the list of resources in
+     * `resource_names`.
+     * 
+ * + * repeated string project_ids = 1; + */ + public com.google.protobuf.ProtocolStringList + getProjectIdsList() { + return projectIds_.getUnmodifiableView(); + } + /** + *
+     * Deprecated. Use `resource_names` instead.  One or more project identifiers
+     * or project numbers from which to retrieve log entries.  Example:
+     * `"my-project-1A"`. If present, these project identifiers are converted to
+     * resource name format and added to the list of resources in
+     * `resource_names`.
+     * 
+ * + * repeated string project_ids = 1; + */ + public int getProjectIdsCount() { + return projectIds_.size(); + } + /** + *
+     * Deprecated. Use `resource_names` instead.  One or more project identifiers
+     * or project numbers from which to retrieve log entries.  Example:
+     * `"my-project-1A"`. If present, these project identifiers are converted to
+     * resource name format and added to the list of resources in
+     * `resource_names`.
+     * 
+ * + * repeated string project_ids = 1; + */ + public java.lang.String getProjectIds(int index) { + return projectIds_.get(index); + } + /** + *
+     * Deprecated. Use `resource_names` instead.  One or more project identifiers
+     * or project numbers from which to retrieve log entries.  Example:
+     * `"my-project-1A"`. If present, these project identifiers are converted to
+     * resource name format and added to the list of resources in
+     * `resource_names`.
+     * 
+ * + * repeated string project_ids = 1; + */ + public com.google.protobuf.ByteString + getProjectIdsBytes(int index) { + return projectIds_.getByteString(index); + } + /** + *
+     * Deprecated. Use `resource_names` instead.  One or more project identifiers
+     * or project numbers from which to retrieve log entries.  Example:
+     * `"my-project-1A"`. If present, these project identifiers are converted to
+     * resource name format and added to the list of resources in
+     * `resource_names`.
+     * 
+ * + * repeated string project_ids = 1; + */ + public Builder setProjectIds( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureProjectIdsIsMutable(); + projectIds_.set(index, value); + onChanged(); + return this; + } + /** + *
+     * Deprecated. Use `resource_names` instead.  One or more project identifiers
+     * or project numbers from which to retrieve log entries.  Example:
+     * `"my-project-1A"`. If present, these project identifiers are converted to
+     * resource name format and added to the list of resources in
+     * `resource_names`.
+     * 
+ * + * repeated string project_ids = 1; + */ + public Builder addProjectIds( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureProjectIdsIsMutable(); + projectIds_.add(value); + onChanged(); + return this; + } + /** + *
+     * Deprecated. Use `resource_names` instead.  One or more project identifiers
+     * or project numbers from which to retrieve log entries.  Example:
+     * `"my-project-1A"`. If present, these project identifiers are converted to
+     * resource name format and added to the list of resources in
+     * `resource_names`.
+     * 
+ * + * repeated string project_ids = 1; + */ + public Builder addAllProjectIds( + java.lang.Iterable values) { + ensureProjectIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, projectIds_); + onChanged(); + return this; + } + /** + *
+     * Deprecated. Use `resource_names` instead.  One or more project identifiers
+     * or project numbers from which to retrieve log entries.  Example:
+     * `"my-project-1A"`. If present, these project identifiers are converted to
+     * resource name format and added to the list of resources in
+     * `resource_names`.
+     * 
+ * + * repeated string project_ids = 1; + */ + public Builder clearProjectIds() { + projectIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+     * Deprecated. Use `resource_names` instead.  One or more project identifiers
+     * or project numbers from which to retrieve log entries.  Example:
+     * `"my-project-1A"`. If present, these project identifiers are converted to
+     * resource name format and added to the list of resources in
+     * `resource_names`.
+     * 
+ * + * repeated string project_ids = 1; + */ + public Builder addProjectIdsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureProjectIdsIsMutable(); + projectIds_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList resourceNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureResourceNamesIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + resourceNames_ = new com.google.protobuf.LazyStringArrayList(resourceNames_); + bitField0_ |= 0x00000002; + } + } + /** + *
+     * Required. Names of one or more parent resources from which to
+     * retrieve log entries:
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * Projects listed in the `project_ids` field are added to this list.
+     * 
+ * + * repeated string resource_names = 8; + */ + public com.google.protobuf.ProtocolStringList + getResourceNamesList() { + return resourceNames_.getUnmodifiableView(); + } + /** + *
+     * Required. Names of one or more parent resources from which to
+     * retrieve log entries:
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * Projects listed in the `project_ids` field are added to this list.
+     * 
+ * + * repeated string resource_names = 8; + */ + public int getResourceNamesCount() { + return resourceNames_.size(); + } + /** + *
+     * Required. Names of one or more parent resources from which to
+     * retrieve log entries:
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * Projects listed in the `project_ids` field are added to this list.
+     * 
+ * + * repeated string resource_names = 8; + */ + public java.lang.String getResourceNames(int index) { + return resourceNames_.get(index); + } + /** + *
+     * Required. Names of one or more parent resources from which to
+     * retrieve log entries:
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * Projects listed in the `project_ids` field are added to this list.
+     * 
+ * + * repeated string resource_names = 8; + */ + public com.google.protobuf.ByteString + getResourceNamesBytes(int index) { + return resourceNames_.getByteString(index); + } + /** + *
+     * Required. Names of one or more parent resources from which to
+     * retrieve log entries:
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * Projects listed in the `project_ids` field are added to this list.
+     * 
+ * + * repeated string resource_names = 8; + */ + public Builder setResourceNames( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourceNamesIsMutable(); + resourceNames_.set(index, value); + onChanged(); + return this; + } + /** + *
+     * Required. Names of one or more parent resources from which to
+     * retrieve log entries:
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * Projects listed in the `project_ids` field are added to this list.
+     * 
+ * + * repeated string resource_names = 8; + */ + public Builder addResourceNames( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourceNamesIsMutable(); + resourceNames_.add(value); + onChanged(); + return this; + } + /** + *
+     * Required. Names of one or more parent resources from which to
+     * retrieve log entries:
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * Projects listed in the `project_ids` field are added to this list.
+     * 
+ * + * repeated string resource_names = 8; + */ + public Builder addAllResourceNames( + java.lang.Iterable values) { + ensureResourceNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, resourceNames_); + onChanged(); + return this; + } + /** + *
+     * Required. Names of one or more parent resources from which to
+     * retrieve log entries:
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * Projects listed in the `project_ids` field are added to this list.
+     * 
+ * + * repeated string resource_names = 8; + */ + public Builder clearResourceNames() { + resourceNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
+     * Required. Names of one or more parent resources from which to
+     * retrieve log entries:
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * Projects listed in the `project_ids` field are added to this list.
+     * 
+ * + * repeated string resource_names = 8; + */ + public Builder addResourceNamesBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureResourceNamesIsMutable(); + resourceNames_.add(value); + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + *
+     * Optional. A filter that chooses which log entries to return.  See [Advanced
+     * Logs Filters](/logging/docs/view/advanced_filters).  Only log entries that
+     * match the filter are returned.  An empty filter matches all log entries in
+     * the resources listed in `resource_names`. Referencing a parent resource
+     * that is not listed in `resource_names` will cause the filter to return no
+     * results.
+     * The maximum length of the filter is 20000 characters.
+     * 
+ * + * string filter = 2; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Optional. A filter that chooses which log entries to return.  See [Advanced
+     * Logs Filters](/logging/docs/view/advanced_filters).  Only log entries that
+     * match the filter are returned.  An empty filter matches all log entries in
+     * the resources listed in `resource_names`. Referencing a parent resource
+     * that is not listed in `resource_names` will cause the filter to return no
+     * results.
+     * The maximum length of the filter is 20000 characters.
+     * 
+ * + * string filter = 2; + */ + public com.google.protobuf.ByteString + getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Optional. A filter that chooses which log entries to return.  See [Advanced
+     * Logs Filters](/logging/docs/view/advanced_filters).  Only log entries that
+     * match the filter are returned.  An empty filter matches all log entries in
+     * the resources listed in `resource_names`. Referencing a parent resource
+     * that is not listed in `resource_names` will cause the filter to return no
+     * results.
+     * The maximum length of the filter is 20000 characters.
+     * 
+ * + * string filter = 2; + */ + public Builder setFilter( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. A filter that chooses which log entries to return.  See [Advanced
+     * Logs Filters](/logging/docs/view/advanced_filters).  Only log entries that
+     * match the filter are returned.  An empty filter matches all log entries in
+     * the resources listed in `resource_names`. Referencing a parent resource
+     * that is not listed in `resource_names` will cause the filter to return no
+     * results.
+     * The maximum length of the filter is 20000 characters.
+     * 
+ * + * string filter = 2; + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + *
+     * Optional. A filter that chooses which log entries to return.  See [Advanced
+     * Logs Filters](/logging/docs/view/advanced_filters).  Only log entries that
+     * match the filter are returned.  An empty filter matches all log entries in
+     * the resources listed in `resource_names`. Referencing a parent resource
+     * that is not listed in `resource_names` will cause the filter to return no
+     * results.
+     * The maximum length of the filter is 20000 characters.
+     * 
+ * + * string filter = 2; + */ + public Builder setFilterBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + *
+     * Optional. How the results should be sorted.  Presently, the only permitted
+     * values are `"timestamp asc"` (default) and `"timestamp desc"`. The first
+     * option returns entries in order of increasing values of
+     * `LogEntry.timestamp` (oldest first), and the second option returns entries
+     * in order of decreasing timestamps (newest first).  Entries with equal
+     * timestamps are returned in order of their `insert_id` values.
+     * 
+ * + * string order_by = 3; + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Optional. How the results should be sorted.  Presently, the only permitted
+     * values are `"timestamp asc"` (default) and `"timestamp desc"`. The first
+     * option returns entries in order of increasing values of
+     * `LogEntry.timestamp` (oldest first), and the second option returns entries
+     * in order of decreasing timestamps (newest first).  Entries with equal
+     * timestamps are returned in order of their `insert_id` values.
+     * 
+ * + * string order_by = 3; + */ + public com.google.protobuf.ByteString + getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Optional. How the results should be sorted.  Presently, the only permitted
+     * values are `"timestamp asc"` (default) and `"timestamp desc"`. The first
+     * option returns entries in order of increasing values of
+     * `LogEntry.timestamp` (oldest first), and the second option returns entries
+     * in order of decreasing timestamps (newest first).  Entries with equal
+     * timestamps are returned in order of their `insert_id` values.
+     * 
+ * + * string order_by = 3; + */ + public Builder setOrderBy( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + orderBy_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. How the results should be sorted.  Presently, the only permitted
+     * values are `"timestamp asc"` (default) and `"timestamp desc"`. The first
+     * option returns entries in order of increasing values of
+     * `LogEntry.timestamp` (oldest first), and the second option returns entries
+     * in order of decreasing timestamps (newest first).  Entries with equal
+     * timestamps are returned in order of their `insert_id` values.
+     * 
+ * + * string order_by = 3; + */ + public Builder clearOrderBy() { + + orderBy_ = getDefaultInstance().getOrderBy(); + onChanged(); + return this; + } + /** + *
+     * Optional. How the results should be sorted.  Presently, the only permitted
+     * values are `"timestamp asc"` (default) and `"timestamp desc"`. The first
+     * option returns entries in order of increasing values of
+     * `LogEntry.timestamp` (oldest first), and the second option returns entries
+     * in order of decreasing timestamps (newest first).  Entries with equal
+     * timestamps are returned in order of their `insert_id` values.
+     * 
+ * + * string order_by = 3; + */ + public Builder setOrderByBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + orderBy_ = value; + onChanged(); + return this; + } + + private int pageSize_ ; + /** + *
+     * Optional. The maximum number of results to return from this request.
+     * Non-positive values are ignored.  The presence of `next_page_token` in the
+     * response indicates that more results might be available.
+     * 
+ * + * int32 page_size = 4; + */ + public int getPageSize() { + return pageSize_; + } + /** + *
+     * Optional. The maximum number of results to return from this request.
+     * Non-positive values are ignored.  The presence of `next_page_token` in the
+     * response indicates that more results might be available.
+     * 
+ * + * int32 page_size = 4; + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. The maximum number of results to return from this request.
+     * Non-positive values are ignored.  The presence of `next_page_token` in the
+     * response indicates that more results might be available.
+     * 
+ * + * int32 page_size = 4; + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `page_token` must be the value of
+     * `next_page_token` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 5; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `page_token` must be the value of
+     * `next_page_token` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 5; + */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `page_token` must be the value of
+     * `next_page_token` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 5; + */ + public Builder setPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `page_token` must be the value of
+     * `next_page_token` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 5; + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `page_token` must be the value of
+     * `next_page_token` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 5; + */ + public Builder setPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.logging.v2.ListLogEntriesRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.ListLogEntriesRequest) + private static final com.google.logging.v2.ListLogEntriesRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.logging.v2.ListLogEntriesRequest(); + } + + public static com.google.logging.v2.ListLogEntriesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ListLogEntriesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListLogEntriesRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.logging.v2.ListLogEntriesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogEntriesRequestOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogEntriesRequestOrBuilder.java new file mode 100644 index 000000000000..52cd71ae1783 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogEntriesRequestOrBuilder.java @@ -0,0 +1,212 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging.proto + +package com.google.logging.v2; + +public interface ListLogEntriesRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.ListLogEntriesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Deprecated. Use `resource_names` instead.  One or more project identifiers
+   * or project numbers from which to retrieve log entries.  Example:
+   * `"my-project-1A"`. If present, these project identifiers are converted to
+   * resource name format and added to the list of resources in
+   * `resource_names`.
+   * 
+ * + * repeated string project_ids = 1; + */ + java.util.List + getProjectIdsList(); + /** + *
+   * Deprecated. Use `resource_names` instead.  One or more project identifiers
+   * or project numbers from which to retrieve log entries.  Example:
+   * `"my-project-1A"`. If present, these project identifiers are converted to
+   * resource name format and added to the list of resources in
+   * `resource_names`.
+   * 
+ * + * repeated string project_ids = 1; + */ + int getProjectIdsCount(); + /** + *
+   * Deprecated. Use `resource_names` instead.  One or more project identifiers
+   * or project numbers from which to retrieve log entries.  Example:
+   * `"my-project-1A"`. If present, these project identifiers are converted to
+   * resource name format and added to the list of resources in
+   * `resource_names`.
+   * 
+ * + * repeated string project_ids = 1; + */ + java.lang.String getProjectIds(int index); + /** + *
+   * Deprecated. Use `resource_names` instead.  One or more project identifiers
+   * or project numbers from which to retrieve log entries.  Example:
+   * `"my-project-1A"`. If present, these project identifiers are converted to
+   * resource name format and added to the list of resources in
+   * `resource_names`.
+   * 
+ * + * repeated string project_ids = 1; + */ + com.google.protobuf.ByteString + getProjectIdsBytes(int index); + + /** + *
+   * Required. Names of one or more parent resources from which to
+   * retrieve log entries:
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   * Projects listed in the `project_ids` field are added to this list.
+   * 
+ * + * repeated string resource_names = 8; + */ + java.util.List + getResourceNamesList(); + /** + *
+   * Required. Names of one or more parent resources from which to
+   * retrieve log entries:
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   * Projects listed in the `project_ids` field are added to this list.
+   * 
+ * + * repeated string resource_names = 8; + */ + int getResourceNamesCount(); + /** + *
+   * Required. Names of one or more parent resources from which to
+   * retrieve log entries:
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   * Projects listed in the `project_ids` field are added to this list.
+   * 
+ * + * repeated string resource_names = 8; + */ + java.lang.String getResourceNames(int index); + /** + *
+   * Required. Names of one or more parent resources from which to
+   * retrieve log entries:
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   * Projects listed in the `project_ids` field are added to this list.
+   * 
+ * + * repeated string resource_names = 8; + */ + com.google.protobuf.ByteString + getResourceNamesBytes(int index); + + /** + *
+   * Optional. A filter that chooses which log entries to return.  See [Advanced
+   * Logs Filters](/logging/docs/view/advanced_filters).  Only log entries that
+   * match the filter are returned.  An empty filter matches all log entries in
+   * the resources listed in `resource_names`. Referencing a parent resource
+   * that is not listed in `resource_names` will cause the filter to return no
+   * results.
+   * The maximum length of the filter is 20000 characters.
+   * 
+ * + * string filter = 2; + */ + java.lang.String getFilter(); + /** + *
+   * Optional. A filter that chooses which log entries to return.  See [Advanced
+   * Logs Filters](/logging/docs/view/advanced_filters).  Only log entries that
+   * match the filter are returned.  An empty filter matches all log entries in
+   * the resources listed in `resource_names`. Referencing a parent resource
+   * that is not listed in `resource_names` will cause the filter to return no
+   * results.
+   * The maximum length of the filter is 20000 characters.
+   * 
+ * + * string filter = 2; + */ + com.google.protobuf.ByteString + getFilterBytes(); + + /** + *
+   * Optional. How the results should be sorted.  Presently, the only permitted
+   * values are `"timestamp asc"` (default) and `"timestamp desc"`. The first
+   * option returns entries in order of increasing values of
+   * `LogEntry.timestamp` (oldest first), and the second option returns entries
+   * in order of decreasing timestamps (newest first).  Entries with equal
+   * timestamps are returned in order of their `insert_id` values.
+   * 
+ * + * string order_by = 3; + */ + java.lang.String getOrderBy(); + /** + *
+   * Optional. How the results should be sorted.  Presently, the only permitted
+   * values are `"timestamp asc"` (default) and `"timestamp desc"`. The first
+   * option returns entries in order of increasing values of
+   * `LogEntry.timestamp` (oldest first), and the second option returns entries
+   * in order of decreasing timestamps (newest first).  Entries with equal
+   * timestamps are returned in order of their `insert_id` values.
+   * 
+ * + * string order_by = 3; + */ + com.google.protobuf.ByteString + getOrderByBytes(); + + /** + *
+   * Optional. The maximum number of results to return from this request.
+   * Non-positive values are ignored.  The presence of `next_page_token` in the
+   * response indicates that more results might be available.
+   * 
+ * + * int32 page_size = 4; + */ + int getPageSize(); + + /** + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method.  `page_token` must be the value of
+   * `next_page_token` from the previous response.  The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 5; + */ + java.lang.String getPageToken(); + /** + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method.  `page_token` must be the value of
+   * `next_page_token` from the previous response.  The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 5; + */ + com.google.protobuf.ByteString + getPageTokenBytes(); +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogEntriesResponse.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogEntriesResponse.java new file mode 100644 index 000000000000..6fd409b26e0d --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogEntriesResponse.java @@ -0,0 +1,1094 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging.proto + +package com.google.logging.v2; + +/** + *
+ * Result returned from `ListLogEntries`.
+ * 
+ * + * Protobuf type {@code google.logging.v2.ListLogEntriesResponse} + */ +public final class ListLogEntriesResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.logging.v2.ListLogEntriesResponse) + ListLogEntriesResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListLogEntriesResponse.newBuilder() to construct. + private ListLogEntriesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListLogEntriesResponse() { + entries_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListLogEntriesResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + entries_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + entries_.add( + input.readMessage(com.google.logging.v2.LogEntry.parser(), extensionRegistry)); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + entries_ = java.util.Collections.unmodifiableList(entries_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListLogEntriesResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListLogEntriesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListLogEntriesResponse.class, com.google.logging.v2.ListLogEntriesResponse.Builder.class); + } + + private int bitField0_; + public static final int ENTRIES_FIELD_NUMBER = 1; + private java.util.List entries_; + /** + *
+   * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+   * returned, indicating that more entries may exist.  See `nextPageToken` for
+   * more information.
+   * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public java.util.List getEntriesList() { + return entries_; + } + /** + *
+   * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+   * returned, indicating that more entries may exist.  See `nextPageToken` for
+   * more information.
+   * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public java.util.List + getEntriesOrBuilderList() { + return entries_; + } + /** + *
+   * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+   * returned, indicating that more entries may exist.  See `nextPageToken` for
+   * more information.
+   * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public int getEntriesCount() { + return entries_.size(); + } + /** + *
+   * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+   * returned, indicating that more entries may exist.  See `nextPageToken` for
+   * more information.
+   * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public com.google.logging.v2.LogEntry getEntries(int index) { + return entries_.get(index); + } + /** + *
+   * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+   * returned, indicating that more entries may exist.  See `nextPageToken` for
+   * more information.
+   * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public com.google.logging.v2.LogEntryOrBuilder getEntriesOrBuilder( + int index) { + return entries_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + *
+   * If there might be more results than those appearing in this response, then
+   * `nextPageToken` is included.  To get the next set of results, call this
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * If a value for `next_page_token` appears and the `entries` field is empty,
+   * it means that the search found no log entries so far but it did not have
+   * time to search all the possible log entries.  Retry the method with this
+   * value for `page_token` to continue the search.  Alternatively, consider
+   * speeding up the search by changing your filter to specify a single log name
+   * or resource type, or to narrow the time range of the search.
+   * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + *
+   * If there might be more results than those appearing in this response, then
+   * `nextPageToken` is included.  To get the next set of results, call this
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * If a value for `next_page_token` appears and the `entries` field is empty,
+   * it means that the search found no log entries so far but it did not have
+   * time to search all the possible log entries.  Retry the method with this
+   * value for `page_token` to continue the search.  Alternatively, consider
+   * speeding up the search by changing your filter to specify a single log name
+   * or resource type, or to narrow the time range of the search.
+   * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < entries_.size(); i++) { + output.writeMessage(1, entries_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < entries_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, entries_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.logging.v2.ListLogEntriesResponse)) { + return super.equals(obj); + } + com.google.logging.v2.ListLogEntriesResponse other = (com.google.logging.v2.ListLogEntriesResponse) obj; + + boolean result = true; + result = result && getEntriesList() + .equals(other.getEntriesList()); + result = result && getNextPageToken() + .equals(other.getNextPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getEntriesCount() > 0) { + hash = (37 * hash) + ENTRIES_FIELD_NUMBER; + hash = (53 * hash) + getEntriesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.ListLogEntriesResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.ListLogEntriesResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.ListLogEntriesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.ListLogEntriesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.ListLogEntriesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.ListLogEntriesResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.ListLogEntriesResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.ListLogEntriesResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.ListLogEntriesResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.logging.v2.ListLogEntriesResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.ListLogEntriesResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.ListLogEntriesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.logging.v2.ListLogEntriesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Result returned from `ListLogEntries`.
+   * 
+ * + * Protobuf type {@code google.logging.v2.ListLogEntriesResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.ListLogEntriesResponse) + com.google.logging.v2.ListLogEntriesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListLogEntriesResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListLogEntriesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListLogEntriesResponse.class, com.google.logging.v2.ListLogEntriesResponse.Builder.class); + } + + // Construct using com.google.logging.v2.ListLogEntriesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getEntriesFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (entriesBuilder_ == null) { + entries_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + entriesBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListLogEntriesResponse_descriptor; + } + + public com.google.logging.v2.ListLogEntriesResponse getDefaultInstanceForType() { + return com.google.logging.v2.ListLogEntriesResponse.getDefaultInstance(); + } + + public com.google.logging.v2.ListLogEntriesResponse build() { + com.google.logging.v2.ListLogEntriesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.logging.v2.ListLogEntriesResponse buildPartial() { + com.google.logging.v2.ListLogEntriesResponse result = new com.google.logging.v2.ListLogEntriesResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (entriesBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + entries_ = java.util.Collections.unmodifiableList(entries_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.entries_ = entries_; + } else { + result.entries_ = entriesBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.logging.v2.ListLogEntriesResponse) { + return mergeFrom((com.google.logging.v2.ListLogEntriesResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.ListLogEntriesResponse other) { + if (other == com.google.logging.v2.ListLogEntriesResponse.getDefaultInstance()) return this; + if (entriesBuilder_ == null) { + if (!other.entries_.isEmpty()) { + if (entries_.isEmpty()) { + entries_ = other.entries_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureEntriesIsMutable(); + entries_.addAll(other.entries_); + } + onChanged(); + } + } else { + if (!other.entries_.isEmpty()) { + if (entriesBuilder_.isEmpty()) { + entriesBuilder_.dispose(); + entriesBuilder_ = null; + entries_ = other.entries_; + bitField0_ = (bitField0_ & ~0x00000001); + entriesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getEntriesFieldBuilder() : null; + } else { + entriesBuilder_.addAllMessages(other.entries_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.logging.v2.ListLogEntriesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.logging.v2.ListLogEntriesResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List entries_ = + java.util.Collections.emptyList(); + private void ensureEntriesIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + entries_ = new java.util.ArrayList(entries_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogEntry, com.google.logging.v2.LogEntry.Builder, com.google.logging.v2.LogEntryOrBuilder> entriesBuilder_; + + /** + *
+     * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+     * returned, indicating that more entries may exist.  See `nextPageToken` for
+     * more information.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public java.util.List getEntriesList() { + if (entriesBuilder_ == null) { + return java.util.Collections.unmodifiableList(entries_); + } else { + return entriesBuilder_.getMessageList(); + } + } + /** + *
+     * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+     * returned, indicating that more entries may exist.  See `nextPageToken` for
+     * more information.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public int getEntriesCount() { + if (entriesBuilder_ == null) { + return entries_.size(); + } else { + return entriesBuilder_.getCount(); + } + } + /** + *
+     * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+     * returned, indicating that more entries may exist.  See `nextPageToken` for
+     * more information.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public com.google.logging.v2.LogEntry getEntries(int index) { + if (entriesBuilder_ == null) { + return entries_.get(index); + } else { + return entriesBuilder_.getMessage(index); + } + } + /** + *
+     * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+     * returned, indicating that more entries may exist.  See `nextPageToken` for
+     * more information.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public Builder setEntries( + int index, com.google.logging.v2.LogEntry value) { + if (entriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntriesIsMutable(); + entries_.set(index, value); + onChanged(); + } else { + entriesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+     * returned, indicating that more entries may exist.  See `nextPageToken` for
+     * more information.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public Builder setEntries( + int index, com.google.logging.v2.LogEntry.Builder builderForValue) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.set(index, builderForValue.build()); + onChanged(); + } else { + entriesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+     * returned, indicating that more entries may exist.  See `nextPageToken` for
+     * more information.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public Builder addEntries(com.google.logging.v2.LogEntry value) { + if (entriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntriesIsMutable(); + entries_.add(value); + onChanged(); + } else { + entriesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+     * returned, indicating that more entries may exist.  See `nextPageToken` for
+     * more information.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public Builder addEntries( + int index, com.google.logging.v2.LogEntry value) { + if (entriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntriesIsMutable(); + entries_.add(index, value); + onChanged(); + } else { + entriesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+     * returned, indicating that more entries may exist.  See `nextPageToken` for
+     * more information.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public Builder addEntries( + com.google.logging.v2.LogEntry.Builder builderForValue) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.add(builderForValue.build()); + onChanged(); + } else { + entriesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+     * returned, indicating that more entries may exist.  See `nextPageToken` for
+     * more information.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public Builder addEntries( + int index, com.google.logging.v2.LogEntry.Builder builderForValue) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.add(index, builderForValue.build()); + onChanged(); + } else { + entriesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+     * returned, indicating that more entries may exist.  See `nextPageToken` for
+     * more information.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public Builder addAllEntries( + java.lang.Iterable values) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, entries_); + onChanged(); + } else { + entriesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+     * returned, indicating that more entries may exist.  See `nextPageToken` for
+     * more information.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public Builder clearEntries() { + if (entriesBuilder_ == null) { + entries_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + entriesBuilder_.clear(); + } + return this; + } + /** + *
+     * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+     * returned, indicating that more entries may exist.  See `nextPageToken` for
+     * more information.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public Builder removeEntries(int index) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.remove(index); + onChanged(); + } else { + entriesBuilder_.remove(index); + } + return this; + } + /** + *
+     * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+     * returned, indicating that more entries may exist.  See `nextPageToken` for
+     * more information.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public com.google.logging.v2.LogEntry.Builder getEntriesBuilder( + int index) { + return getEntriesFieldBuilder().getBuilder(index); + } + /** + *
+     * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+     * returned, indicating that more entries may exist.  See `nextPageToken` for
+     * more information.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public com.google.logging.v2.LogEntryOrBuilder getEntriesOrBuilder( + int index) { + if (entriesBuilder_ == null) { + return entries_.get(index); } else { + return entriesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+     * returned, indicating that more entries may exist.  See `nextPageToken` for
+     * more information.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public java.util.List + getEntriesOrBuilderList() { + if (entriesBuilder_ != null) { + return entriesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(entries_); + } + } + /** + *
+     * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+     * returned, indicating that more entries may exist.  See `nextPageToken` for
+     * more information.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public com.google.logging.v2.LogEntry.Builder addEntriesBuilder() { + return getEntriesFieldBuilder().addBuilder( + com.google.logging.v2.LogEntry.getDefaultInstance()); + } + /** + *
+     * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+     * returned, indicating that more entries may exist.  See `nextPageToken` for
+     * more information.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public com.google.logging.v2.LogEntry.Builder addEntriesBuilder( + int index) { + return getEntriesFieldBuilder().addBuilder( + index, com.google.logging.v2.LogEntry.getDefaultInstance()); + } + /** + *
+     * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+     * returned, indicating that more entries may exist.  See `nextPageToken` for
+     * more information.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public java.util.List + getEntriesBuilderList() { + return getEntriesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogEntry, com.google.logging.v2.LogEntry.Builder, com.google.logging.v2.LogEntryOrBuilder> + getEntriesFieldBuilder() { + if (entriesBuilder_ == null) { + entriesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogEntry, com.google.logging.v2.LogEntry.Builder, com.google.logging.v2.LogEntryOrBuilder>( + entries_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + entries_ = null; + } + return entriesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + *
+     * If there might be more results than those appearing in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call this
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * If a value for `next_page_token` appears and the `entries` field is empty,
+     * it means that the search found no log entries so far but it did not have
+     * time to search all the possible log entries.  Retry the method with this
+     * value for `page_token` to continue the search.  Alternatively, consider
+     * speeding up the search by changing your filter to specify a single log name
+     * or resource type, or to narrow the time range of the search.
+     * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * If there might be more results than those appearing in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call this
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * If a value for `next_page_token` appears and the `entries` field is empty,
+     * it means that the search found no log entries so far but it did not have
+     * time to search all the possible log entries.  Retry the method with this
+     * value for `page_token` to continue the search.  Alternatively, consider
+     * speeding up the search by changing your filter to specify a single log name
+     * or resource type, or to narrow the time range of the search.
+     * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * If there might be more results than those appearing in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call this
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * If a value for `next_page_token` appears and the `entries` field is empty,
+     * it means that the search found no log entries so far but it did not have
+     * time to search all the possible log entries.  Retry the method with this
+     * value for `page_token` to continue the search.  Alternatively, consider
+     * speeding up the search by changing your filter to specify a single log name
+     * or resource type, or to narrow the time range of the search.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * If there might be more results than those appearing in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call this
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * If a value for `next_page_token` appears and the `entries` field is empty,
+     * it means that the search found no log entries so far but it did not have
+     * time to search all the possible log entries.  Retry the method with this
+     * value for `page_token` to continue the search.  Alternatively, consider
+     * speeding up the search by changing your filter to specify a single log name
+     * or resource type, or to narrow the time range of the search.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + *
+     * If there might be more results than those appearing in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call this
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * If a value for `next_page_token` appears and the `entries` field is empty,
+     * it means that the search found no log entries so far but it did not have
+     * time to search all the possible log entries.  Retry the method with this
+     * value for `page_token` to continue the search.  Alternatively, consider
+     * speeding up the search by changing your filter to specify a single log name
+     * or resource type, or to narrow the time range of the search.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.logging.v2.ListLogEntriesResponse) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.ListLogEntriesResponse) + private static final com.google.logging.v2.ListLogEntriesResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.logging.v2.ListLogEntriesResponse(); + } + + public static com.google.logging.v2.ListLogEntriesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ListLogEntriesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListLogEntriesResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.logging.v2.ListLogEntriesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogEntriesResponseOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogEntriesResponseOrBuilder.java new file mode 100644 index 000000000000..02c75c9399ab --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogEntriesResponseOrBuilder.java @@ -0,0 +1,97 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging.proto + +package com.google.logging.v2; + +public interface ListLogEntriesResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.ListLogEntriesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+   * returned, indicating that more entries may exist.  See `nextPageToken` for
+   * more information.
+   * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + java.util.List + getEntriesList(); + /** + *
+   * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+   * returned, indicating that more entries may exist.  See `nextPageToken` for
+   * more information.
+   * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + com.google.logging.v2.LogEntry getEntries(int index); + /** + *
+   * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+   * returned, indicating that more entries may exist.  See `nextPageToken` for
+   * more information.
+   * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + int getEntriesCount(); + /** + *
+   * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+   * returned, indicating that more entries may exist.  See `nextPageToken` for
+   * more information.
+   * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + java.util.List + getEntriesOrBuilderList(); + /** + *
+   * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+   * returned, indicating that more entries may exist.  See `nextPageToken` for
+   * more information.
+   * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + com.google.logging.v2.LogEntryOrBuilder getEntriesOrBuilder( + int index); + + /** + *
+   * If there might be more results than those appearing in this response, then
+   * `nextPageToken` is included.  To get the next set of results, call this
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * If a value for `next_page_token` appears and the `entries` field is empty,
+   * it means that the search found no log entries so far but it did not have
+   * time to search all the possible log entries.  Retry the method with this
+   * value for `page_token` to continue the search.  Alternatively, consider
+   * speeding up the search by changing your filter to specify a single log name
+   * or resource type, or to narrow the time range of the search.
+   * 
+ * + * string next_page_token = 2; + */ + java.lang.String getNextPageToken(); + /** + *
+   * If there might be more results than those appearing in this response, then
+   * `nextPageToken` is included.  To get the next set of results, call this
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * If a value for `next_page_token` appears and the `entries` field is empty,
+   * it means that the search found no log entries so far but it did not have
+   * time to search all the possible log entries.  Retry the method with this
+   * value for `page_token` to continue the search.  Alternatively, consider
+   * speeding up the search by changing your filter to specify a single log name
+   * or resource type, or to narrow the time range of the search.
+   * 
+ * + * string next_page_token = 2; + */ + com.google.protobuf.ByteString + getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogMetricsRequest.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogMetricsRequest.java new file mode 100644 index 000000000000..527d5b5c013a --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogMetricsRequest.java @@ -0,0 +1,817 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_metrics.proto + +package com.google.logging.v2; + +/** + *
+ * The parameters to ListLogMetrics.
+ * 
+ * + * Protobuf type {@code google.logging.v2.ListLogMetricsRequest} + */ +public final class ListLogMetricsRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.logging.v2.ListLogMetricsRequest) + ListLogMetricsRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListLogMetricsRequest.newBuilder() to construct. + private ListLogMetricsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListLogMetricsRequest() { + parent_ = ""; + pageToken_ = ""; + pageSize_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListLogMetricsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 24: { + + pageSize_ = input.readInt32(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingMetricsProto.internal_static_google_logging_v2_ListLogMetricsRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingMetricsProto.internal_static_google_logging_v2_ListLogMetricsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListLogMetricsRequest.class, com.google.logging.v2.ListLogMetricsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * Required. The name of the project containing the metrics:
+   *     "projects/[PROJECT_ID]"
+   * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + *
+   * Required. The name of the project containing the metrics:
+   *     "projects/[PROJECT_ID]"
+   * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object pageToken_; + /** + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method.  `pageToken` must be the value of
+   * `nextPageToken` from the previous response.  The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method.  `pageToken` must be the value of
+   * `nextPageToken` from the previous response.  The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2; + */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_; + /** + *
+   * Optional. The maximum number of results to return from this request.
+   * Non-positive values are ignored.  The presence of `nextPageToken` in the
+   * response indicates that more results might be available.
+   * 
+ * + * int32 page_size = 3; + */ + public int getPageSize() { + return pageSize_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pageToken_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, pageToken_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, pageSize_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.logging.v2.ListLogMetricsRequest)) { + return super.equals(obj); + } + com.google.logging.v2.ListLogMetricsRequest other = (com.google.logging.v2.ListLogMetricsRequest) obj; + + boolean result = true; + result = result && getParent() + .equals(other.getParent()); + result = result && getPageToken() + .equals(other.getPageToken()); + result = result && (getPageSize() + == other.getPageSize()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.ListLogMetricsRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.ListLogMetricsRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.ListLogMetricsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.ListLogMetricsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.ListLogMetricsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.ListLogMetricsRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.ListLogMetricsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.ListLogMetricsRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.ListLogMetricsRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.logging.v2.ListLogMetricsRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.ListLogMetricsRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.ListLogMetricsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.logging.v2.ListLogMetricsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * The parameters to ListLogMetrics.
+   * 
+ * + * Protobuf type {@code google.logging.v2.ListLogMetricsRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.ListLogMetricsRequest) + com.google.logging.v2.ListLogMetricsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingMetricsProto.internal_static_google_logging_v2_ListLogMetricsRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingMetricsProto.internal_static_google_logging_v2_ListLogMetricsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListLogMetricsRequest.class, com.google.logging.v2.ListLogMetricsRequest.Builder.class); + } + + // Construct using com.google.logging.v2.ListLogMetricsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + parent_ = ""; + + pageToken_ = ""; + + pageSize_ = 0; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.logging.v2.LoggingMetricsProto.internal_static_google_logging_v2_ListLogMetricsRequest_descriptor; + } + + public com.google.logging.v2.ListLogMetricsRequest getDefaultInstanceForType() { + return com.google.logging.v2.ListLogMetricsRequest.getDefaultInstance(); + } + + public com.google.logging.v2.ListLogMetricsRequest build() { + com.google.logging.v2.ListLogMetricsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.logging.v2.ListLogMetricsRequest buildPartial() { + com.google.logging.v2.ListLogMetricsRequest result = new com.google.logging.v2.ListLogMetricsRequest(this); + result.parent_ = parent_; + result.pageToken_ = pageToken_; + result.pageSize_ = pageSize_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.logging.v2.ListLogMetricsRequest) { + return mergeFrom((com.google.logging.v2.ListLogMetricsRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.ListLogMetricsRequest other) { + if (other == com.google.logging.v2.ListLogMetricsRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.logging.v2.ListLogMetricsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.logging.v2.ListLogMetricsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+     * Required. The name of the project containing the metrics:
+     *     "projects/[PROJECT_ID]"
+     * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The name of the project containing the metrics:
+     *     "projects/[PROJECT_ID]"
+     * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The name of the project containing the metrics:
+     *     "projects/[PROJECT_ID]"
+     * 
+ * + * string parent = 1; + */ + public Builder setParent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The name of the project containing the metrics:
+     *     "projects/[PROJECT_ID]"
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+     * Required. The name of the project containing the metrics:
+     *     "projects/[PROJECT_ID]"
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `pageToken` must be the value of
+     * `nextPageToken` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `pageToken` must be the value of
+     * `nextPageToken` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2; + */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `pageToken` must be the value of
+     * `nextPageToken` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2; + */ + public Builder setPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `pageToken` must be the value of
+     * `nextPageToken` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2; + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `pageToken` must be the value of
+     * `nextPageToken` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2; + */ + public Builder setPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private int pageSize_ ; + /** + *
+     * Optional. The maximum number of results to return from this request.
+     * Non-positive values are ignored.  The presence of `nextPageToken` in the
+     * response indicates that more results might be available.
+     * 
+ * + * int32 page_size = 3; + */ + public int getPageSize() { + return pageSize_; + } + /** + *
+     * Optional. The maximum number of results to return from this request.
+     * Non-positive values are ignored.  The presence of `nextPageToken` in the
+     * response indicates that more results might be available.
+     * 
+ * + * int32 page_size = 3; + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. The maximum number of results to return from this request.
+     * Non-positive values are ignored.  The presence of `nextPageToken` in the
+     * response indicates that more results might be available.
+     * 
+ * + * int32 page_size = 3; + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.logging.v2.ListLogMetricsRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.ListLogMetricsRequest) + private static final com.google.logging.v2.ListLogMetricsRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.logging.v2.ListLogMetricsRequest(); + } + + public static com.google.logging.v2.ListLogMetricsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ListLogMetricsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListLogMetricsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.logging.v2.ListLogMetricsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogMetricsRequestOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogMetricsRequestOrBuilder.java new file mode 100644 index 000000000000..cdfbb89c56e2 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogMetricsRequestOrBuilder.java @@ -0,0 +1,64 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_metrics.proto + +package com.google.logging.v2; + +public interface ListLogMetricsRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.ListLogMetricsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The name of the project containing the metrics:
+   *     "projects/[PROJECT_ID]"
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + *
+   * Required. The name of the project containing the metrics:
+   *     "projects/[PROJECT_ID]"
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method.  `pageToken` must be the value of
+   * `nextPageToken` from the previous response.  The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2; + */ + java.lang.String getPageToken(); + /** + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method.  `pageToken` must be the value of
+   * `nextPageToken` from the previous response.  The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2; + */ + com.google.protobuf.ByteString + getPageTokenBytes(); + + /** + *
+   * Optional. The maximum number of results to return from this request.
+   * Non-positive values are ignored.  The presence of `nextPageToken` in the
+   * response indicates that more results might be available.
+   * 
+ * + * int32 page_size = 3; + */ + int getPageSize(); +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogMetricsResponse.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogMetricsResponse.java new file mode 100644 index 000000000000..f697b3b9278c --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogMetricsResponse.java @@ -0,0 +1,1006 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_metrics.proto + +package com.google.logging.v2; + +/** + *
+ * Result returned from ListLogMetrics.
+ * 
+ * + * Protobuf type {@code google.logging.v2.ListLogMetricsResponse} + */ +public final class ListLogMetricsResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.logging.v2.ListLogMetricsResponse) + ListLogMetricsResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListLogMetricsResponse.newBuilder() to construct. + private ListLogMetricsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListLogMetricsResponse() { + metrics_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListLogMetricsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + metrics_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + metrics_.add( + input.readMessage(com.google.logging.v2.LogMetric.parser(), extensionRegistry)); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + metrics_ = java.util.Collections.unmodifiableList(metrics_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingMetricsProto.internal_static_google_logging_v2_ListLogMetricsResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingMetricsProto.internal_static_google_logging_v2_ListLogMetricsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListLogMetricsResponse.class, com.google.logging.v2.ListLogMetricsResponse.Builder.class); + } + + private int bitField0_; + public static final int METRICS_FIELD_NUMBER = 1; + private java.util.List metrics_; + /** + *
+   * A list of logs-based metrics.
+   * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + public java.util.List getMetricsList() { + return metrics_; + } + /** + *
+   * A list of logs-based metrics.
+   * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + public java.util.List + getMetricsOrBuilderList() { + return metrics_; + } + /** + *
+   * A list of logs-based metrics.
+   * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + public int getMetricsCount() { + return metrics_.size(); + } + /** + *
+   * A list of logs-based metrics.
+   * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + public com.google.logging.v2.LogMetric getMetrics(int index) { + return metrics_.get(index); + } + /** + *
+   * A list of logs-based metrics.
+   * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + public com.google.logging.v2.LogMetricOrBuilder getMetricsOrBuilder( + int index) { + return metrics_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + *
+   * If there might be more results than appear in this response, then
+   * `nextPageToken` is included.  To get the next set of results, call this
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + *
+   * If there might be more results than appear in this response, then
+   * `nextPageToken` is included.  To get the next set of results, call this
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < metrics_.size(); i++) { + output.writeMessage(1, metrics_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < metrics_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, metrics_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.logging.v2.ListLogMetricsResponse)) { + return super.equals(obj); + } + com.google.logging.v2.ListLogMetricsResponse other = (com.google.logging.v2.ListLogMetricsResponse) obj; + + boolean result = true; + result = result && getMetricsList() + .equals(other.getMetricsList()); + result = result && getNextPageToken() + .equals(other.getNextPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getMetricsCount() > 0) { + hash = (37 * hash) + METRICS_FIELD_NUMBER; + hash = (53 * hash) + getMetricsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.ListLogMetricsResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.ListLogMetricsResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.ListLogMetricsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.ListLogMetricsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.ListLogMetricsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.ListLogMetricsResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.ListLogMetricsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.ListLogMetricsResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.ListLogMetricsResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.logging.v2.ListLogMetricsResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.ListLogMetricsResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.ListLogMetricsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.logging.v2.ListLogMetricsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Result returned from ListLogMetrics.
+   * 
+ * + * Protobuf type {@code google.logging.v2.ListLogMetricsResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.ListLogMetricsResponse) + com.google.logging.v2.ListLogMetricsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingMetricsProto.internal_static_google_logging_v2_ListLogMetricsResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingMetricsProto.internal_static_google_logging_v2_ListLogMetricsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListLogMetricsResponse.class, com.google.logging.v2.ListLogMetricsResponse.Builder.class); + } + + // Construct using com.google.logging.v2.ListLogMetricsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getMetricsFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (metricsBuilder_ == null) { + metrics_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + metricsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.logging.v2.LoggingMetricsProto.internal_static_google_logging_v2_ListLogMetricsResponse_descriptor; + } + + public com.google.logging.v2.ListLogMetricsResponse getDefaultInstanceForType() { + return com.google.logging.v2.ListLogMetricsResponse.getDefaultInstance(); + } + + public com.google.logging.v2.ListLogMetricsResponse build() { + com.google.logging.v2.ListLogMetricsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.logging.v2.ListLogMetricsResponse buildPartial() { + com.google.logging.v2.ListLogMetricsResponse result = new com.google.logging.v2.ListLogMetricsResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (metricsBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + metrics_ = java.util.Collections.unmodifiableList(metrics_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.metrics_ = metrics_; + } else { + result.metrics_ = metricsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.logging.v2.ListLogMetricsResponse) { + return mergeFrom((com.google.logging.v2.ListLogMetricsResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.ListLogMetricsResponse other) { + if (other == com.google.logging.v2.ListLogMetricsResponse.getDefaultInstance()) return this; + if (metricsBuilder_ == null) { + if (!other.metrics_.isEmpty()) { + if (metrics_.isEmpty()) { + metrics_ = other.metrics_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureMetricsIsMutable(); + metrics_.addAll(other.metrics_); + } + onChanged(); + } + } else { + if (!other.metrics_.isEmpty()) { + if (metricsBuilder_.isEmpty()) { + metricsBuilder_.dispose(); + metricsBuilder_ = null; + metrics_ = other.metrics_; + bitField0_ = (bitField0_ & ~0x00000001); + metricsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getMetricsFieldBuilder() : null; + } else { + metricsBuilder_.addAllMessages(other.metrics_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.logging.v2.ListLogMetricsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.logging.v2.ListLogMetricsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List metrics_ = + java.util.Collections.emptyList(); + private void ensureMetricsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + metrics_ = new java.util.ArrayList(metrics_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogMetric, com.google.logging.v2.LogMetric.Builder, com.google.logging.v2.LogMetricOrBuilder> metricsBuilder_; + + /** + *
+     * A list of logs-based metrics.
+     * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + public java.util.List getMetricsList() { + if (metricsBuilder_ == null) { + return java.util.Collections.unmodifiableList(metrics_); + } else { + return metricsBuilder_.getMessageList(); + } + } + /** + *
+     * A list of logs-based metrics.
+     * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + public int getMetricsCount() { + if (metricsBuilder_ == null) { + return metrics_.size(); + } else { + return metricsBuilder_.getCount(); + } + } + /** + *
+     * A list of logs-based metrics.
+     * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + public com.google.logging.v2.LogMetric getMetrics(int index) { + if (metricsBuilder_ == null) { + return metrics_.get(index); + } else { + return metricsBuilder_.getMessage(index); + } + } + /** + *
+     * A list of logs-based metrics.
+     * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + public Builder setMetrics( + int index, com.google.logging.v2.LogMetric value) { + if (metricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMetricsIsMutable(); + metrics_.set(index, value); + onChanged(); + } else { + metricsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * A list of logs-based metrics.
+     * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + public Builder setMetrics( + int index, com.google.logging.v2.LogMetric.Builder builderForValue) { + if (metricsBuilder_ == null) { + ensureMetricsIsMutable(); + metrics_.set(index, builderForValue.build()); + onChanged(); + } else { + metricsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A list of logs-based metrics.
+     * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + public Builder addMetrics(com.google.logging.v2.LogMetric value) { + if (metricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMetricsIsMutable(); + metrics_.add(value); + onChanged(); + } else { + metricsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * A list of logs-based metrics.
+     * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + public Builder addMetrics( + int index, com.google.logging.v2.LogMetric value) { + if (metricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMetricsIsMutable(); + metrics_.add(index, value); + onChanged(); + } else { + metricsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * A list of logs-based metrics.
+     * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + public Builder addMetrics( + com.google.logging.v2.LogMetric.Builder builderForValue) { + if (metricsBuilder_ == null) { + ensureMetricsIsMutable(); + metrics_.add(builderForValue.build()); + onChanged(); + } else { + metricsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * A list of logs-based metrics.
+     * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + public Builder addMetrics( + int index, com.google.logging.v2.LogMetric.Builder builderForValue) { + if (metricsBuilder_ == null) { + ensureMetricsIsMutable(); + metrics_.add(index, builderForValue.build()); + onChanged(); + } else { + metricsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A list of logs-based metrics.
+     * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + public Builder addAllMetrics( + java.lang.Iterable values) { + if (metricsBuilder_ == null) { + ensureMetricsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, metrics_); + onChanged(); + } else { + metricsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * A list of logs-based metrics.
+     * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + public Builder clearMetrics() { + if (metricsBuilder_ == null) { + metrics_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + metricsBuilder_.clear(); + } + return this; + } + /** + *
+     * A list of logs-based metrics.
+     * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + public Builder removeMetrics(int index) { + if (metricsBuilder_ == null) { + ensureMetricsIsMutable(); + metrics_.remove(index); + onChanged(); + } else { + metricsBuilder_.remove(index); + } + return this; + } + /** + *
+     * A list of logs-based metrics.
+     * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + public com.google.logging.v2.LogMetric.Builder getMetricsBuilder( + int index) { + return getMetricsFieldBuilder().getBuilder(index); + } + /** + *
+     * A list of logs-based metrics.
+     * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + public com.google.logging.v2.LogMetricOrBuilder getMetricsOrBuilder( + int index) { + if (metricsBuilder_ == null) { + return metrics_.get(index); } else { + return metricsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * A list of logs-based metrics.
+     * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + public java.util.List + getMetricsOrBuilderList() { + if (metricsBuilder_ != null) { + return metricsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(metrics_); + } + } + /** + *
+     * A list of logs-based metrics.
+     * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + public com.google.logging.v2.LogMetric.Builder addMetricsBuilder() { + return getMetricsFieldBuilder().addBuilder( + com.google.logging.v2.LogMetric.getDefaultInstance()); + } + /** + *
+     * A list of logs-based metrics.
+     * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + public com.google.logging.v2.LogMetric.Builder addMetricsBuilder( + int index) { + return getMetricsFieldBuilder().addBuilder( + index, com.google.logging.v2.LogMetric.getDefaultInstance()); + } + /** + *
+     * A list of logs-based metrics.
+     * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + public java.util.List + getMetricsBuilderList() { + return getMetricsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogMetric, com.google.logging.v2.LogMetric.Builder, com.google.logging.v2.LogMetricOrBuilder> + getMetricsFieldBuilder() { + if (metricsBuilder_ == null) { + metricsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogMetric, com.google.logging.v2.LogMetric.Builder, com.google.logging.v2.LogMetricOrBuilder>( + metrics_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + metrics_ = null; + } + return metricsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call this
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call this
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call this
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call this
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call this
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.logging.v2.ListLogMetricsResponse) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.ListLogMetricsResponse) + private static final com.google.logging.v2.ListLogMetricsResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.logging.v2.ListLogMetricsResponse(); + } + + public static com.google.logging.v2.ListLogMetricsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ListLogMetricsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListLogMetricsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.logging.v2.ListLogMetricsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogMetricsResponseOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogMetricsResponseOrBuilder.java new file mode 100644 index 000000000000..0497e2a2ae4f --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogMetricsResponseOrBuilder.java @@ -0,0 +1,75 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_metrics.proto + +package com.google.logging.v2; + +public interface ListLogMetricsResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.ListLogMetricsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * A list of logs-based metrics.
+   * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + java.util.List + getMetricsList(); + /** + *
+   * A list of logs-based metrics.
+   * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + com.google.logging.v2.LogMetric getMetrics(int index); + /** + *
+   * A list of logs-based metrics.
+   * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + int getMetricsCount(); + /** + *
+   * A list of logs-based metrics.
+   * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + java.util.List + getMetricsOrBuilderList(); + /** + *
+   * A list of logs-based metrics.
+   * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + com.google.logging.v2.LogMetricOrBuilder getMetricsOrBuilder( + int index); + + /** + *
+   * If there might be more results than appear in this response, then
+   * `nextPageToken` is included.  To get the next set of results, call this
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + */ + java.lang.String getNextPageToken(); + /** + *
+   * If there might be more results than appear in this response, then
+   * `nextPageToken` is included.  To get the next set of results, call this
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + */ + com.google.protobuf.ByteString + getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogsRequest.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogsRequest.java new file mode 100644 index 000000000000..8fee36c9a7b1 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogsRequest.java @@ -0,0 +1,838 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging.proto + +package com.google.logging.v2; + +/** + *
+ * The parameters to ListLogs.
+ * 
+ * + * Protobuf type {@code google.logging.v2.ListLogsRequest} + */ +public final class ListLogsRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.logging.v2.ListLogsRequest) + ListLogsRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListLogsRequest.newBuilder() to construct. + private ListLogsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListLogsRequest() { + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListLogsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: { + + pageSize_ = input.readInt32(); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListLogsRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListLogsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListLogsRequest.class, com.google.logging.v2.ListLogsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * Required. The resource name that owns the logs:
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + *
+   * Required. The resource name that owns the logs:
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + *
+   * Optional. The maximum number of results to return from this request.
+   * Non-positive values are ignored.  The presence of `nextPageToken` in the
+   * response indicates that more results might be available.
+   * 
+ * + * int32 page_size = 2; + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method.  `pageToken` must be the value of
+   * `nextPageToken` from the previous response.  The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 3; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method.  `pageToken` must be the value of
+   * `nextPageToken` from the previous response.  The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 3; + */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.logging.v2.ListLogsRequest)) { + return super.equals(obj); + } + com.google.logging.v2.ListLogsRequest other = (com.google.logging.v2.ListLogsRequest) obj; + + boolean result = true; + result = result && getParent() + .equals(other.getParent()); + result = result && (getPageSize() + == other.getPageSize()); + result = result && getPageToken() + .equals(other.getPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.ListLogsRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.ListLogsRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.ListLogsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.ListLogsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.ListLogsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.ListLogsRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.ListLogsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.ListLogsRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.ListLogsRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.logging.v2.ListLogsRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.ListLogsRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.ListLogsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.logging.v2.ListLogsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * The parameters to ListLogs.
+   * 
+ * + * Protobuf type {@code google.logging.v2.ListLogsRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.ListLogsRequest) + com.google.logging.v2.ListLogsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListLogsRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListLogsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListLogsRequest.class, com.google.logging.v2.ListLogsRequest.Builder.class); + } + + // Construct using com.google.logging.v2.ListLogsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListLogsRequest_descriptor; + } + + public com.google.logging.v2.ListLogsRequest getDefaultInstanceForType() { + return com.google.logging.v2.ListLogsRequest.getDefaultInstance(); + } + + public com.google.logging.v2.ListLogsRequest build() { + com.google.logging.v2.ListLogsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.logging.v2.ListLogsRequest buildPartial() { + com.google.logging.v2.ListLogsRequest result = new com.google.logging.v2.ListLogsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.logging.v2.ListLogsRequest) { + return mergeFrom((com.google.logging.v2.ListLogsRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.ListLogsRequest other) { + if (other == com.google.logging.v2.ListLogsRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.logging.v2.ListLogsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.logging.v2.ListLogsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+     * Required. The resource name that owns the logs:
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The resource name that owns the logs:
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The resource name that owns the logs:
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * 
+ * + * string parent = 1; + */ + public Builder setParent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The resource name that owns the logs:
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+     * Required. The resource name that owns the logs:
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_ ; + /** + *
+     * Optional. The maximum number of results to return from this request.
+     * Non-positive values are ignored.  The presence of `nextPageToken` in the
+     * response indicates that more results might be available.
+     * 
+ * + * int32 page_size = 2; + */ + public int getPageSize() { + return pageSize_; + } + /** + *
+     * Optional. The maximum number of results to return from this request.
+     * Non-positive values are ignored.  The presence of `nextPageToken` in the
+     * response indicates that more results might be available.
+     * 
+ * + * int32 page_size = 2; + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. The maximum number of results to return from this request.
+     * Non-positive values are ignored.  The presence of `nextPageToken` in the
+     * response indicates that more results might be available.
+     * 
+ * + * int32 page_size = 2; + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `pageToken` must be the value of
+     * `nextPageToken` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 3; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `pageToken` must be the value of
+     * `nextPageToken` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 3; + */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `pageToken` must be the value of
+     * `nextPageToken` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 3; + */ + public Builder setPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `pageToken` must be the value of
+     * `nextPageToken` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 3; + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `pageToken` must be the value of
+     * `nextPageToken` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 3; + */ + public Builder setPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.logging.v2.ListLogsRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.ListLogsRequest) + private static final com.google.logging.v2.ListLogsRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.logging.v2.ListLogsRequest(); + } + + public static com.google.logging.v2.ListLogsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ListLogsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListLogsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.logging.v2.ListLogsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogsRequestOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogsRequestOrBuilder.java new file mode 100644 index 000000000000..4cddfe75e4ca --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogsRequestOrBuilder.java @@ -0,0 +1,70 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging.proto + +package com.google.logging.v2; + +public interface ListLogsRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.ListLogsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The resource name that owns the logs:
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + *
+   * Required. The resource name that owns the logs:
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * Optional. The maximum number of results to return from this request.
+   * Non-positive values are ignored.  The presence of `nextPageToken` in the
+   * response indicates that more results might be available.
+   * 
+ * + * int32 page_size = 2; + */ + int getPageSize(); + + /** + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method.  `pageToken` must be the value of
+   * `nextPageToken` from the previous response.  The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 3; + */ + java.lang.String getPageToken(); + /** + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method.  `pageToken` must be the value of
+   * `nextPageToken` from the previous response.  The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 3; + */ + com.google.protobuf.ByteString + getPageTokenBytes(); +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogsResponse.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogsResponse.java new file mode 100644 index 000000000000..6cd4fdf42a78 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogsResponse.java @@ -0,0 +1,819 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging.proto + +package com.google.logging.v2; + +/** + *
+ * Result returned from ListLogs.
+ * 
+ * + * Protobuf type {@code google.logging.v2.ListLogsResponse} + */ +public final class ListLogsResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.logging.v2.ListLogsResponse) + ListLogsResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListLogsResponse.newBuilder() to construct. + private ListLogsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListLogsResponse() { + logNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; + nextPageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListLogsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + logNames_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + logNames_.add(s); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + logNames_ = logNames_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListLogsResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListLogsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListLogsResponse.class, com.google.logging.v2.ListLogsResponse.Builder.class); + } + + private int bitField0_; + public static final int LOG_NAMES_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList logNames_; + /** + *
+   * A list of log names. For example,
+   * `"projects/my-project/syslog"` or
+   * `"organizations/123/cloudresourcemanager.googleapis.com%2Factivity"`.
+   * 
+ * + * repeated string log_names = 3; + */ + public com.google.protobuf.ProtocolStringList + getLogNamesList() { + return logNames_; + } + /** + *
+   * A list of log names. For example,
+   * `"projects/my-project/syslog"` or
+   * `"organizations/123/cloudresourcemanager.googleapis.com%2Factivity"`.
+   * 
+ * + * repeated string log_names = 3; + */ + public int getLogNamesCount() { + return logNames_.size(); + } + /** + *
+   * A list of log names. For example,
+   * `"projects/my-project/syslog"` or
+   * `"organizations/123/cloudresourcemanager.googleapis.com%2Factivity"`.
+   * 
+ * + * repeated string log_names = 3; + */ + public java.lang.String getLogNames(int index) { + return logNames_.get(index); + } + /** + *
+   * A list of log names. For example,
+   * `"projects/my-project/syslog"` or
+   * `"organizations/123/cloudresourcemanager.googleapis.com%2Factivity"`.
+   * 
+ * + * repeated string log_names = 3; + */ + public com.google.protobuf.ByteString + getLogNamesBytes(int index) { + return logNames_.getByteString(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + *
+   * If there might be more results than those appearing in this response, then
+   * `nextPageToken` is included.  To get the next set of results, call this
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + *
+   * If there might be more results than those appearing in this response, then
+   * `nextPageToken` is included.  To get the next set of results, call this
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < logNames_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, logNames_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < logNames_.size(); i++) { + dataSize += computeStringSizeNoTag(logNames_.getRaw(i)); + } + size += dataSize; + size += 1 * getLogNamesList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.logging.v2.ListLogsResponse)) { + return super.equals(obj); + } + com.google.logging.v2.ListLogsResponse other = (com.google.logging.v2.ListLogsResponse) obj; + + boolean result = true; + result = result && getLogNamesList() + .equals(other.getLogNamesList()); + result = result && getNextPageToken() + .equals(other.getNextPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getLogNamesCount() > 0) { + hash = (37 * hash) + LOG_NAMES_FIELD_NUMBER; + hash = (53 * hash) + getLogNamesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.ListLogsResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.ListLogsResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.ListLogsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.ListLogsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.ListLogsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.ListLogsResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.ListLogsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.ListLogsResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.ListLogsResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.logging.v2.ListLogsResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.ListLogsResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.ListLogsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.logging.v2.ListLogsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Result returned from ListLogs.
+   * 
+ * + * Protobuf type {@code google.logging.v2.ListLogsResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.ListLogsResponse) + com.google.logging.v2.ListLogsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListLogsResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListLogsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListLogsResponse.class, com.google.logging.v2.ListLogsResponse.Builder.class); + } + + // Construct using com.google.logging.v2.ListLogsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + logNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListLogsResponse_descriptor; + } + + public com.google.logging.v2.ListLogsResponse getDefaultInstanceForType() { + return com.google.logging.v2.ListLogsResponse.getDefaultInstance(); + } + + public com.google.logging.v2.ListLogsResponse build() { + com.google.logging.v2.ListLogsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.logging.v2.ListLogsResponse buildPartial() { + com.google.logging.v2.ListLogsResponse result = new com.google.logging.v2.ListLogsResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + logNames_ = logNames_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.logNames_ = logNames_; + result.nextPageToken_ = nextPageToken_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.logging.v2.ListLogsResponse) { + return mergeFrom((com.google.logging.v2.ListLogsResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.ListLogsResponse other) { + if (other == com.google.logging.v2.ListLogsResponse.getDefaultInstance()) return this; + if (!other.logNames_.isEmpty()) { + if (logNames_.isEmpty()) { + logNames_ = other.logNames_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureLogNamesIsMutable(); + logNames_.addAll(other.logNames_); + } + onChanged(); + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.logging.v2.ListLogsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.logging.v2.ListLogsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.LazyStringList logNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureLogNamesIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + logNames_ = new com.google.protobuf.LazyStringArrayList(logNames_); + bitField0_ |= 0x00000001; + } + } + /** + *
+     * A list of log names. For example,
+     * `"projects/my-project/syslog"` or
+     * `"organizations/123/cloudresourcemanager.googleapis.com%2Factivity"`.
+     * 
+ * + * repeated string log_names = 3; + */ + public com.google.protobuf.ProtocolStringList + getLogNamesList() { + return logNames_.getUnmodifiableView(); + } + /** + *
+     * A list of log names. For example,
+     * `"projects/my-project/syslog"` or
+     * `"organizations/123/cloudresourcemanager.googleapis.com%2Factivity"`.
+     * 
+ * + * repeated string log_names = 3; + */ + public int getLogNamesCount() { + return logNames_.size(); + } + /** + *
+     * A list of log names. For example,
+     * `"projects/my-project/syslog"` or
+     * `"organizations/123/cloudresourcemanager.googleapis.com%2Factivity"`.
+     * 
+ * + * repeated string log_names = 3; + */ + public java.lang.String getLogNames(int index) { + return logNames_.get(index); + } + /** + *
+     * A list of log names. For example,
+     * `"projects/my-project/syslog"` or
+     * `"organizations/123/cloudresourcemanager.googleapis.com%2Factivity"`.
+     * 
+ * + * repeated string log_names = 3; + */ + public com.google.protobuf.ByteString + getLogNamesBytes(int index) { + return logNames_.getByteString(index); + } + /** + *
+     * A list of log names. For example,
+     * `"projects/my-project/syslog"` or
+     * `"organizations/123/cloudresourcemanager.googleapis.com%2Factivity"`.
+     * 
+ * + * repeated string log_names = 3; + */ + public Builder setLogNames( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureLogNamesIsMutable(); + logNames_.set(index, value); + onChanged(); + return this; + } + /** + *
+     * A list of log names. For example,
+     * `"projects/my-project/syslog"` or
+     * `"organizations/123/cloudresourcemanager.googleapis.com%2Factivity"`.
+     * 
+ * + * repeated string log_names = 3; + */ + public Builder addLogNames( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureLogNamesIsMutable(); + logNames_.add(value); + onChanged(); + return this; + } + /** + *
+     * A list of log names. For example,
+     * `"projects/my-project/syslog"` or
+     * `"organizations/123/cloudresourcemanager.googleapis.com%2Factivity"`.
+     * 
+ * + * repeated string log_names = 3; + */ + public Builder addAllLogNames( + java.lang.Iterable values) { + ensureLogNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, logNames_); + onChanged(); + return this; + } + /** + *
+     * A list of log names. For example,
+     * `"projects/my-project/syslog"` or
+     * `"organizations/123/cloudresourcemanager.googleapis.com%2Factivity"`.
+     * 
+ * + * repeated string log_names = 3; + */ + public Builder clearLogNames() { + logNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+     * A list of log names. For example,
+     * `"projects/my-project/syslog"` or
+     * `"organizations/123/cloudresourcemanager.googleapis.com%2Factivity"`.
+     * 
+ * + * repeated string log_names = 3; + */ + public Builder addLogNamesBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureLogNamesIsMutable(); + logNames_.add(value); + onChanged(); + return this; + } + + private java.lang.Object nextPageToken_ = ""; + /** + *
+     * If there might be more results than those appearing in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call this
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * If there might be more results than those appearing in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call this
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * If there might be more results than those appearing in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call this
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * If there might be more results than those appearing in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call this
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + *
+     * If there might be more results than those appearing in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call this
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.logging.v2.ListLogsResponse) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.ListLogsResponse) + private static final com.google.logging.v2.ListLogsResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.logging.v2.ListLogsResponse(); + } + + public static com.google.logging.v2.ListLogsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ListLogsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListLogsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.logging.v2.ListLogsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogsResponseOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogsResponseOrBuilder.java new file mode 100644 index 000000000000..ef0e8b7d8dfb --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogsResponseOrBuilder.java @@ -0,0 +1,74 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging.proto + +package com.google.logging.v2; + +public interface ListLogsResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.ListLogsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * A list of log names. For example,
+   * `"projects/my-project/syslog"` or
+   * `"organizations/123/cloudresourcemanager.googleapis.com%2Factivity"`.
+   * 
+ * + * repeated string log_names = 3; + */ + java.util.List + getLogNamesList(); + /** + *
+   * A list of log names. For example,
+   * `"projects/my-project/syslog"` or
+   * `"organizations/123/cloudresourcemanager.googleapis.com%2Factivity"`.
+   * 
+ * + * repeated string log_names = 3; + */ + int getLogNamesCount(); + /** + *
+   * A list of log names. For example,
+   * `"projects/my-project/syslog"` or
+   * `"organizations/123/cloudresourcemanager.googleapis.com%2Factivity"`.
+   * 
+ * + * repeated string log_names = 3; + */ + java.lang.String getLogNames(int index); + /** + *
+   * A list of log names. For example,
+   * `"projects/my-project/syslog"` or
+   * `"organizations/123/cloudresourcemanager.googleapis.com%2Factivity"`.
+   * 
+ * + * repeated string log_names = 3; + */ + com.google.protobuf.ByteString + getLogNamesBytes(int index); + + /** + *
+   * If there might be more results than those appearing in this response, then
+   * `nextPageToken` is included.  To get the next set of results, call this
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + */ + java.lang.String getNextPageToken(); + /** + *
+   * If there might be more results than those appearing in this response, then
+   * `nextPageToken` is included.  To get the next set of results, call this
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + */ + com.google.protobuf.ByteString + getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsRequest.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsRequest.java new file mode 100644 index 000000000000..361f9f3b4f5a --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsRequest.java @@ -0,0 +1,655 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging.proto + +package com.google.logging.v2; + +/** + *
+ * The parameters to ListMonitoredResourceDescriptors
+ * 
+ * + * Protobuf type {@code google.logging.v2.ListMonitoredResourceDescriptorsRequest} + */ +public final class ListMonitoredResourceDescriptorsRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.logging.v2.ListMonitoredResourceDescriptorsRequest) + ListMonitoredResourceDescriptorsRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListMonitoredResourceDescriptorsRequest.newBuilder() to construct. + private ListMonitoredResourceDescriptorsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListMonitoredResourceDescriptorsRequest() { + pageSize_ = 0; + pageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListMonitoredResourceDescriptorsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + pageSize_ = input.readInt32(); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListMonitoredResourceDescriptorsRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListMonitoredResourceDescriptorsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListMonitoredResourceDescriptorsRequest.class, com.google.logging.v2.ListMonitoredResourceDescriptorsRequest.Builder.class); + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 1; + private int pageSize_; + /** + *
+   * Optional. The maximum number of results to return from this request.
+   * Non-positive values are ignored.  The presence of `nextPageToken` in the
+   * response indicates that more results might be available.
+   * 
+ * + * int32 page_size = 1; + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object pageToken_; + /** + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method.  `pageToken` must be the value of
+   * `nextPageToken` from the previous response.  The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method.  `pageToken` must be the value of
+   * `nextPageToken` from the previous response.  The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2; + */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (pageSize_ != 0) { + output.writeInt32(1, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pageToken_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.logging.v2.ListMonitoredResourceDescriptorsRequest)) { + return super.equals(obj); + } + com.google.logging.v2.ListMonitoredResourceDescriptorsRequest other = (com.google.logging.v2.ListMonitoredResourceDescriptorsRequest) obj; + + boolean result = true; + result = result && (getPageSize() + == other.getPageSize()); + result = result && getPageToken() + .equals(other.getPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.ListMonitoredResourceDescriptorsRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.ListMonitoredResourceDescriptorsRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.ListMonitoredResourceDescriptorsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.ListMonitoredResourceDescriptorsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.ListMonitoredResourceDescriptorsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.ListMonitoredResourceDescriptorsRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.ListMonitoredResourceDescriptorsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.ListMonitoredResourceDescriptorsRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.ListMonitoredResourceDescriptorsRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.logging.v2.ListMonitoredResourceDescriptorsRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.ListMonitoredResourceDescriptorsRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.ListMonitoredResourceDescriptorsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.logging.v2.ListMonitoredResourceDescriptorsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * The parameters to ListMonitoredResourceDescriptors
+   * 
+ * + * Protobuf type {@code google.logging.v2.ListMonitoredResourceDescriptorsRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.ListMonitoredResourceDescriptorsRequest) + com.google.logging.v2.ListMonitoredResourceDescriptorsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListMonitoredResourceDescriptorsRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListMonitoredResourceDescriptorsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListMonitoredResourceDescriptorsRequest.class, com.google.logging.v2.ListMonitoredResourceDescriptorsRequest.Builder.class); + } + + // Construct using com.google.logging.v2.ListMonitoredResourceDescriptorsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListMonitoredResourceDescriptorsRequest_descriptor; + } + + public com.google.logging.v2.ListMonitoredResourceDescriptorsRequest getDefaultInstanceForType() { + return com.google.logging.v2.ListMonitoredResourceDescriptorsRequest.getDefaultInstance(); + } + + public com.google.logging.v2.ListMonitoredResourceDescriptorsRequest build() { + com.google.logging.v2.ListMonitoredResourceDescriptorsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.logging.v2.ListMonitoredResourceDescriptorsRequest buildPartial() { + com.google.logging.v2.ListMonitoredResourceDescriptorsRequest result = new com.google.logging.v2.ListMonitoredResourceDescriptorsRequest(this); + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.logging.v2.ListMonitoredResourceDescriptorsRequest) { + return mergeFrom((com.google.logging.v2.ListMonitoredResourceDescriptorsRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.ListMonitoredResourceDescriptorsRequest other) { + if (other == com.google.logging.v2.ListMonitoredResourceDescriptorsRequest.getDefaultInstance()) return this; + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.logging.v2.ListMonitoredResourceDescriptorsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.logging.v2.ListMonitoredResourceDescriptorsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int pageSize_ ; + /** + *
+     * Optional. The maximum number of results to return from this request.
+     * Non-positive values are ignored.  The presence of `nextPageToken` in the
+     * response indicates that more results might be available.
+     * 
+ * + * int32 page_size = 1; + */ + public int getPageSize() { + return pageSize_; + } + /** + *
+     * Optional. The maximum number of results to return from this request.
+     * Non-positive values are ignored.  The presence of `nextPageToken` in the
+     * response indicates that more results might be available.
+     * 
+ * + * int32 page_size = 1; + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. The maximum number of results to return from this request.
+     * Non-positive values are ignored.  The presence of `nextPageToken` in the
+     * response indicates that more results might be available.
+     * 
+ * + * int32 page_size = 1; + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `pageToken` must be the value of
+     * `nextPageToken` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `pageToken` must be the value of
+     * `nextPageToken` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2; + */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `pageToken` must be the value of
+     * `nextPageToken` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2; + */ + public Builder setPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `pageToken` must be the value of
+     * `nextPageToken` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2; + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `pageToken` must be the value of
+     * `nextPageToken` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2; + */ + public Builder setPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.logging.v2.ListMonitoredResourceDescriptorsRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.ListMonitoredResourceDescriptorsRequest) + private static final com.google.logging.v2.ListMonitoredResourceDescriptorsRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.logging.v2.ListMonitoredResourceDescriptorsRequest(); + } + + public static com.google.logging.v2.ListMonitoredResourceDescriptorsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ListMonitoredResourceDescriptorsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListMonitoredResourceDescriptorsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.logging.v2.ListMonitoredResourceDescriptorsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsRequestOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsRequestOrBuilder.java new file mode 100644 index 000000000000..2c3f109ad537 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsRequestOrBuilder.java @@ -0,0 +1,44 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging.proto + +package com.google.logging.v2; + +public interface ListMonitoredResourceDescriptorsRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.ListMonitoredResourceDescriptorsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Optional. The maximum number of results to return from this request.
+   * Non-positive values are ignored.  The presence of `nextPageToken` in the
+   * response indicates that more results might be available.
+   * 
+ * + * int32 page_size = 1; + */ + int getPageSize(); + + /** + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method.  `pageToken` must be the value of
+   * `nextPageToken` from the previous response.  The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2; + */ + java.lang.String getPageToken(); + /** + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method.  `pageToken` must be the value of
+   * `nextPageToken` from the previous response.  The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2; + */ + com.google.protobuf.ByteString + getPageTokenBytes(); +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsResponse.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsResponse.java new file mode 100644 index 000000000000..7fcfe51ac236 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsResponse.java @@ -0,0 +1,1006 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging.proto + +package com.google.logging.v2; + +/** + *
+ * Result returned from ListMonitoredResourceDescriptors.
+ * 
+ * + * Protobuf type {@code google.logging.v2.ListMonitoredResourceDescriptorsResponse} + */ +public final class ListMonitoredResourceDescriptorsResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.logging.v2.ListMonitoredResourceDescriptorsResponse) + ListMonitoredResourceDescriptorsResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListMonitoredResourceDescriptorsResponse.newBuilder() to construct. + private ListMonitoredResourceDescriptorsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListMonitoredResourceDescriptorsResponse() { + resourceDescriptors_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListMonitoredResourceDescriptorsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + resourceDescriptors_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + resourceDescriptors_.add( + input.readMessage(com.google.api.MonitoredResourceDescriptor.parser(), extensionRegistry)); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + resourceDescriptors_ = java.util.Collections.unmodifiableList(resourceDescriptors_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListMonitoredResourceDescriptorsResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListMonitoredResourceDescriptorsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListMonitoredResourceDescriptorsResponse.class, com.google.logging.v2.ListMonitoredResourceDescriptorsResponse.Builder.class); + } + + private int bitField0_; + public static final int RESOURCE_DESCRIPTORS_FIELD_NUMBER = 1; + private java.util.List resourceDescriptors_; + /** + *
+   * A list of resource descriptors.
+   * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + public java.util.List getResourceDescriptorsList() { + return resourceDescriptors_; + } + /** + *
+   * A list of resource descriptors.
+   * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + public java.util.List + getResourceDescriptorsOrBuilderList() { + return resourceDescriptors_; + } + /** + *
+   * A list of resource descriptors.
+   * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + public int getResourceDescriptorsCount() { + return resourceDescriptors_.size(); + } + /** + *
+   * A list of resource descriptors.
+   * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + public com.google.api.MonitoredResourceDescriptor getResourceDescriptors(int index) { + return resourceDescriptors_.get(index); + } + /** + *
+   * A list of resource descriptors.
+   * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + public com.google.api.MonitoredResourceDescriptorOrBuilder getResourceDescriptorsOrBuilder( + int index) { + return resourceDescriptors_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + *
+   * If there might be more results than those appearing in this response, then
+   * `nextPageToken` is included.  To get the next set of results, call this
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + *
+   * If there might be more results than those appearing in this response, then
+   * `nextPageToken` is included.  To get the next set of results, call this
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < resourceDescriptors_.size(); i++) { + output.writeMessage(1, resourceDescriptors_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < resourceDescriptors_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, resourceDescriptors_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.logging.v2.ListMonitoredResourceDescriptorsResponse)) { + return super.equals(obj); + } + com.google.logging.v2.ListMonitoredResourceDescriptorsResponse other = (com.google.logging.v2.ListMonitoredResourceDescriptorsResponse) obj; + + boolean result = true; + result = result && getResourceDescriptorsList() + .equals(other.getResourceDescriptorsList()); + result = result && getNextPageToken() + .equals(other.getNextPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getResourceDescriptorsCount() > 0) { + hash = (37 * hash) + RESOURCE_DESCRIPTORS_FIELD_NUMBER; + hash = (53 * hash) + getResourceDescriptorsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.ListMonitoredResourceDescriptorsResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.ListMonitoredResourceDescriptorsResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.ListMonitoredResourceDescriptorsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.ListMonitoredResourceDescriptorsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.ListMonitoredResourceDescriptorsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.ListMonitoredResourceDescriptorsResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.ListMonitoredResourceDescriptorsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.ListMonitoredResourceDescriptorsResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.ListMonitoredResourceDescriptorsResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.logging.v2.ListMonitoredResourceDescriptorsResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.ListMonitoredResourceDescriptorsResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.ListMonitoredResourceDescriptorsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.logging.v2.ListMonitoredResourceDescriptorsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Result returned from ListMonitoredResourceDescriptors.
+   * 
+ * + * Protobuf type {@code google.logging.v2.ListMonitoredResourceDescriptorsResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.ListMonitoredResourceDescriptorsResponse) + com.google.logging.v2.ListMonitoredResourceDescriptorsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListMonitoredResourceDescriptorsResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListMonitoredResourceDescriptorsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListMonitoredResourceDescriptorsResponse.class, com.google.logging.v2.ListMonitoredResourceDescriptorsResponse.Builder.class); + } + + // Construct using com.google.logging.v2.ListMonitoredResourceDescriptorsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getResourceDescriptorsFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (resourceDescriptorsBuilder_ == null) { + resourceDescriptors_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + resourceDescriptorsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListMonitoredResourceDescriptorsResponse_descriptor; + } + + public com.google.logging.v2.ListMonitoredResourceDescriptorsResponse getDefaultInstanceForType() { + return com.google.logging.v2.ListMonitoredResourceDescriptorsResponse.getDefaultInstance(); + } + + public com.google.logging.v2.ListMonitoredResourceDescriptorsResponse build() { + com.google.logging.v2.ListMonitoredResourceDescriptorsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.logging.v2.ListMonitoredResourceDescriptorsResponse buildPartial() { + com.google.logging.v2.ListMonitoredResourceDescriptorsResponse result = new com.google.logging.v2.ListMonitoredResourceDescriptorsResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (resourceDescriptorsBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + resourceDescriptors_ = java.util.Collections.unmodifiableList(resourceDescriptors_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.resourceDescriptors_ = resourceDescriptors_; + } else { + result.resourceDescriptors_ = resourceDescriptorsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.logging.v2.ListMonitoredResourceDescriptorsResponse) { + return mergeFrom((com.google.logging.v2.ListMonitoredResourceDescriptorsResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.ListMonitoredResourceDescriptorsResponse other) { + if (other == com.google.logging.v2.ListMonitoredResourceDescriptorsResponse.getDefaultInstance()) return this; + if (resourceDescriptorsBuilder_ == null) { + if (!other.resourceDescriptors_.isEmpty()) { + if (resourceDescriptors_.isEmpty()) { + resourceDescriptors_ = other.resourceDescriptors_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureResourceDescriptorsIsMutable(); + resourceDescriptors_.addAll(other.resourceDescriptors_); + } + onChanged(); + } + } else { + if (!other.resourceDescriptors_.isEmpty()) { + if (resourceDescriptorsBuilder_.isEmpty()) { + resourceDescriptorsBuilder_.dispose(); + resourceDescriptorsBuilder_ = null; + resourceDescriptors_ = other.resourceDescriptors_; + bitField0_ = (bitField0_ & ~0x00000001); + resourceDescriptorsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getResourceDescriptorsFieldBuilder() : null; + } else { + resourceDescriptorsBuilder_.addAllMessages(other.resourceDescriptors_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.logging.v2.ListMonitoredResourceDescriptorsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.logging.v2.ListMonitoredResourceDescriptorsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List resourceDescriptors_ = + java.util.Collections.emptyList(); + private void ensureResourceDescriptorsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + resourceDescriptors_ = new java.util.ArrayList(resourceDescriptors_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.MonitoredResourceDescriptor, com.google.api.MonitoredResourceDescriptor.Builder, com.google.api.MonitoredResourceDescriptorOrBuilder> resourceDescriptorsBuilder_; + + /** + *
+     * A list of resource descriptors.
+     * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + public java.util.List getResourceDescriptorsList() { + if (resourceDescriptorsBuilder_ == null) { + return java.util.Collections.unmodifiableList(resourceDescriptors_); + } else { + return resourceDescriptorsBuilder_.getMessageList(); + } + } + /** + *
+     * A list of resource descriptors.
+     * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + public int getResourceDescriptorsCount() { + if (resourceDescriptorsBuilder_ == null) { + return resourceDescriptors_.size(); + } else { + return resourceDescriptorsBuilder_.getCount(); + } + } + /** + *
+     * A list of resource descriptors.
+     * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + public com.google.api.MonitoredResourceDescriptor getResourceDescriptors(int index) { + if (resourceDescriptorsBuilder_ == null) { + return resourceDescriptors_.get(index); + } else { + return resourceDescriptorsBuilder_.getMessage(index); + } + } + /** + *
+     * A list of resource descriptors.
+     * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + public Builder setResourceDescriptors( + int index, com.google.api.MonitoredResourceDescriptor value) { + if (resourceDescriptorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourceDescriptorsIsMutable(); + resourceDescriptors_.set(index, value); + onChanged(); + } else { + resourceDescriptorsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * A list of resource descriptors.
+     * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + public Builder setResourceDescriptors( + int index, com.google.api.MonitoredResourceDescriptor.Builder builderForValue) { + if (resourceDescriptorsBuilder_ == null) { + ensureResourceDescriptorsIsMutable(); + resourceDescriptors_.set(index, builderForValue.build()); + onChanged(); + } else { + resourceDescriptorsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A list of resource descriptors.
+     * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + public Builder addResourceDescriptors(com.google.api.MonitoredResourceDescriptor value) { + if (resourceDescriptorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourceDescriptorsIsMutable(); + resourceDescriptors_.add(value); + onChanged(); + } else { + resourceDescriptorsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * A list of resource descriptors.
+     * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + public Builder addResourceDescriptors( + int index, com.google.api.MonitoredResourceDescriptor value) { + if (resourceDescriptorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourceDescriptorsIsMutable(); + resourceDescriptors_.add(index, value); + onChanged(); + } else { + resourceDescriptorsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * A list of resource descriptors.
+     * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + public Builder addResourceDescriptors( + com.google.api.MonitoredResourceDescriptor.Builder builderForValue) { + if (resourceDescriptorsBuilder_ == null) { + ensureResourceDescriptorsIsMutable(); + resourceDescriptors_.add(builderForValue.build()); + onChanged(); + } else { + resourceDescriptorsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * A list of resource descriptors.
+     * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + public Builder addResourceDescriptors( + int index, com.google.api.MonitoredResourceDescriptor.Builder builderForValue) { + if (resourceDescriptorsBuilder_ == null) { + ensureResourceDescriptorsIsMutable(); + resourceDescriptors_.add(index, builderForValue.build()); + onChanged(); + } else { + resourceDescriptorsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A list of resource descriptors.
+     * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + public Builder addAllResourceDescriptors( + java.lang.Iterable values) { + if (resourceDescriptorsBuilder_ == null) { + ensureResourceDescriptorsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, resourceDescriptors_); + onChanged(); + } else { + resourceDescriptorsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * A list of resource descriptors.
+     * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + public Builder clearResourceDescriptors() { + if (resourceDescriptorsBuilder_ == null) { + resourceDescriptors_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + resourceDescriptorsBuilder_.clear(); + } + return this; + } + /** + *
+     * A list of resource descriptors.
+     * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + public Builder removeResourceDescriptors(int index) { + if (resourceDescriptorsBuilder_ == null) { + ensureResourceDescriptorsIsMutable(); + resourceDescriptors_.remove(index); + onChanged(); + } else { + resourceDescriptorsBuilder_.remove(index); + } + return this; + } + /** + *
+     * A list of resource descriptors.
+     * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + public com.google.api.MonitoredResourceDescriptor.Builder getResourceDescriptorsBuilder( + int index) { + return getResourceDescriptorsFieldBuilder().getBuilder(index); + } + /** + *
+     * A list of resource descriptors.
+     * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + public com.google.api.MonitoredResourceDescriptorOrBuilder getResourceDescriptorsOrBuilder( + int index) { + if (resourceDescriptorsBuilder_ == null) { + return resourceDescriptors_.get(index); } else { + return resourceDescriptorsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * A list of resource descriptors.
+     * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + public java.util.List + getResourceDescriptorsOrBuilderList() { + if (resourceDescriptorsBuilder_ != null) { + return resourceDescriptorsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(resourceDescriptors_); + } + } + /** + *
+     * A list of resource descriptors.
+     * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + public com.google.api.MonitoredResourceDescriptor.Builder addResourceDescriptorsBuilder() { + return getResourceDescriptorsFieldBuilder().addBuilder( + com.google.api.MonitoredResourceDescriptor.getDefaultInstance()); + } + /** + *
+     * A list of resource descriptors.
+     * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + public com.google.api.MonitoredResourceDescriptor.Builder addResourceDescriptorsBuilder( + int index) { + return getResourceDescriptorsFieldBuilder().addBuilder( + index, com.google.api.MonitoredResourceDescriptor.getDefaultInstance()); + } + /** + *
+     * A list of resource descriptors.
+     * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + public java.util.List + getResourceDescriptorsBuilderList() { + return getResourceDescriptorsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.MonitoredResourceDescriptor, com.google.api.MonitoredResourceDescriptor.Builder, com.google.api.MonitoredResourceDescriptorOrBuilder> + getResourceDescriptorsFieldBuilder() { + if (resourceDescriptorsBuilder_ == null) { + resourceDescriptorsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.MonitoredResourceDescriptor, com.google.api.MonitoredResourceDescriptor.Builder, com.google.api.MonitoredResourceDescriptorOrBuilder>( + resourceDescriptors_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + resourceDescriptors_ = null; + } + return resourceDescriptorsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + *
+     * If there might be more results than those appearing in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call this
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * If there might be more results than those appearing in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call this
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * If there might be more results than those appearing in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call this
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * If there might be more results than those appearing in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call this
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + *
+     * If there might be more results than those appearing in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call this
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.logging.v2.ListMonitoredResourceDescriptorsResponse) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.ListMonitoredResourceDescriptorsResponse) + private static final com.google.logging.v2.ListMonitoredResourceDescriptorsResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.logging.v2.ListMonitoredResourceDescriptorsResponse(); + } + + public static com.google.logging.v2.ListMonitoredResourceDescriptorsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ListMonitoredResourceDescriptorsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListMonitoredResourceDescriptorsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.logging.v2.ListMonitoredResourceDescriptorsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsResponseOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsResponseOrBuilder.java new file mode 100644 index 000000000000..741cc610f702 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsResponseOrBuilder.java @@ -0,0 +1,75 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging.proto + +package com.google.logging.v2; + +public interface ListMonitoredResourceDescriptorsResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.ListMonitoredResourceDescriptorsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * A list of resource descriptors.
+   * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + java.util.List + getResourceDescriptorsList(); + /** + *
+   * A list of resource descriptors.
+   * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + com.google.api.MonitoredResourceDescriptor getResourceDescriptors(int index); + /** + *
+   * A list of resource descriptors.
+   * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + int getResourceDescriptorsCount(); + /** + *
+   * A list of resource descriptors.
+   * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + java.util.List + getResourceDescriptorsOrBuilderList(); + /** + *
+   * A list of resource descriptors.
+   * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + com.google.api.MonitoredResourceDescriptorOrBuilder getResourceDescriptorsOrBuilder( + int index); + + /** + *
+   * If there might be more results than those appearing in this response, then
+   * `nextPageToken` is included.  To get the next set of results, call this
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + */ + java.lang.String getNextPageToken(); + /** + *
+   * If there might be more results than those appearing in this response, then
+   * `nextPageToken` is included.  To get the next set of results, call this
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + */ + com.google.protobuf.ByteString + getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListSinksRequest.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListSinksRequest.java new file mode 100644 index 000000000000..6a52edd4fb21 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListSinksRequest.java @@ -0,0 +1,838 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_config.proto + +package com.google.logging.v2; + +/** + *
+ * The parameters to `ListSinks`.
+ * 
+ * + * Protobuf type {@code google.logging.v2.ListSinksRequest} + */ +public final class ListSinksRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.logging.v2.ListSinksRequest) + ListSinksRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListSinksRequest.newBuilder() to construct. + private ListSinksRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListSinksRequest() { + parent_ = ""; + pageToken_ = ""; + pageSize_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListSinksRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 24: { + + pageSize_ = input.readInt32(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_ListSinksRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_ListSinksRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListSinksRequest.class, com.google.logging.v2.ListSinksRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * Required. The parent resource whose sinks are to be listed:
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + *
+   * Required. The parent resource whose sinks are to be listed:
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object pageToken_; + /** + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method.  `pageToken` must be the value of
+   * `nextPageToken` from the previous response.  The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method.  `pageToken` must be the value of
+   * `nextPageToken` from the previous response.  The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2; + */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_; + /** + *
+   * Optional. The maximum number of results to return from this request.
+   * Non-positive values are ignored.  The presence of `nextPageToken` in the
+   * response indicates that more results might be available.
+   * 
+ * + * int32 page_size = 3; + */ + public int getPageSize() { + return pageSize_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pageToken_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, pageToken_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, pageSize_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.logging.v2.ListSinksRequest)) { + return super.equals(obj); + } + com.google.logging.v2.ListSinksRequest other = (com.google.logging.v2.ListSinksRequest) obj; + + boolean result = true; + result = result && getParent() + .equals(other.getParent()); + result = result && getPageToken() + .equals(other.getPageToken()); + result = result && (getPageSize() + == other.getPageSize()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.ListSinksRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.ListSinksRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.ListSinksRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.ListSinksRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.ListSinksRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.ListSinksRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.ListSinksRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.ListSinksRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.ListSinksRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.logging.v2.ListSinksRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.ListSinksRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.ListSinksRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.logging.v2.ListSinksRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * The parameters to `ListSinks`.
+   * 
+ * + * Protobuf type {@code google.logging.v2.ListSinksRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.ListSinksRequest) + com.google.logging.v2.ListSinksRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_ListSinksRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_ListSinksRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListSinksRequest.class, com.google.logging.v2.ListSinksRequest.Builder.class); + } + + // Construct using com.google.logging.v2.ListSinksRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + parent_ = ""; + + pageToken_ = ""; + + pageSize_ = 0; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_ListSinksRequest_descriptor; + } + + public com.google.logging.v2.ListSinksRequest getDefaultInstanceForType() { + return com.google.logging.v2.ListSinksRequest.getDefaultInstance(); + } + + public com.google.logging.v2.ListSinksRequest build() { + com.google.logging.v2.ListSinksRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.logging.v2.ListSinksRequest buildPartial() { + com.google.logging.v2.ListSinksRequest result = new com.google.logging.v2.ListSinksRequest(this); + result.parent_ = parent_; + result.pageToken_ = pageToken_; + result.pageSize_ = pageSize_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.logging.v2.ListSinksRequest) { + return mergeFrom((com.google.logging.v2.ListSinksRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.ListSinksRequest other) { + if (other == com.google.logging.v2.ListSinksRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.logging.v2.ListSinksRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.logging.v2.ListSinksRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+     * Required. The parent resource whose sinks are to be listed:
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The parent resource whose sinks are to be listed:
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The parent resource whose sinks are to be listed:
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * 
+ * + * string parent = 1; + */ + public Builder setParent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The parent resource whose sinks are to be listed:
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+     * Required. The parent resource whose sinks are to be listed:
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `pageToken` must be the value of
+     * `nextPageToken` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `pageToken` must be the value of
+     * `nextPageToken` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2; + */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `pageToken` must be the value of
+     * `nextPageToken` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2; + */ + public Builder setPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `pageToken` must be the value of
+     * `nextPageToken` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2; + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `pageToken` must be the value of
+     * `nextPageToken` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2; + */ + public Builder setPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private int pageSize_ ; + /** + *
+     * Optional. The maximum number of results to return from this request.
+     * Non-positive values are ignored.  The presence of `nextPageToken` in the
+     * response indicates that more results might be available.
+     * 
+ * + * int32 page_size = 3; + */ + public int getPageSize() { + return pageSize_; + } + /** + *
+     * Optional. The maximum number of results to return from this request.
+     * Non-positive values are ignored.  The presence of `nextPageToken` in the
+     * response indicates that more results might be available.
+     * 
+ * + * int32 page_size = 3; + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. The maximum number of results to return from this request.
+     * Non-positive values are ignored.  The presence of `nextPageToken` in the
+     * response indicates that more results might be available.
+     * 
+ * + * int32 page_size = 3; + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.logging.v2.ListSinksRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.ListSinksRequest) + private static final com.google.logging.v2.ListSinksRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.logging.v2.ListSinksRequest(); + } + + public static com.google.logging.v2.ListSinksRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ListSinksRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListSinksRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.logging.v2.ListSinksRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListSinksRequestOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListSinksRequestOrBuilder.java new file mode 100644 index 000000000000..aca419d92504 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListSinksRequestOrBuilder.java @@ -0,0 +1,70 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_config.proto + +package com.google.logging.v2; + +public interface ListSinksRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.ListSinksRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The parent resource whose sinks are to be listed:
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + *
+   * Required. The parent resource whose sinks are to be listed:
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method.  `pageToken` must be the value of
+   * `nextPageToken` from the previous response.  The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2; + */ + java.lang.String getPageToken(); + /** + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method.  `pageToken` must be the value of
+   * `nextPageToken` from the previous response.  The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2; + */ + com.google.protobuf.ByteString + getPageTokenBytes(); + + /** + *
+   * Optional. The maximum number of results to return from this request.
+   * Non-positive values are ignored.  The presence of `nextPageToken` in the
+   * response indicates that more results might be available.
+   * 
+ * + * int32 page_size = 3; + */ + int getPageSize(); +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListSinksResponse.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListSinksResponse.java new file mode 100644 index 000000000000..139502775f9a --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListSinksResponse.java @@ -0,0 +1,1006 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_config.proto + +package com.google.logging.v2; + +/** + *
+ * Result returned from `ListSinks`.
+ * 
+ * + * Protobuf type {@code google.logging.v2.ListSinksResponse} + */ +public final class ListSinksResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.logging.v2.ListSinksResponse) + ListSinksResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListSinksResponse.newBuilder() to construct. + private ListSinksResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListSinksResponse() { + sinks_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListSinksResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + sinks_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + sinks_.add( + input.readMessage(com.google.logging.v2.LogSink.parser(), extensionRegistry)); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + sinks_ = java.util.Collections.unmodifiableList(sinks_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_ListSinksResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_ListSinksResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListSinksResponse.class, com.google.logging.v2.ListSinksResponse.Builder.class); + } + + private int bitField0_; + public static final int SINKS_FIELD_NUMBER = 1; + private java.util.List sinks_; + /** + *
+   * A list of sinks.
+   * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + public java.util.List getSinksList() { + return sinks_; + } + /** + *
+   * A list of sinks.
+   * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + public java.util.List + getSinksOrBuilderList() { + return sinks_; + } + /** + *
+   * A list of sinks.
+   * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + public int getSinksCount() { + return sinks_.size(); + } + /** + *
+   * A list of sinks.
+   * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + public com.google.logging.v2.LogSink getSinks(int index) { + return sinks_.get(index); + } + /** + *
+   * A list of sinks.
+   * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + public com.google.logging.v2.LogSinkOrBuilder getSinksOrBuilder( + int index) { + return sinks_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + *
+   * If there might be more results than appear in this response, then
+   * `nextPageToken` is included.  To get the next set of results, call the same
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + *
+   * If there might be more results than appear in this response, then
+   * `nextPageToken` is included.  To get the next set of results, call the same
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < sinks_.size(); i++) { + output.writeMessage(1, sinks_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < sinks_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, sinks_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.logging.v2.ListSinksResponse)) { + return super.equals(obj); + } + com.google.logging.v2.ListSinksResponse other = (com.google.logging.v2.ListSinksResponse) obj; + + boolean result = true; + result = result && getSinksList() + .equals(other.getSinksList()); + result = result && getNextPageToken() + .equals(other.getNextPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getSinksCount() > 0) { + hash = (37 * hash) + SINKS_FIELD_NUMBER; + hash = (53 * hash) + getSinksList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.ListSinksResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.ListSinksResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.ListSinksResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.ListSinksResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.ListSinksResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.ListSinksResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.ListSinksResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.ListSinksResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.ListSinksResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.logging.v2.ListSinksResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.ListSinksResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.ListSinksResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.logging.v2.ListSinksResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Result returned from `ListSinks`.
+   * 
+ * + * Protobuf type {@code google.logging.v2.ListSinksResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.ListSinksResponse) + com.google.logging.v2.ListSinksResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_ListSinksResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_ListSinksResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListSinksResponse.class, com.google.logging.v2.ListSinksResponse.Builder.class); + } + + // Construct using com.google.logging.v2.ListSinksResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getSinksFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (sinksBuilder_ == null) { + sinks_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + sinksBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_ListSinksResponse_descriptor; + } + + public com.google.logging.v2.ListSinksResponse getDefaultInstanceForType() { + return com.google.logging.v2.ListSinksResponse.getDefaultInstance(); + } + + public com.google.logging.v2.ListSinksResponse build() { + com.google.logging.v2.ListSinksResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.logging.v2.ListSinksResponse buildPartial() { + com.google.logging.v2.ListSinksResponse result = new com.google.logging.v2.ListSinksResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (sinksBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + sinks_ = java.util.Collections.unmodifiableList(sinks_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.sinks_ = sinks_; + } else { + result.sinks_ = sinksBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.logging.v2.ListSinksResponse) { + return mergeFrom((com.google.logging.v2.ListSinksResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.ListSinksResponse other) { + if (other == com.google.logging.v2.ListSinksResponse.getDefaultInstance()) return this; + if (sinksBuilder_ == null) { + if (!other.sinks_.isEmpty()) { + if (sinks_.isEmpty()) { + sinks_ = other.sinks_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSinksIsMutable(); + sinks_.addAll(other.sinks_); + } + onChanged(); + } + } else { + if (!other.sinks_.isEmpty()) { + if (sinksBuilder_.isEmpty()) { + sinksBuilder_.dispose(); + sinksBuilder_ = null; + sinks_ = other.sinks_; + bitField0_ = (bitField0_ & ~0x00000001); + sinksBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSinksFieldBuilder() : null; + } else { + sinksBuilder_.addAllMessages(other.sinks_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.logging.v2.ListSinksResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.logging.v2.ListSinksResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List sinks_ = + java.util.Collections.emptyList(); + private void ensureSinksIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + sinks_ = new java.util.ArrayList(sinks_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogSink, com.google.logging.v2.LogSink.Builder, com.google.logging.v2.LogSinkOrBuilder> sinksBuilder_; + + /** + *
+     * A list of sinks.
+     * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + public java.util.List getSinksList() { + if (sinksBuilder_ == null) { + return java.util.Collections.unmodifiableList(sinks_); + } else { + return sinksBuilder_.getMessageList(); + } + } + /** + *
+     * A list of sinks.
+     * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + public int getSinksCount() { + if (sinksBuilder_ == null) { + return sinks_.size(); + } else { + return sinksBuilder_.getCount(); + } + } + /** + *
+     * A list of sinks.
+     * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + public com.google.logging.v2.LogSink getSinks(int index) { + if (sinksBuilder_ == null) { + return sinks_.get(index); + } else { + return sinksBuilder_.getMessage(index); + } + } + /** + *
+     * A list of sinks.
+     * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + public Builder setSinks( + int index, com.google.logging.v2.LogSink value) { + if (sinksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSinksIsMutable(); + sinks_.set(index, value); + onChanged(); + } else { + sinksBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * A list of sinks.
+     * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + public Builder setSinks( + int index, com.google.logging.v2.LogSink.Builder builderForValue) { + if (sinksBuilder_ == null) { + ensureSinksIsMutable(); + sinks_.set(index, builderForValue.build()); + onChanged(); + } else { + sinksBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A list of sinks.
+     * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + public Builder addSinks(com.google.logging.v2.LogSink value) { + if (sinksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSinksIsMutable(); + sinks_.add(value); + onChanged(); + } else { + sinksBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * A list of sinks.
+     * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + public Builder addSinks( + int index, com.google.logging.v2.LogSink value) { + if (sinksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSinksIsMutable(); + sinks_.add(index, value); + onChanged(); + } else { + sinksBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * A list of sinks.
+     * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + public Builder addSinks( + com.google.logging.v2.LogSink.Builder builderForValue) { + if (sinksBuilder_ == null) { + ensureSinksIsMutable(); + sinks_.add(builderForValue.build()); + onChanged(); + } else { + sinksBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * A list of sinks.
+     * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + public Builder addSinks( + int index, com.google.logging.v2.LogSink.Builder builderForValue) { + if (sinksBuilder_ == null) { + ensureSinksIsMutable(); + sinks_.add(index, builderForValue.build()); + onChanged(); + } else { + sinksBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A list of sinks.
+     * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + public Builder addAllSinks( + java.lang.Iterable values) { + if (sinksBuilder_ == null) { + ensureSinksIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, sinks_); + onChanged(); + } else { + sinksBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * A list of sinks.
+     * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + public Builder clearSinks() { + if (sinksBuilder_ == null) { + sinks_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + sinksBuilder_.clear(); + } + return this; + } + /** + *
+     * A list of sinks.
+     * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + public Builder removeSinks(int index) { + if (sinksBuilder_ == null) { + ensureSinksIsMutable(); + sinks_.remove(index); + onChanged(); + } else { + sinksBuilder_.remove(index); + } + return this; + } + /** + *
+     * A list of sinks.
+     * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + public com.google.logging.v2.LogSink.Builder getSinksBuilder( + int index) { + return getSinksFieldBuilder().getBuilder(index); + } + /** + *
+     * A list of sinks.
+     * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + public com.google.logging.v2.LogSinkOrBuilder getSinksOrBuilder( + int index) { + if (sinksBuilder_ == null) { + return sinks_.get(index); } else { + return sinksBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * A list of sinks.
+     * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + public java.util.List + getSinksOrBuilderList() { + if (sinksBuilder_ != null) { + return sinksBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(sinks_); + } + } + /** + *
+     * A list of sinks.
+     * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + public com.google.logging.v2.LogSink.Builder addSinksBuilder() { + return getSinksFieldBuilder().addBuilder( + com.google.logging.v2.LogSink.getDefaultInstance()); + } + /** + *
+     * A list of sinks.
+     * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + public com.google.logging.v2.LogSink.Builder addSinksBuilder( + int index) { + return getSinksFieldBuilder().addBuilder( + index, com.google.logging.v2.LogSink.getDefaultInstance()); + } + /** + *
+     * A list of sinks.
+     * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + public java.util.List + getSinksBuilderList() { + return getSinksFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogSink, com.google.logging.v2.LogSink.Builder, com.google.logging.v2.LogSinkOrBuilder> + getSinksFieldBuilder() { + if (sinksBuilder_ == null) { + sinksBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogSink, com.google.logging.v2.LogSink.Builder, com.google.logging.v2.LogSinkOrBuilder>( + sinks_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + sinks_ = null; + } + return sinksBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call the same
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call the same
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call the same
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call the same
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call the same
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.logging.v2.ListSinksResponse) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.ListSinksResponse) + private static final com.google.logging.v2.ListSinksResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.logging.v2.ListSinksResponse(); + } + + public static com.google.logging.v2.ListSinksResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ListSinksResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListSinksResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.logging.v2.ListSinksResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListSinksResponseOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListSinksResponseOrBuilder.java new file mode 100644 index 000000000000..f9240151807c --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListSinksResponseOrBuilder.java @@ -0,0 +1,75 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_config.proto + +package com.google.logging.v2; + +public interface ListSinksResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.ListSinksResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * A list of sinks.
+   * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + java.util.List + getSinksList(); + /** + *
+   * A list of sinks.
+   * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + com.google.logging.v2.LogSink getSinks(int index); + /** + *
+   * A list of sinks.
+   * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + int getSinksCount(); + /** + *
+   * A list of sinks.
+   * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + java.util.List + getSinksOrBuilderList(); + /** + *
+   * A list of sinks.
+   * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + com.google.logging.v2.LogSinkOrBuilder getSinksOrBuilder( + int index); + + /** + *
+   * If there might be more results than appear in this response, then
+   * `nextPageToken` is included.  To get the next set of results, call the same
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + */ + java.lang.String getNextPageToken(); + /** + *
+   * If there might be more results than appear in this response, then
+   * `nextPageToken` is included.  To get the next set of results, call the same
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + */ + com.google.protobuf.ByteString + getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntry.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntry.java new file mode 100644 index 000000000000..9ff2198bfe69 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntry.java @@ -0,0 +1,3990 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/log_entry.proto + +package com.google.logging.v2; + +/** + *
+ * An individual entry in a log.
+ * 
+ * + * Protobuf type {@code google.logging.v2.LogEntry} + */ +public final class LogEntry extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.logging.v2.LogEntry) + LogEntryOrBuilder { +private static final long serialVersionUID = 0L; + // Use LogEntry.newBuilder() to construct. + private LogEntry(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private LogEntry() { + logName_ = ""; + severity_ = 0; + insertId_ = ""; + trace_ = ""; + spanId_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private LogEntry( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 18: { + com.google.protobuf.Any.Builder subBuilder = null; + if (payloadCase_ == 2) { + subBuilder = ((com.google.protobuf.Any) payload_).toBuilder(); + } + payload_ = + input.readMessage(com.google.protobuf.Any.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.protobuf.Any) payload_); + payload_ = subBuilder.buildPartial(); + } + payloadCase_ = 2; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + payloadCase_ = 3; + payload_ = s; + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + insertId_ = s; + break; + } + case 50: { + com.google.protobuf.Struct.Builder subBuilder = null; + if (payloadCase_ == 6) { + subBuilder = ((com.google.protobuf.Struct) payload_).toBuilder(); + } + payload_ = + input.readMessage(com.google.protobuf.Struct.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.protobuf.Struct) payload_); + payload_ = subBuilder.buildPartial(); + } + payloadCase_ = 6; + break; + } + case 58: { + com.google.logging.type.HttpRequest.Builder subBuilder = null; + if (httpRequest_ != null) { + subBuilder = httpRequest_.toBuilder(); + } + httpRequest_ = input.readMessage(com.google.logging.type.HttpRequest.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(httpRequest_); + httpRequest_ = subBuilder.buildPartial(); + } + + break; + } + case 66: { + com.google.api.MonitoredResource.Builder subBuilder = null; + if (resource_ != null) { + subBuilder = resource_.toBuilder(); + } + resource_ = input.readMessage(com.google.api.MonitoredResource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(resource_); + resource_ = subBuilder.buildPartial(); + } + + break; + } + case 74: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (timestamp_ != null) { + subBuilder = timestamp_.toBuilder(); + } + timestamp_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(timestamp_); + timestamp_ = subBuilder.buildPartial(); + } + + break; + } + case 80: { + int rawValue = input.readEnum(); + + severity_ = rawValue; + break; + } + case 90: { + if (!((mutable_bitField0_ & 0x00000400) == 0x00000400)) { + labels_ = com.google.protobuf.MapField.newMapField( + LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000400; + } + com.google.protobuf.MapEntry + labels__ = input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put( + labels__.getKey(), labels__.getValue()); + break; + } + case 98: { + java.lang.String s = input.readStringRequireUtf8(); + + logName_ = s; + break; + } + case 122: { + com.google.logging.v2.LogEntryOperation.Builder subBuilder = null; + if (operation_ != null) { + subBuilder = operation_.toBuilder(); + } + operation_ = input.readMessage(com.google.logging.v2.LogEntryOperation.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(operation_); + operation_ = subBuilder.buildPartial(); + } + + break; + } + case 178: { + java.lang.String s = input.readStringRequireUtf8(); + + trace_ = s; + break; + } + case 186: { + com.google.logging.v2.LogEntrySourceLocation.Builder subBuilder = null; + if (sourceLocation_ != null) { + subBuilder = sourceLocation_.toBuilder(); + } + sourceLocation_ = input.readMessage(com.google.logging.v2.LogEntrySourceLocation.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(sourceLocation_); + sourceLocation_ = subBuilder.buildPartial(); + } + + break; + } + case 194: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (receiveTimestamp_ != null) { + subBuilder = receiveTimestamp_.toBuilder(); + } + receiveTimestamp_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(receiveTimestamp_); + receiveTimestamp_ = subBuilder.buildPartial(); + } + + break; + } + case 218: { + java.lang.String s = input.readStringRequireUtf8(); + + spanId_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LogEntryProto.internal_static_google_logging_v2_LogEntry_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 11: + return internalGetLabels(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LogEntryProto.internal_static_google_logging_v2_LogEntry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.LogEntry.class, com.google.logging.v2.LogEntry.Builder.class); + } + + private int bitField0_; + private int payloadCase_ = 0; + private java.lang.Object payload_; + public enum PayloadCase + implements com.google.protobuf.Internal.EnumLite { + PROTO_PAYLOAD(2), + TEXT_PAYLOAD(3), + JSON_PAYLOAD(6), + PAYLOAD_NOT_SET(0); + private final int value; + private PayloadCase(int value) { + this.value = value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PayloadCase valueOf(int value) { + return forNumber(value); + } + + public static PayloadCase forNumber(int value) { + switch (value) { + case 2: return PROTO_PAYLOAD; + case 3: return TEXT_PAYLOAD; + case 6: return JSON_PAYLOAD; + case 0: return PAYLOAD_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public PayloadCase + getPayloadCase() { + return PayloadCase.forNumber( + payloadCase_); + } + + public static final int LOG_NAME_FIELD_NUMBER = 12; + private volatile java.lang.Object logName_; + /** + *
+   * Required. The resource name of the log to which this log entry belongs:
+   *     "projects/[PROJECT_ID]/logs/[LOG_ID]"
+   *     "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
+   *     "folders/[FOLDER_ID]/logs/[LOG_ID]"
+   *  A project number may optionally be used in place of PROJECT_ID. The
+   *  project number is translated to its corresponding PROJECT_ID internally
+   *  and the `log_name` field will contain PROJECT_ID in queries and exports.
+   * `[LOG_ID]` must be URL-encoded within `log_name`. Example:
+   * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+   * `[LOG_ID]` must be less than 512 characters long and can only include the
+   * following characters: upper and lower case alphanumeric characters,
+   * forward-slash, underscore, hyphen, and period.
+   * For backward compatibility, if `log_name` begins with a forward-slash, such
+   * as `/projects/...`, then the log entry is ingested as usual but the
+   * forward-slash is removed. Listing the log entry will not show the leading
+   * slash and filtering for a log name with a leading slash will never return
+   * any results.
+   * 
+ * + * string log_name = 12; + */ + public java.lang.String getLogName() { + java.lang.Object ref = logName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + logName_ = s; + return s; + } + } + /** + *
+   * Required. The resource name of the log to which this log entry belongs:
+   *     "projects/[PROJECT_ID]/logs/[LOG_ID]"
+   *     "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
+   *     "folders/[FOLDER_ID]/logs/[LOG_ID]"
+   *  A project number may optionally be used in place of PROJECT_ID. The
+   *  project number is translated to its corresponding PROJECT_ID internally
+   *  and the `log_name` field will contain PROJECT_ID in queries and exports.
+   * `[LOG_ID]` must be URL-encoded within `log_name`. Example:
+   * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+   * `[LOG_ID]` must be less than 512 characters long and can only include the
+   * following characters: upper and lower case alphanumeric characters,
+   * forward-slash, underscore, hyphen, and period.
+   * For backward compatibility, if `log_name` begins with a forward-slash, such
+   * as `/projects/...`, then the log entry is ingested as usual but the
+   * forward-slash is removed. Listing the log entry will not show the leading
+   * slash and filtering for a log name with a leading slash will never return
+   * any results.
+   * 
+ * + * string log_name = 12; + */ + public com.google.protobuf.ByteString + getLogNameBytes() { + java.lang.Object ref = logName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + logName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCE_FIELD_NUMBER = 8; + private com.google.api.MonitoredResource resource_; + /** + *
+   * Required. The monitored resource associated with this log entry.
+   * Example: a log entry that reports a database error would be
+   * associated with the monitored resource designating the particular
+   * database that reported the error.
+   * 
+ * + * .google.api.MonitoredResource resource = 8; + */ + public boolean hasResource() { + return resource_ != null; + } + /** + *
+   * Required. The monitored resource associated with this log entry.
+   * Example: a log entry that reports a database error would be
+   * associated with the monitored resource designating the particular
+   * database that reported the error.
+   * 
+ * + * .google.api.MonitoredResource resource = 8; + */ + public com.google.api.MonitoredResource getResource() { + return resource_ == null ? com.google.api.MonitoredResource.getDefaultInstance() : resource_; + } + /** + *
+   * Required. The monitored resource associated with this log entry.
+   * Example: a log entry that reports a database error would be
+   * associated with the monitored resource designating the particular
+   * database that reported the error.
+   * 
+ * + * .google.api.MonitoredResource resource = 8; + */ + public com.google.api.MonitoredResourceOrBuilder getResourceOrBuilder() { + return getResource(); + } + + public static final int PROTO_PAYLOAD_FIELD_NUMBER = 2; + /** + *
+   * The log entry payload, represented as a protocol buffer.  Some
+   * Google Cloud Platform services use this field for their log
+   * entry payloads.
+   * 
+ * + * .google.protobuf.Any proto_payload = 2; + */ + public boolean hasProtoPayload() { + return payloadCase_ == 2; + } + /** + *
+   * The log entry payload, represented as a protocol buffer.  Some
+   * Google Cloud Platform services use this field for their log
+   * entry payloads.
+   * 
+ * + * .google.protobuf.Any proto_payload = 2; + */ + public com.google.protobuf.Any getProtoPayload() { + if (payloadCase_ == 2) { + return (com.google.protobuf.Any) payload_; + } + return com.google.protobuf.Any.getDefaultInstance(); + } + /** + *
+   * The log entry payload, represented as a protocol buffer.  Some
+   * Google Cloud Platform services use this field for their log
+   * entry payloads.
+   * 
+ * + * .google.protobuf.Any proto_payload = 2; + */ + public com.google.protobuf.AnyOrBuilder getProtoPayloadOrBuilder() { + if (payloadCase_ == 2) { + return (com.google.protobuf.Any) payload_; + } + return com.google.protobuf.Any.getDefaultInstance(); + } + + public static final int TEXT_PAYLOAD_FIELD_NUMBER = 3; + /** + *
+   * The log entry payload, represented as a Unicode string (UTF-8).
+   * 
+ * + * string text_payload = 3; + */ + public java.lang.String getTextPayload() { + java.lang.Object ref = ""; + if (payloadCase_ == 3) { + ref = payload_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (payloadCase_ == 3) { + payload_ = s; + } + return s; + } + } + /** + *
+   * The log entry payload, represented as a Unicode string (UTF-8).
+   * 
+ * + * string text_payload = 3; + */ + public com.google.protobuf.ByteString + getTextPayloadBytes() { + java.lang.Object ref = ""; + if (payloadCase_ == 3) { + ref = payload_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (payloadCase_ == 3) { + payload_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int JSON_PAYLOAD_FIELD_NUMBER = 6; + /** + *
+   * The log entry payload, represented as a structure that is
+   * expressed as a JSON object.
+   * 
+ * + * .google.protobuf.Struct json_payload = 6; + */ + public boolean hasJsonPayload() { + return payloadCase_ == 6; + } + /** + *
+   * The log entry payload, represented as a structure that is
+   * expressed as a JSON object.
+   * 
+ * + * .google.protobuf.Struct json_payload = 6; + */ + public com.google.protobuf.Struct getJsonPayload() { + if (payloadCase_ == 6) { + return (com.google.protobuf.Struct) payload_; + } + return com.google.protobuf.Struct.getDefaultInstance(); + } + /** + *
+   * The log entry payload, represented as a structure that is
+   * expressed as a JSON object.
+   * 
+ * + * .google.protobuf.Struct json_payload = 6; + */ + public com.google.protobuf.StructOrBuilder getJsonPayloadOrBuilder() { + if (payloadCase_ == 6) { + return (com.google.protobuf.Struct) payload_; + } + return com.google.protobuf.Struct.getDefaultInstance(); + } + + public static final int TIMESTAMP_FIELD_NUMBER = 9; + private com.google.protobuf.Timestamp timestamp_; + /** + *
+   * Optional. The time the event described by the log entry occurred.
+   * This time is used to compute the log entry's age and to enforce
+   * the logs retention period. If this field is omitted in a new log
+   * entry, then Stackdriver Logging assigns it the current time.
+   * Incoming log entries should have timestamps that are no more than
+   * the [logs retention period](/logging/quota-policy) in the past,
+   * and no more than 24 hours in the future.
+   * See the `entries.write` API method for more information.
+   * 
+ * + * .google.protobuf.Timestamp timestamp = 9; + */ + public boolean hasTimestamp() { + return timestamp_ != null; + } + /** + *
+   * Optional. The time the event described by the log entry occurred.
+   * This time is used to compute the log entry's age and to enforce
+   * the logs retention period. If this field is omitted in a new log
+   * entry, then Stackdriver Logging assigns it the current time.
+   * Incoming log entries should have timestamps that are no more than
+   * the [logs retention period](/logging/quota-policy) in the past,
+   * and no more than 24 hours in the future.
+   * See the `entries.write` API method for more information.
+   * 
+ * + * .google.protobuf.Timestamp timestamp = 9; + */ + public com.google.protobuf.Timestamp getTimestamp() { + return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; + } + /** + *
+   * Optional. The time the event described by the log entry occurred.
+   * This time is used to compute the log entry's age and to enforce
+   * the logs retention period. If this field is omitted in a new log
+   * entry, then Stackdriver Logging assigns it the current time.
+   * Incoming log entries should have timestamps that are no more than
+   * the [logs retention period](/logging/quota-policy) in the past,
+   * and no more than 24 hours in the future.
+   * See the `entries.write` API method for more information.
+   * 
+ * + * .google.protobuf.Timestamp timestamp = 9; + */ + public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() { + return getTimestamp(); + } + + public static final int RECEIVE_TIMESTAMP_FIELD_NUMBER = 24; + private com.google.protobuf.Timestamp receiveTimestamp_; + /** + *
+   * Output only. The time the log entry was received by Stackdriver Logging.
+   * 
+ * + * .google.protobuf.Timestamp receive_timestamp = 24; + */ + public boolean hasReceiveTimestamp() { + return receiveTimestamp_ != null; + } + /** + *
+   * Output only. The time the log entry was received by Stackdriver Logging.
+   * 
+ * + * .google.protobuf.Timestamp receive_timestamp = 24; + */ + public com.google.protobuf.Timestamp getReceiveTimestamp() { + return receiveTimestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : receiveTimestamp_; + } + /** + *
+   * Output only. The time the log entry was received by Stackdriver Logging.
+   * 
+ * + * .google.protobuf.Timestamp receive_timestamp = 24; + */ + public com.google.protobuf.TimestampOrBuilder getReceiveTimestampOrBuilder() { + return getReceiveTimestamp(); + } + + public static final int SEVERITY_FIELD_NUMBER = 10; + private int severity_; + /** + *
+   * Optional. The severity of the log entry. The default value is
+   * `LogSeverity.DEFAULT`.
+   * 
+ * + * .google.logging.type.LogSeverity severity = 10; + */ + public int getSeverityValue() { + return severity_; + } + /** + *
+   * Optional. The severity of the log entry. The default value is
+   * `LogSeverity.DEFAULT`.
+   * 
+ * + * .google.logging.type.LogSeverity severity = 10; + */ + public com.google.logging.type.LogSeverity getSeverity() { + com.google.logging.type.LogSeverity result = com.google.logging.type.LogSeverity.valueOf(severity_); + return result == null ? com.google.logging.type.LogSeverity.UNRECOGNIZED : result; + } + + public static final int INSERT_ID_FIELD_NUMBER = 4; + private volatile java.lang.Object insertId_; + /** + *
+   * Optional. A unique identifier for the log entry. If you provide a value,
+   * then Stackdriver Logging considers other log entries in the same project,
+   * with the same `timestamp`, and with the same `insert_id` to be duplicates
+   * which can be removed.  If omitted in new log entries, then Stackdriver
+   * Logging assigns its own unique identifier. The `insert_id` is also used
+   * to order log entries that have the same `timestamp` value.
+   * 
+ * + * string insert_id = 4; + */ + public java.lang.String getInsertId() { + java.lang.Object ref = insertId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + insertId_ = s; + return s; + } + } + /** + *
+   * Optional. A unique identifier for the log entry. If you provide a value,
+   * then Stackdriver Logging considers other log entries in the same project,
+   * with the same `timestamp`, and with the same `insert_id` to be duplicates
+   * which can be removed.  If omitted in new log entries, then Stackdriver
+   * Logging assigns its own unique identifier. The `insert_id` is also used
+   * to order log entries that have the same `timestamp` value.
+   * 
+ * + * string insert_id = 4; + */ + public com.google.protobuf.ByteString + getInsertIdBytes() { + java.lang.Object ref = insertId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + insertId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HTTP_REQUEST_FIELD_NUMBER = 7; + private com.google.logging.type.HttpRequest httpRequest_; + /** + *
+   * Optional. Information about the HTTP request associated with this
+   * log entry, if applicable.
+   * 
+ * + * .google.logging.type.HttpRequest http_request = 7; + */ + public boolean hasHttpRequest() { + return httpRequest_ != null; + } + /** + *
+   * Optional. Information about the HTTP request associated with this
+   * log entry, if applicable.
+   * 
+ * + * .google.logging.type.HttpRequest http_request = 7; + */ + public com.google.logging.type.HttpRequest getHttpRequest() { + return httpRequest_ == null ? com.google.logging.type.HttpRequest.getDefaultInstance() : httpRequest_; + } + /** + *
+   * Optional. Information about the HTTP request associated with this
+   * log entry, if applicable.
+   * 
+ * + * .google.logging.type.HttpRequest http_request = 7; + */ + public com.google.logging.type.HttpRequestOrBuilder getHttpRequestOrBuilder() { + return getHttpRequest(); + } + + public static final int LABELS_FIELD_NUMBER = 11; + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.logging.v2.LogEntryProto.internal_static_google_logging_v2_LogEntry_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> labels_; + private com.google.protobuf.MapField + internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField( + LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + *
+   * Optional. A set of user-defined (key, value) data that provides additional
+   * information about the log entry.
+   * 
+ * + * map<string, string> labels = 11; + */ + + public boolean containsLabels( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetLabels().getMap().containsKey(key); + } + /** + * Use {@link #getLabelsMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + *
+   * Optional. A set of user-defined (key, value) data that provides additional
+   * information about the log entry.
+   * 
+ * + * map<string, string> labels = 11; + */ + + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + *
+   * Optional. A set of user-defined (key, value) data that provides additional
+   * information about the log entry.
+   * 
+ * + * map<string, string> labels = 11; + */ + + public java.lang.String getLabelsOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+   * Optional. A set of user-defined (key, value) data that provides additional
+   * information about the log entry.
+   * 
+ * + * map<string, string> labels = 11; + */ + + public java.lang.String getLabelsOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int OPERATION_FIELD_NUMBER = 15; + private com.google.logging.v2.LogEntryOperation operation_; + /** + *
+   * Optional. Information about an operation associated with the log entry, if
+   * applicable.
+   * 
+ * + * .google.logging.v2.LogEntryOperation operation = 15; + */ + public boolean hasOperation() { + return operation_ != null; + } + /** + *
+   * Optional. Information about an operation associated with the log entry, if
+   * applicable.
+   * 
+ * + * .google.logging.v2.LogEntryOperation operation = 15; + */ + public com.google.logging.v2.LogEntryOperation getOperation() { + return operation_ == null ? com.google.logging.v2.LogEntryOperation.getDefaultInstance() : operation_; + } + /** + *
+   * Optional. Information about an operation associated with the log entry, if
+   * applicable.
+   * 
+ * + * .google.logging.v2.LogEntryOperation operation = 15; + */ + public com.google.logging.v2.LogEntryOperationOrBuilder getOperationOrBuilder() { + return getOperation(); + } + + public static final int TRACE_FIELD_NUMBER = 22; + private volatile java.lang.Object trace_; + /** + *
+   * Optional. Resource name of the trace associated with the log entry, if any.
+   * If it contains a relative resource name, the name is assumed to be relative
+   * to `//tracing.googleapis.com`. Example:
+   * `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824`
+   * 
+ * + * string trace = 22; + */ + public java.lang.String getTrace() { + java.lang.Object ref = trace_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + trace_ = s; + return s; + } + } + /** + *
+   * Optional. Resource name of the trace associated with the log entry, if any.
+   * If it contains a relative resource name, the name is assumed to be relative
+   * to `//tracing.googleapis.com`. Example:
+   * `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824`
+   * 
+ * + * string trace = 22; + */ + public com.google.protobuf.ByteString + getTraceBytes() { + java.lang.Object ref = trace_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + trace_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SPAN_ID_FIELD_NUMBER = 27; + private volatile java.lang.Object spanId_; + /** + *
+   * Optional. Id of the span within the trace associated with the log entry.
+   * e.g. "0000000000000042"
+   * For Stackdriver trace spans, this is the same format that the Stackdriver
+   * trace API uses.
+   * The ID is a 16-character hexadecimal encoding of an 8-byte array.
+   * 
+ * + * string span_id = 27; + */ + public java.lang.String getSpanId() { + java.lang.Object ref = spanId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + spanId_ = s; + return s; + } + } + /** + *
+   * Optional. Id of the span within the trace associated with the log entry.
+   * e.g. "0000000000000042"
+   * For Stackdriver trace spans, this is the same format that the Stackdriver
+   * trace API uses.
+   * The ID is a 16-character hexadecimal encoding of an 8-byte array.
+   * 
+ * + * string span_id = 27; + */ + public com.google.protobuf.ByteString + getSpanIdBytes() { + java.lang.Object ref = spanId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + spanId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SOURCE_LOCATION_FIELD_NUMBER = 23; + private com.google.logging.v2.LogEntrySourceLocation sourceLocation_; + /** + *
+   * Optional. Source code location information associated with the log entry,
+   * if any.
+   * 
+ * + * .google.logging.v2.LogEntrySourceLocation source_location = 23; + */ + public boolean hasSourceLocation() { + return sourceLocation_ != null; + } + /** + *
+   * Optional. Source code location information associated with the log entry,
+   * if any.
+   * 
+ * + * .google.logging.v2.LogEntrySourceLocation source_location = 23; + */ + public com.google.logging.v2.LogEntrySourceLocation getSourceLocation() { + return sourceLocation_ == null ? com.google.logging.v2.LogEntrySourceLocation.getDefaultInstance() : sourceLocation_; + } + /** + *
+   * Optional. Source code location information associated with the log entry,
+   * if any.
+   * 
+ * + * .google.logging.v2.LogEntrySourceLocation source_location = 23; + */ + public com.google.logging.v2.LogEntrySourceLocationOrBuilder getSourceLocationOrBuilder() { + return getSourceLocation(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (payloadCase_ == 2) { + output.writeMessage(2, (com.google.protobuf.Any) payload_); + } + if (payloadCase_ == 3) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, payload_); + } + if (!getInsertIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, insertId_); + } + if (payloadCase_ == 6) { + output.writeMessage(6, (com.google.protobuf.Struct) payload_); + } + if (httpRequest_ != null) { + output.writeMessage(7, getHttpRequest()); + } + if (resource_ != null) { + output.writeMessage(8, getResource()); + } + if (timestamp_ != null) { + output.writeMessage(9, getTimestamp()); + } + if (severity_ != com.google.logging.type.LogSeverity.DEFAULT.getNumber()) { + output.writeEnum(10, severity_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetLabels(), + LabelsDefaultEntryHolder.defaultEntry, + 11); + if (!getLogNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 12, logName_); + } + if (operation_ != null) { + output.writeMessage(15, getOperation()); + } + if (!getTraceBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 22, trace_); + } + if (sourceLocation_ != null) { + output.writeMessage(23, getSourceLocation()); + } + if (receiveTimestamp_ != null) { + output.writeMessage(24, getReceiveTimestamp()); + } + if (!getSpanIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 27, spanId_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (payloadCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, (com.google.protobuf.Any) payload_); + } + if (payloadCase_ == 3) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, payload_); + } + if (!getInsertIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, insertId_); + } + if (payloadCase_ == 6) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, (com.google.protobuf.Struct) payload_); + } + if (httpRequest_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, getHttpRequest()); + } + if (resource_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, getResource()); + } + if (timestamp_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(9, getTimestamp()); + } + if (severity_ != com.google.logging.type.LogSeverity.DEFAULT.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(10, severity_); + } + for (java.util.Map.Entry entry + : internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry + labels__ = LabelsDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(11, labels__); + } + if (!getLogNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, logName_); + } + if (operation_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(15, getOperation()); + } + if (!getTraceBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(22, trace_); + } + if (sourceLocation_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(23, getSourceLocation()); + } + if (receiveTimestamp_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(24, getReceiveTimestamp()); + } + if (!getSpanIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(27, spanId_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.logging.v2.LogEntry)) { + return super.equals(obj); + } + com.google.logging.v2.LogEntry other = (com.google.logging.v2.LogEntry) obj; + + boolean result = true; + result = result && getLogName() + .equals(other.getLogName()); + result = result && (hasResource() == other.hasResource()); + if (hasResource()) { + result = result && getResource() + .equals(other.getResource()); + } + result = result && (hasTimestamp() == other.hasTimestamp()); + if (hasTimestamp()) { + result = result && getTimestamp() + .equals(other.getTimestamp()); + } + result = result && (hasReceiveTimestamp() == other.hasReceiveTimestamp()); + if (hasReceiveTimestamp()) { + result = result && getReceiveTimestamp() + .equals(other.getReceiveTimestamp()); + } + result = result && severity_ == other.severity_; + result = result && getInsertId() + .equals(other.getInsertId()); + result = result && (hasHttpRequest() == other.hasHttpRequest()); + if (hasHttpRequest()) { + result = result && getHttpRequest() + .equals(other.getHttpRequest()); + } + result = result && internalGetLabels().equals( + other.internalGetLabels()); + result = result && (hasOperation() == other.hasOperation()); + if (hasOperation()) { + result = result && getOperation() + .equals(other.getOperation()); + } + result = result && getTrace() + .equals(other.getTrace()); + result = result && getSpanId() + .equals(other.getSpanId()); + result = result && (hasSourceLocation() == other.hasSourceLocation()); + if (hasSourceLocation()) { + result = result && getSourceLocation() + .equals(other.getSourceLocation()); + } + result = result && getPayloadCase().equals( + other.getPayloadCase()); + if (!result) return false; + switch (payloadCase_) { + case 2: + result = result && getProtoPayload() + .equals(other.getProtoPayload()); + break; + case 3: + result = result && getTextPayload() + .equals(other.getTextPayload()); + break; + case 6: + result = result && getJsonPayload() + .equals(other.getJsonPayload()); + break; + case 0: + default: + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + LOG_NAME_FIELD_NUMBER; + hash = (53 * hash) + getLogName().hashCode(); + if (hasResource()) { + hash = (37 * hash) + RESOURCE_FIELD_NUMBER; + hash = (53 * hash) + getResource().hashCode(); + } + if (hasTimestamp()) { + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + getTimestamp().hashCode(); + } + if (hasReceiveTimestamp()) { + hash = (37 * hash) + RECEIVE_TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + getReceiveTimestamp().hashCode(); + } + hash = (37 * hash) + SEVERITY_FIELD_NUMBER; + hash = (53 * hash) + severity_; + hash = (37 * hash) + INSERT_ID_FIELD_NUMBER; + hash = (53 * hash) + getInsertId().hashCode(); + if (hasHttpRequest()) { + hash = (37 * hash) + HTTP_REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getHttpRequest().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + if (hasOperation()) { + hash = (37 * hash) + OPERATION_FIELD_NUMBER; + hash = (53 * hash) + getOperation().hashCode(); + } + hash = (37 * hash) + TRACE_FIELD_NUMBER; + hash = (53 * hash) + getTrace().hashCode(); + hash = (37 * hash) + SPAN_ID_FIELD_NUMBER; + hash = (53 * hash) + getSpanId().hashCode(); + if (hasSourceLocation()) { + hash = (37 * hash) + SOURCE_LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getSourceLocation().hashCode(); + } + switch (payloadCase_) { + case 2: + hash = (37 * hash) + PROTO_PAYLOAD_FIELD_NUMBER; + hash = (53 * hash) + getProtoPayload().hashCode(); + break; + case 3: + hash = (37 * hash) + TEXT_PAYLOAD_FIELD_NUMBER; + hash = (53 * hash) + getTextPayload().hashCode(); + break; + case 6: + hash = (37 * hash) + JSON_PAYLOAD_FIELD_NUMBER; + hash = (53 * hash) + getJsonPayload().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.LogEntry parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.LogEntry parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.LogEntry parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.LogEntry parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.LogEntry parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.LogEntry parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.LogEntry parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.LogEntry parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.LogEntry parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.logging.v2.LogEntry parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.LogEntry parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.LogEntry parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.logging.v2.LogEntry prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * An individual entry in a log.
+   * 
+ * + * Protobuf type {@code google.logging.v2.LogEntry} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.LogEntry) + com.google.logging.v2.LogEntryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LogEntryProto.internal_static_google_logging_v2_LogEntry_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 11: + return internalGetLabels(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 11: + return internalGetMutableLabels(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LogEntryProto.internal_static_google_logging_v2_LogEntry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.LogEntry.class, com.google.logging.v2.LogEntry.Builder.class); + } + + // Construct using com.google.logging.v2.LogEntry.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + logName_ = ""; + + if (resourceBuilder_ == null) { + resource_ = null; + } else { + resource_ = null; + resourceBuilder_ = null; + } + if (timestampBuilder_ == null) { + timestamp_ = null; + } else { + timestamp_ = null; + timestampBuilder_ = null; + } + if (receiveTimestampBuilder_ == null) { + receiveTimestamp_ = null; + } else { + receiveTimestamp_ = null; + receiveTimestampBuilder_ = null; + } + severity_ = 0; + + insertId_ = ""; + + if (httpRequestBuilder_ == null) { + httpRequest_ = null; + } else { + httpRequest_ = null; + httpRequestBuilder_ = null; + } + internalGetMutableLabels().clear(); + if (operationBuilder_ == null) { + operation_ = null; + } else { + operation_ = null; + operationBuilder_ = null; + } + trace_ = ""; + + spanId_ = ""; + + if (sourceLocationBuilder_ == null) { + sourceLocation_ = null; + } else { + sourceLocation_ = null; + sourceLocationBuilder_ = null; + } + payloadCase_ = 0; + payload_ = null; + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.logging.v2.LogEntryProto.internal_static_google_logging_v2_LogEntry_descriptor; + } + + public com.google.logging.v2.LogEntry getDefaultInstanceForType() { + return com.google.logging.v2.LogEntry.getDefaultInstance(); + } + + public com.google.logging.v2.LogEntry build() { + com.google.logging.v2.LogEntry result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.logging.v2.LogEntry buildPartial() { + com.google.logging.v2.LogEntry result = new com.google.logging.v2.LogEntry(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.logName_ = logName_; + if (resourceBuilder_ == null) { + result.resource_ = resource_; + } else { + result.resource_ = resourceBuilder_.build(); + } + if (payloadCase_ == 2) { + if (protoPayloadBuilder_ == null) { + result.payload_ = payload_; + } else { + result.payload_ = protoPayloadBuilder_.build(); + } + } + if (payloadCase_ == 3) { + result.payload_ = payload_; + } + if (payloadCase_ == 6) { + if (jsonPayloadBuilder_ == null) { + result.payload_ = payload_; + } else { + result.payload_ = jsonPayloadBuilder_.build(); + } + } + if (timestampBuilder_ == null) { + result.timestamp_ = timestamp_; + } else { + result.timestamp_ = timestampBuilder_.build(); + } + if (receiveTimestampBuilder_ == null) { + result.receiveTimestamp_ = receiveTimestamp_; + } else { + result.receiveTimestamp_ = receiveTimestampBuilder_.build(); + } + result.severity_ = severity_; + result.insertId_ = insertId_; + if (httpRequestBuilder_ == null) { + result.httpRequest_ = httpRequest_; + } else { + result.httpRequest_ = httpRequestBuilder_.build(); + } + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + if (operationBuilder_ == null) { + result.operation_ = operation_; + } else { + result.operation_ = operationBuilder_.build(); + } + result.trace_ = trace_; + result.spanId_ = spanId_; + if (sourceLocationBuilder_ == null) { + result.sourceLocation_ = sourceLocation_; + } else { + result.sourceLocation_ = sourceLocationBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + result.payloadCase_ = payloadCase_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.logging.v2.LogEntry) { + return mergeFrom((com.google.logging.v2.LogEntry)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.LogEntry other) { + if (other == com.google.logging.v2.LogEntry.getDefaultInstance()) return this; + if (!other.getLogName().isEmpty()) { + logName_ = other.logName_; + onChanged(); + } + if (other.hasResource()) { + mergeResource(other.getResource()); + } + if (other.hasTimestamp()) { + mergeTimestamp(other.getTimestamp()); + } + if (other.hasReceiveTimestamp()) { + mergeReceiveTimestamp(other.getReceiveTimestamp()); + } + if (other.severity_ != 0) { + setSeverityValue(other.getSeverityValue()); + } + if (!other.getInsertId().isEmpty()) { + insertId_ = other.insertId_; + onChanged(); + } + if (other.hasHttpRequest()) { + mergeHttpRequest(other.getHttpRequest()); + } + internalGetMutableLabels().mergeFrom( + other.internalGetLabels()); + if (other.hasOperation()) { + mergeOperation(other.getOperation()); + } + if (!other.getTrace().isEmpty()) { + trace_ = other.trace_; + onChanged(); + } + if (!other.getSpanId().isEmpty()) { + spanId_ = other.spanId_; + onChanged(); + } + if (other.hasSourceLocation()) { + mergeSourceLocation(other.getSourceLocation()); + } + switch (other.getPayloadCase()) { + case PROTO_PAYLOAD: { + mergeProtoPayload(other.getProtoPayload()); + break; + } + case TEXT_PAYLOAD: { + payloadCase_ = 3; + payload_ = other.payload_; + onChanged(); + break; + } + case JSON_PAYLOAD: { + mergeJsonPayload(other.getJsonPayload()); + break; + } + case PAYLOAD_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.logging.v2.LogEntry parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.logging.v2.LogEntry) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int payloadCase_ = 0; + private java.lang.Object payload_; + public PayloadCase + getPayloadCase() { + return PayloadCase.forNumber( + payloadCase_); + } + + public Builder clearPayload() { + payloadCase_ = 0; + payload_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object logName_ = ""; + /** + *
+     * Required. The resource name of the log to which this log entry belongs:
+     *     "projects/[PROJECT_ID]/logs/[LOG_ID]"
+     *     "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
+     *     "folders/[FOLDER_ID]/logs/[LOG_ID]"
+     *  A project number may optionally be used in place of PROJECT_ID. The
+     *  project number is translated to its corresponding PROJECT_ID internally
+     *  and the `log_name` field will contain PROJECT_ID in queries and exports.
+     * `[LOG_ID]` must be URL-encoded within `log_name`. Example:
+     * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+     * `[LOG_ID]` must be less than 512 characters long and can only include the
+     * following characters: upper and lower case alphanumeric characters,
+     * forward-slash, underscore, hyphen, and period.
+     * For backward compatibility, if `log_name` begins with a forward-slash, such
+     * as `/projects/...`, then the log entry is ingested as usual but the
+     * forward-slash is removed. Listing the log entry will not show the leading
+     * slash and filtering for a log name with a leading slash will never return
+     * any results.
+     * 
+ * + * string log_name = 12; + */ + public java.lang.String getLogName() { + java.lang.Object ref = logName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + logName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The resource name of the log to which this log entry belongs:
+     *     "projects/[PROJECT_ID]/logs/[LOG_ID]"
+     *     "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
+     *     "folders/[FOLDER_ID]/logs/[LOG_ID]"
+     *  A project number may optionally be used in place of PROJECT_ID. The
+     *  project number is translated to its corresponding PROJECT_ID internally
+     *  and the `log_name` field will contain PROJECT_ID in queries and exports.
+     * `[LOG_ID]` must be URL-encoded within `log_name`. Example:
+     * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+     * `[LOG_ID]` must be less than 512 characters long and can only include the
+     * following characters: upper and lower case alphanumeric characters,
+     * forward-slash, underscore, hyphen, and period.
+     * For backward compatibility, if `log_name` begins with a forward-slash, such
+     * as `/projects/...`, then the log entry is ingested as usual but the
+     * forward-slash is removed. Listing the log entry will not show the leading
+     * slash and filtering for a log name with a leading slash will never return
+     * any results.
+     * 
+ * + * string log_name = 12; + */ + public com.google.protobuf.ByteString + getLogNameBytes() { + java.lang.Object ref = logName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + logName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The resource name of the log to which this log entry belongs:
+     *     "projects/[PROJECT_ID]/logs/[LOG_ID]"
+     *     "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
+     *     "folders/[FOLDER_ID]/logs/[LOG_ID]"
+     *  A project number may optionally be used in place of PROJECT_ID. The
+     *  project number is translated to its corresponding PROJECT_ID internally
+     *  and the `log_name` field will contain PROJECT_ID in queries and exports.
+     * `[LOG_ID]` must be URL-encoded within `log_name`. Example:
+     * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+     * `[LOG_ID]` must be less than 512 characters long and can only include the
+     * following characters: upper and lower case alphanumeric characters,
+     * forward-slash, underscore, hyphen, and period.
+     * For backward compatibility, if `log_name` begins with a forward-slash, such
+     * as `/projects/...`, then the log entry is ingested as usual but the
+     * forward-slash is removed. Listing the log entry will not show the leading
+     * slash and filtering for a log name with a leading slash will never return
+     * any results.
+     * 
+ * + * string log_name = 12; + */ + public Builder setLogName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + logName_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The resource name of the log to which this log entry belongs:
+     *     "projects/[PROJECT_ID]/logs/[LOG_ID]"
+     *     "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
+     *     "folders/[FOLDER_ID]/logs/[LOG_ID]"
+     *  A project number may optionally be used in place of PROJECT_ID. The
+     *  project number is translated to its corresponding PROJECT_ID internally
+     *  and the `log_name` field will contain PROJECT_ID in queries and exports.
+     * `[LOG_ID]` must be URL-encoded within `log_name`. Example:
+     * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+     * `[LOG_ID]` must be less than 512 characters long and can only include the
+     * following characters: upper and lower case alphanumeric characters,
+     * forward-slash, underscore, hyphen, and period.
+     * For backward compatibility, if `log_name` begins with a forward-slash, such
+     * as `/projects/...`, then the log entry is ingested as usual but the
+     * forward-slash is removed. Listing the log entry will not show the leading
+     * slash and filtering for a log name with a leading slash will never return
+     * any results.
+     * 
+ * + * string log_name = 12; + */ + public Builder clearLogName() { + + logName_ = getDefaultInstance().getLogName(); + onChanged(); + return this; + } + /** + *
+     * Required. The resource name of the log to which this log entry belongs:
+     *     "projects/[PROJECT_ID]/logs/[LOG_ID]"
+     *     "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
+     *     "folders/[FOLDER_ID]/logs/[LOG_ID]"
+     *  A project number may optionally be used in place of PROJECT_ID. The
+     *  project number is translated to its corresponding PROJECT_ID internally
+     *  and the `log_name` field will contain PROJECT_ID in queries and exports.
+     * `[LOG_ID]` must be URL-encoded within `log_name`. Example:
+     * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+     * `[LOG_ID]` must be less than 512 characters long and can only include the
+     * following characters: upper and lower case alphanumeric characters,
+     * forward-slash, underscore, hyphen, and period.
+     * For backward compatibility, if `log_name` begins with a forward-slash, such
+     * as `/projects/...`, then the log entry is ingested as usual but the
+     * forward-slash is removed. Listing the log entry will not show the leading
+     * slash and filtering for a log name with a leading slash will never return
+     * any results.
+     * 
+ * + * string log_name = 12; + */ + public Builder setLogNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + logName_ = value; + onChanged(); + return this; + } + + private com.google.api.MonitoredResource resource_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.MonitoredResource, com.google.api.MonitoredResource.Builder, com.google.api.MonitoredResourceOrBuilder> resourceBuilder_; + /** + *
+     * Required. The monitored resource associated with this log entry.
+     * Example: a log entry that reports a database error would be
+     * associated with the monitored resource designating the particular
+     * database that reported the error.
+     * 
+ * + * .google.api.MonitoredResource resource = 8; + */ + public boolean hasResource() { + return resourceBuilder_ != null || resource_ != null; + } + /** + *
+     * Required. The monitored resource associated with this log entry.
+     * Example: a log entry that reports a database error would be
+     * associated with the monitored resource designating the particular
+     * database that reported the error.
+     * 
+ * + * .google.api.MonitoredResource resource = 8; + */ + public com.google.api.MonitoredResource getResource() { + if (resourceBuilder_ == null) { + return resource_ == null ? com.google.api.MonitoredResource.getDefaultInstance() : resource_; + } else { + return resourceBuilder_.getMessage(); + } + } + /** + *
+     * Required. The monitored resource associated with this log entry.
+     * Example: a log entry that reports a database error would be
+     * associated with the monitored resource designating the particular
+     * database that reported the error.
+     * 
+ * + * .google.api.MonitoredResource resource = 8; + */ + public Builder setResource(com.google.api.MonitoredResource value) { + if (resourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resource_ = value; + onChanged(); + } else { + resourceBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Required. The monitored resource associated with this log entry.
+     * Example: a log entry that reports a database error would be
+     * associated with the monitored resource designating the particular
+     * database that reported the error.
+     * 
+ * + * .google.api.MonitoredResource resource = 8; + */ + public Builder setResource( + com.google.api.MonitoredResource.Builder builderForValue) { + if (resourceBuilder_ == null) { + resource_ = builderForValue.build(); + onChanged(); + } else { + resourceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Required. The monitored resource associated with this log entry.
+     * Example: a log entry that reports a database error would be
+     * associated with the monitored resource designating the particular
+     * database that reported the error.
+     * 
+ * + * .google.api.MonitoredResource resource = 8; + */ + public Builder mergeResource(com.google.api.MonitoredResource value) { + if (resourceBuilder_ == null) { + if (resource_ != null) { + resource_ = + com.google.api.MonitoredResource.newBuilder(resource_).mergeFrom(value).buildPartial(); + } else { + resource_ = value; + } + onChanged(); + } else { + resourceBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Required. The monitored resource associated with this log entry.
+     * Example: a log entry that reports a database error would be
+     * associated with the monitored resource designating the particular
+     * database that reported the error.
+     * 
+ * + * .google.api.MonitoredResource resource = 8; + */ + public Builder clearResource() { + if (resourceBuilder_ == null) { + resource_ = null; + onChanged(); + } else { + resource_ = null; + resourceBuilder_ = null; + } + + return this; + } + /** + *
+     * Required. The monitored resource associated with this log entry.
+     * Example: a log entry that reports a database error would be
+     * associated with the monitored resource designating the particular
+     * database that reported the error.
+     * 
+ * + * .google.api.MonitoredResource resource = 8; + */ + public com.google.api.MonitoredResource.Builder getResourceBuilder() { + + onChanged(); + return getResourceFieldBuilder().getBuilder(); + } + /** + *
+     * Required. The monitored resource associated with this log entry.
+     * Example: a log entry that reports a database error would be
+     * associated with the monitored resource designating the particular
+     * database that reported the error.
+     * 
+ * + * .google.api.MonitoredResource resource = 8; + */ + public com.google.api.MonitoredResourceOrBuilder getResourceOrBuilder() { + if (resourceBuilder_ != null) { + return resourceBuilder_.getMessageOrBuilder(); + } else { + return resource_ == null ? + com.google.api.MonitoredResource.getDefaultInstance() : resource_; + } + } + /** + *
+     * Required. The monitored resource associated with this log entry.
+     * Example: a log entry that reports a database error would be
+     * associated with the monitored resource designating the particular
+     * database that reported the error.
+     * 
+ * + * .google.api.MonitoredResource resource = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.MonitoredResource, com.google.api.MonitoredResource.Builder, com.google.api.MonitoredResourceOrBuilder> + getResourceFieldBuilder() { + if (resourceBuilder_ == null) { + resourceBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.api.MonitoredResource, com.google.api.MonitoredResource.Builder, com.google.api.MonitoredResourceOrBuilder>( + getResource(), + getParentForChildren(), + isClean()); + resource_ = null; + } + return resourceBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> protoPayloadBuilder_; + /** + *
+     * The log entry payload, represented as a protocol buffer.  Some
+     * Google Cloud Platform services use this field for their log
+     * entry payloads.
+     * 
+ * + * .google.protobuf.Any proto_payload = 2; + */ + public boolean hasProtoPayload() { + return payloadCase_ == 2; + } + /** + *
+     * The log entry payload, represented as a protocol buffer.  Some
+     * Google Cloud Platform services use this field for their log
+     * entry payloads.
+     * 
+ * + * .google.protobuf.Any proto_payload = 2; + */ + public com.google.protobuf.Any getProtoPayload() { + if (protoPayloadBuilder_ == null) { + if (payloadCase_ == 2) { + return (com.google.protobuf.Any) payload_; + } + return com.google.protobuf.Any.getDefaultInstance(); + } else { + if (payloadCase_ == 2) { + return protoPayloadBuilder_.getMessage(); + } + return com.google.protobuf.Any.getDefaultInstance(); + } + } + /** + *
+     * The log entry payload, represented as a protocol buffer.  Some
+     * Google Cloud Platform services use this field for their log
+     * entry payloads.
+     * 
+ * + * .google.protobuf.Any proto_payload = 2; + */ + public Builder setProtoPayload(com.google.protobuf.Any value) { + if (protoPayloadBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + protoPayloadBuilder_.setMessage(value); + } + payloadCase_ = 2; + return this; + } + /** + *
+     * The log entry payload, represented as a protocol buffer.  Some
+     * Google Cloud Platform services use this field for their log
+     * entry payloads.
+     * 
+ * + * .google.protobuf.Any proto_payload = 2; + */ + public Builder setProtoPayload( + com.google.protobuf.Any.Builder builderForValue) { + if (protoPayloadBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + protoPayloadBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 2; + return this; + } + /** + *
+     * The log entry payload, represented as a protocol buffer.  Some
+     * Google Cloud Platform services use this field for their log
+     * entry payloads.
+     * 
+ * + * .google.protobuf.Any proto_payload = 2; + */ + public Builder mergeProtoPayload(com.google.protobuf.Any value) { + if (protoPayloadBuilder_ == null) { + if (payloadCase_ == 2 && + payload_ != com.google.protobuf.Any.getDefaultInstance()) { + payload_ = com.google.protobuf.Any.newBuilder((com.google.protobuf.Any) payload_) + .mergeFrom(value).buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 2) { + protoPayloadBuilder_.mergeFrom(value); + } + protoPayloadBuilder_.setMessage(value); + } + payloadCase_ = 2; + return this; + } + /** + *
+     * The log entry payload, represented as a protocol buffer.  Some
+     * Google Cloud Platform services use this field for their log
+     * entry payloads.
+     * 
+ * + * .google.protobuf.Any proto_payload = 2; + */ + public Builder clearProtoPayload() { + if (protoPayloadBuilder_ == null) { + if (payloadCase_ == 2) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 2) { + payloadCase_ = 0; + payload_ = null; + } + protoPayloadBuilder_.clear(); + } + return this; + } + /** + *
+     * The log entry payload, represented as a protocol buffer.  Some
+     * Google Cloud Platform services use this field for their log
+     * entry payloads.
+     * 
+ * + * .google.protobuf.Any proto_payload = 2; + */ + public com.google.protobuf.Any.Builder getProtoPayloadBuilder() { + return getProtoPayloadFieldBuilder().getBuilder(); + } + /** + *
+     * The log entry payload, represented as a protocol buffer.  Some
+     * Google Cloud Platform services use this field for their log
+     * entry payloads.
+     * 
+ * + * .google.protobuf.Any proto_payload = 2; + */ + public com.google.protobuf.AnyOrBuilder getProtoPayloadOrBuilder() { + if ((payloadCase_ == 2) && (protoPayloadBuilder_ != null)) { + return protoPayloadBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 2) { + return (com.google.protobuf.Any) payload_; + } + return com.google.protobuf.Any.getDefaultInstance(); + } + } + /** + *
+     * The log entry payload, represented as a protocol buffer.  Some
+     * Google Cloud Platform services use this field for their log
+     * entry payloads.
+     * 
+ * + * .google.protobuf.Any proto_payload = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> + getProtoPayloadFieldBuilder() { + if (protoPayloadBuilder_ == null) { + if (!(payloadCase_ == 2)) { + payload_ = com.google.protobuf.Any.getDefaultInstance(); + } + protoPayloadBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder>( + (com.google.protobuf.Any) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 2; + onChanged();; + return protoPayloadBuilder_; + } + + /** + *
+     * The log entry payload, represented as a Unicode string (UTF-8).
+     * 
+ * + * string text_payload = 3; + */ + public java.lang.String getTextPayload() { + java.lang.Object ref = ""; + if (payloadCase_ == 3) { + ref = payload_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (payloadCase_ == 3) { + payload_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The log entry payload, represented as a Unicode string (UTF-8).
+     * 
+ * + * string text_payload = 3; + */ + public com.google.protobuf.ByteString + getTextPayloadBytes() { + java.lang.Object ref = ""; + if (payloadCase_ == 3) { + ref = payload_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (payloadCase_ == 3) { + payload_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The log entry payload, represented as a Unicode string (UTF-8).
+     * 
+ * + * string text_payload = 3; + */ + public Builder setTextPayload( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + payloadCase_ = 3; + payload_ = value; + onChanged(); + return this; + } + /** + *
+     * The log entry payload, represented as a Unicode string (UTF-8).
+     * 
+ * + * string text_payload = 3; + */ + public Builder clearTextPayload() { + if (payloadCase_ == 3) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + return this; + } + /** + *
+     * The log entry payload, represented as a Unicode string (UTF-8).
+     * 
+ * + * string text_payload = 3; + */ + public Builder setTextPayloadBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + payloadCase_ = 3; + payload_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> jsonPayloadBuilder_; + /** + *
+     * The log entry payload, represented as a structure that is
+     * expressed as a JSON object.
+     * 
+ * + * .google.protobuf.Struct json_payload = 6; + */ + public boolean hasJsonPayload() { + return payloadCase_ == 6; + } + /** + *
+     * The log entry payload, represented as a structure that is
+     * expressed as a JSON object.
+     * 
+ * + * .google.protobuf.Struct json_payload = 6; + */ + public com.google.protobuf.Struct getJsonPayload() { + if (jsonPayloadBuilder_ == null) { + if (payloadCase_ == 6) { + return (com.google.protobuf.Struct) payload_; + } + return com.google.protobuf.Struct.getDefaultInstance(); + } else { + if (payloadCase_ == 6) { + return jsonPayloadBuilder_.getMessage(); + } + return com.google.protobuf.Struct.getDefaultInstance(); + } + } + /** + *
+     * The log entry payload, represented as a structure that is
+     * expressed as a JSON object.
+     * 
+ * + * .google.protobuf.Struct json_payload = 6; + */ + public Builder setJsonPayload(com.google.protobuf.Struct value) { + if (jsonPayloadBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + jsonPayloadBuilder_.setMessage(value); + } + payloadCase_ = 6; + return this; + } + /** + *
+     * The log entry payload, represented as a structure that is
+     * expressed as a JSON object.
+     * 
+ * + * .google.protobuf.Struct json_payload = 6; + */ + public Builder setJsonPayload( + com.google.protobuf.Struct.Builder builderForValue) { + if (jsonPayloadBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + jsonPayloadBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 6; + return this; + } + /** + *
+     * The log entry payload, represented as a structure that is
+     * expressed as a JSON object.
+     * 
+ * + * .google.protobuf.Struct json_payload = 6; + */ + public Builder mergeJsonPayload(com.google.protobuf.Struct value) { + if (jsonPayloadBuilder_ == null) { + if (payloadCase_ == 6 && + payload_ != com.google.protobuf.Struct.getDefaultInstance()) { + payload_ = com.google.protobuf.Struct.newBuilder((com.google.protobuf.Struct) payload_) + .mergeFrom(value).buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 6) { + jsonPayloadBuilder_.mergeFrom(value); + } + jsonPayloadBuilder_.setMessage(value); + } + payloadCase_ = 6; + return this; + } + /** + *
+     * The log entry payload, represented as a structure that is
+     * expressed as a JSON object.
+     * 
+ * + * .google.protobuf.Struct json_payload = 6; + */ + public Builder clearJsonPayload() { + if (jsonPayloadBuilder_ == null) { + if (payloadCase_ == 6) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 6) { + payloadCase_ = 0; + payload_ = null; + } + jsonPayloadBuilder_.clear(); + } + return this; + } + /** + *
+     * The log entry payload, represented as a structure that is
+     * expressed as a JSON object.
+     * 
+ * + * .google.protobuf.Struct json_payload = 6; + */ + public com.google.protobuf.Struct.Builder getJsonPayloadBuilder() { + return getJsonPayloadFieldBuilder().getBuilder(); + } + /** + *
+     * The log entry payload, represented as a structure that is
+     * expressed as a JSON object.
+     * 
+ * + * .google.protobuf.Struct json_payload = 6; + */ + public com.google.protobuf.StructOrBuilder getJsonPayloadOrBuilder() { + if ((payloadCase_ == 6) && (jsonPayloadBuilder_ != null)) { + return jsonPayloadBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 6) { + return (com.google.protobuf.Struct) payload_; + } + return com.google.protobuf.Struct.getDefaultInstance(); + } + } + /** + *
+     * The log entry payload, represented as a structure that is
+     * expressed as a JSON object.
+     * 
+ * + * .google.protobuf.Struct json_payload = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> + getJsonPayloadFieldBuilder() { + if (jsonPayloadBuilder_ == null) { + if (!(payloadCase_ == 6)) { + payload_ = com.google.protobuf.Struct.getDefaultInstance(); + } + jsonPayloadBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder>( + (com.google.protobuf.Struct) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 6; + onChanged();; + return jsonPayloadBuilder_; + } + + private com.google.protobuf.Timestamp timestamp_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> timestampBuilder_; + /** + *
+     * Optional. The time the event described by the log entry occurred.
+     * This time is used to compute the log entry's age and to enforce
+     * the logs retention period. If this field is omitted in a new log
+     * entry, then Stackdriver Logging assigns it the current time.
+     * Incoming log entries should have timestamps that are no more than
+     * the [logs retention period](/logging/quota-policy) in the past,
+     * and no more than 24 hours in the future.
+     * See the `entries.write` API method for more information.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 9; + */ + public boolean hasTimestamp() { + return timestampBuilder_ != null || timestamp_ != null; + } + /** + *
+     * Optional. The time the event described by the log entry occurred.
+     * This time is used to compute the log entry's age and to enforce
+     * the logs retention period. If this field is omitted in a new log
+     * entry, then Stackdriver Logging assigns it the current time.
+     * Incoming log entries should have timestamps that are no more than
+     * the [logs retention period](/logging/quota-policy) in the past,
+     * and no more than 24 hours in the future.
+     * See the `entries.write` API method for more information.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 9; + */ + public com.google.protobuf.Timestamp getTimestamp() { + if (timestampBuilder_ == null) { + return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; + } else { + return timestampBuilder_.getMessage(); + } + } + /** + *
+     * Optional. The time the event described by the log entry occurred.
+     * This time is used to compute the log entry's age and to enforce
+     * the logs retention period. If this field is omitted in a new log
+     * entry, then Stackdriver Logging assigns it the current time.
+     * Incoming log entries should have timestamps that are no more than
+     * the [logs retention period](/logging/quota-policy) in the past,
+     * and no more than 24 hours in the future.
+     * See the `entries.write` API method for more information.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 9; + */ + public Builder setTimestamp(com.google.protobuf.Timestamp value) { + if (timestampBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + timestamp_ = value; + onChanged(); + } else { + timestampBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Optional. The time the event described by the log entry occurred.
+     * This time is used to compute the log entry's age and to enforce
+     * the logs retention period. If this field is omitted in a new log
+     * entry, then Stackdriver Logging assigns it the current time.
+     * Incoming log entries should have timestamps that are no more than
+     * the [logs retention period](/logging/quota-policy) in the past,
+     * and no more than 24 hours in the future.
+     * See the `entries.write` API method for more information.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 9; + */ + public Builder setTimestamp( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (timestampBuilder_ == null) { + timestamp_ = builderForValue.build(); + onChanged(); + } else { + timestampBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Optional. The time the event described by the log entry occurred.
+     * This time is used to compute the log entry's age and to enforce
+     * the logs retention period. If this field is omitted in a new log
+     * entry, then Stackdriver Logging assigns it the current time.
+     * Incoming log entries should have timestamps that are no more than
+     * the [logs retention period](/logging/quota-policy) in the past,
+     * and no more than 24 hours in the future.
+     * See the `entries.write` API method for more information.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 9; + */ + public Builder mergeTimestamp(com.google.protobuf.Timestamp value) { + if (timestampBuilder_ == null) { + if (timestamp_ != null) { + timestamp_ = + com.google.protobuf.Timestamp.newBuilder(timestamp_).mergeFrom(value).buildPartial(); + } else { + timestamp_ = value; + } + onChanged(); + } else { + timestampBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Optional. The time the event described by the log entry occurred.
+     * This time is used to compute the log entry's age and to enforce
+     * the logs retention period. If this field is omitted in a new log
+     * entry, then Stackdriver Logging assigns it the current time.
+     * Incoming log entries should have timestamps that are no more than
+     * the [logs retention period](/logging/quota-policy) in the past,
+     * and no more than 24 hours in the future.
+     * See the `entries.write` API method for more information.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 9; + */ + public Builder clearTimestamp() { + if (timestampBuilder_ == null) { + timestamp_ = null; + onChanged(); + } else { + timestamp_ = null; + timestampBuilder_ = null; + } + + return this; + } + /** + *
+     * Optional. The time the event described by the log entry occurred.
+     * This time is used to compute the log entry's age and to enforce
+     * the logs retention period. If this field is omitted in a new log
+     * entry, then Stackdriver Logging assigns it the current time.
+     * Incoming log entries should have timestamps that are no more than
+     * the [logs retention period](/logging/quota-policy) in the past,
+     * and no more than 24 hours in the future.
+     * See the `entries.write` API method for more information.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 9; + */ + public com.google.protobuf.Timestamp.Builder getTimestampBuilder() { + + onChanged(); + return getTimestampFieldBuilder().getBuilder(); + } + /** + *
+     * Optional. The time the event described by the log entry occurred.
+     * This time is used to compute the log entry's age and to enforce
+     * the logs retention period. If this field is omitted in a new log
+     * entry, then Stackdriver Logging assigns it the current time.
+     * Incoming log entries should have timestamps that are no more than
+     * the [logs retention period](/logging/quota-policy) in the past,
+     * and no more than 24 hours in the future.
+     * See the `entries.write` API method for more information.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 9; + */ + public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() { + if (timestampBuilder_ != null) { + return timestampBuilder_.getMessageOrBuilder(); + } else { + return timestamp_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; + } + } + /** + *
+     * Optional. The time the event described by the log entry occurred.
+     * This time is used to compute the log entry's age and to enforce
+     * the logs retention period. If this field is omitted in a new log
+     * entry, then Stackdriver Logging assigns it the current time.
+     * Incoming log entries should have timestamps that are no more than
+     * the [logs retention period](/logging/quota-policy) in the past,
+     * and no more than 24 hours in the future.
+     * See the `entries.write` API method for more information.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getTimestampFieldBuilder() { + if (timestampBuilder_ == null) { + timestampBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getTimestamp(), + getParentForChildren(), + isClean()); + timestamp_ = null; + } + return timestampBuilder_; + } + + private com.google.protobuf.Timestamp receiveTimestamp_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> receiveTimestampBuilder_; + /** + *
+     * Output only. The time the log entry was received by Stackdriver Logging.
+     * 
+ * + * .google.protobuf.Timestamp receive_timestamp = 24; + */ + public boolean hasReceiveTimestamp() { + return receiveTimestampBuilder_ != null || receiveTimestamp_ != null; + } + /** + *
+     * Output only. The time the log entry was received by Stackdriver Logging.
+     * 
+ * + * .google.protobuf.Timestamp receive_timestamp = 24; + */ + public com.google.protobuf.Timestamp getReceiveTimestamp() { + if (receiveTimestampBuilder_ == null) { + return receiveTimestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : receiveTimestamp_; + } else { + return receiveTimestampBuilder_.getMessage(); + } + } + /** + *
+     * Output only. The time the log entry was received by Stackdriver Logging.
+     * 
+ * + * .google.protobuf.Timestamp receive_timestamp = 24; + */ + public Builder setReceiveTimestamp(com.google.protobuf.Timestamp value) { + if (receiveTimestampBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + receiveTimestamp_ = value; + onChanged(); + } else { + receiveTimestampBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Output only. The time the log entry was received by Stackdriver Logging.
+     * 
+ * + * .google.protobuf.Timestamp receive_timestamp = 24; + */ + public Builder setReceiveTimestamp( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (receiveTimestampBuilder_ == null) { + receiveTimestamp_ = builderForValue.build(); + onChanged(); + } else { + receiveTimestampBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Output only. The time the log entry was received by Stackdriver Logging.
+     * 
+ * + * .google.protobuf.Timestamp receive_timestamp = 24; + */ + public Builder mergeReceiveTimestamp(com.google.protobuf.Timestamp value) { + if (receiveTimestampBuilder_ == null) { + if (receiveTimestamp_ != null) { + receiveTimestamp_ = + com.google.protobuf.Timestamp.newBuilder(receiveTimestamp_).mergeFrom(value).buildPartial(); + } else { + receiveTimestamp_ = value; + } + onChanged(); + } else { + receiveTimestampBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Output only. The time the log entry was received by Stackdriver Logging.
+     * 
+ * + * .google.protobuf.Timestamp receive_timestamp = 24; + */ + public Builder clearReceiveTimestamp() { + if (receiveTimestampBuilder_ == null) { + receiveTimestamp_ = null; + onChanged(); + } else { + receiveTimestamp_ = null; + receiveTimestampBuilder_ = null; + } + + return this; + } + /** + *
+     * Output only. The time the log entry was received by Stackdriver Logging.
+     * 
+ * + * .google.protobuf.Timestamp receive_timestamp = 24; + */ + public com.google.protobuf.Timestamp.Builder getReceiveTimestampBuilder() { + + onChanged(); + return getReceiveTimestampFieldBuilder().getBuilder(); + } + /** + *
+     * Output only. The time the log entry was received by Stackdriver Logging.
+     * 
+ * + * .google.protobuf.Timestamp receive_timestamp = 24; + */ + public com.google.protobuf.TimestampOrBuilder getReceiveTimestampOrBuilder() { + if (receiveTimestampBuilder_ != null) { + return receiveTimestampBuilder_.getMessageOrBuilder(); + } else { + return receiveTimestamp_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : receiveTimestamp_; + } + } + /** + *
+     * Output only. The time the log entry was received by Stackdriver Logging.
+     * 
+ * + * .google.protobuf.Timestamp receive_timestamp = 24; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getReceiveTimestampFieldBuilder() { + if (receiveTimestampBuilder_ == null) { + receiveTimestampBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getReceiveTimestamp(), + getParentForChildren(), + isClean()); + receiveTimestamp_ = null; + } + return receiveTimestampBuilder_; + } + + private int severity_ = 0; + /** + *
+     * Optional. The severity of the log entry. The default value is
+     * `LogSeverity.DEFAULT`.
+     * 
+ * + * .google.logging.type.LogSeverity severity = 10; + */ + public int getSeverityValue() { + return severity_; + } + /** + *
+     * Optional. The severity of the log entry. The default value is
+     * `LogSeverity.DEFAULT`.
+     * 
+ * + * .google.logging.type.LogSeverity severity = 10; + */ + public Builder setSeverityValue(int value) { + severity_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. The severity of the log entry. The default value is
+     * `LogSeverity.DEFAULT`.
+     * 
+ * + * .google.logging.type.LogSeverity severity = 10; + */ + public com.google.logging.type.LogSeverity getSeverity() { + com.google.logging.type.LogSeverity result = com.google.logging.type.LogSeverity.valueOf(severity_); + return result == null ? com.google.logging.type.LogSeverity.UNRECOGNIZED : result; + } + /** + *
+     * Optional. The severity of the log entry. The default value is
+     * `LogSeverity.DEFAULT`.
+     * 
+ * + * .google.logging.type.LogSeverity severity = 10; + */ + public Builder setSeverity(com.google.logging.type.LogSeverity value) { + if (value == null) { + throw new NullPointerException(); + } + + severity_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Optional. The severity of the log entry. The default value is
+     * `LogSeverity.DEFAULT`.
+     * 
+ * + * .google.logging.type.LogSeverity severity = 10; + */ + public Builder clearSeverity() { + + severity_ = 0; + onChanged(); + return this; + } + + private java.lang.Object insertId_ = ""; + /** + *
+     * Optional. A unique identifier for the log entry. If you provide a value,
+     * then Stackdriver Logging considers other log entries in the same project,
+     * with the same `timestamp`, and with the same `insert_id` to be duplicates
+     * which can be removed.  If omitted in new log entries, then Stackdriver
+     * Logging assigns its own unique identifier. The `insert_id` is also used
+     * to order log entries that have the same `timestamp` value.
+     * 
+ * + * string insert_id = 4; + */ + public java.lang.String getInsertId() { + java.lang.Object ref = insertId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + insertId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Optional. A unique identifier for the log entry. If you provide a value,
+     * then Stackdriver Logging considers other log entries in the same project,
+     * with the same `timestamp`, and with the same `insert_id` to be duplicates
+     * which can be removed.  If omitted in new log entries, then Stackdriver
+     * Logging assigns its own unique identifier. The `insert_id` is also used
+     * to order log entries that have the same `timestamp` value.
+     * 
+ * + * string insert_id = 4; + */ + public com.google.protobuf.ByteString + getInsertIdBytes() { + java.lang.Object ref = insertId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + insertId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Optional. A unique identifier for the log entry. If you provide a value,
+     * then Stackdriver Logging considers other log entries in the same project,
+     * with the same `timestamp`, and with the same `insert_id` to be duplicates
+     * which can be removed.  If omitted in new log entries, then Stackdriver
+     * Logging assigns its own unique identifier. The `insert_id` is also used
+     * to order log entries that have the same `timestamp` value.
+     * 
+ * + * string insert_id = 4; + */ + public Builder setInsertId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + insertId_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. A unique identifier for the log entry. If you provide a value,
+     * then Stackdriver Logging considers other log entries in the same project,
+     * with the same `timestamp`, and with the same `insert_id` to be duplicates
+     * which can be removed.  If omitted in new log entries, then Stackdriver
+     * Logging assigns its own unique identifier. The `insert_id` is also used
+     * to order log entries that have the same `timestamp` value.
+     * 
+ * + * string insert_id = 4; + */ + public Builder clearInsertId() { + + insertId_ = getDefaultInstance().getInsertId(); + onChanged(); + return this; + } + /** + *
+     * Optional. A unique identifier for the log entry. If you provide a value,
+     * then Stackdriver Logging considers other log entries in the same project,
+     * with the same `timestamp`, and with the same `insert_id` to be duplicates
+     * which can be removed.  If omitted in new log entries, then Stackdriver
+     * Logging assigns its own unique identifier. The `insert_id` is also used
+     * to order log entries that have the same `timestamp` value.
+     * 
+ * + * string insert_id = 4; + */ + public Builder setInsertIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + insertId_ = value; + onChanged(); + return this; + } + + private com.google.logging.type.HttpRequest httpRequest_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.type.HttpRequest, com.google.logging.type.HttpRequest.Builder, com.google.logging.type.HttpRequestOrBuilder> httpRequestBuilder_; + /** + *
+     * Optional. Information about the HTTP request associated with this
+     * log entry, if applicable.
+     * 
+ * + * .google.logging.type.HttpRequest http_request = 7; + */ + public boolean hasHttpRequest() { + return httpRequestBuilder_ != null || httpRequest_ != null; + } + /** + *
+     * Optional. Information about the HTTP request associated with this
+     * log entry, if applicable.
+     * 
+ * + * .google.logging.type.HttpRequest http_request = 7; + */ + public com.google.logging.type.HttpRequest getHttpRequest() { + if (httpRequestBuilder_ == null) { + return httpRequest_ == null ? com.google.logging.type.HttpRequest.getDefaultInstance() : httpRequest_; + } else { + return httpRequestBuilder_.getMessage(); + } + } + /** + *
+     * Optional. Information about the HTTP request associated with this
+     * log entry, if applicable.
+     * 
+ * + * .google.logging.type.HttpRequest http_request = 7; + */ + public Builder setHttpRequest(com.google.logging.type.HttpRequest value) { + if (httpRequestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + httpRequest_ = value; + onChanged(); + } else { + httpRequestBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Optional. Information about the HTTP request associated with this
+     * log entry, if applicable.
+     * 
+ * + * .google.logging.type.HttpRequest http_request = 7; + */ + public Builder setHttpRequest( + com.google.logging.type.HttpRequest.Builder builderForValue) { + if (httpRequestBuilder_ == null) { + httpRequest_ = builderForValue.build(); + onChanged(); + } else { + httpRequestBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Optional. Information about the HTTP request associated with this
+     * log entry, if applicable.
+     * 
+ * + * .google.logging.type.HttpRequest http_request = 7; + */ + public Builder mergeHttpRequest(com.google.logging.type.HttpRequest value) { + if (httpRequestBuilder_ == null) { + if (httpRequest_ != null) { + httpRequest_ = + com.google.logging.type.HttpRequest.newBuilder(httpRequest_).mergeFrom(value).buildPartial(); + } else { + httpRequest_ = value; + } + onChanged(); + } else { + httpRequestBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Optional. Information about the HTTP request associated with this
+     * log entry, if applicable.
+     * 
+ * + * .google.logging.type.HttpRequest http_request = 7; + */ + public Builder clearHttpRequest() { + if (httpRequestBuilder_ == null) { + httpRequest_ = null; + onChanged(); + } else { + httpRequest_ = null; + httpRequestBuilder_ = null; + } + + return this; + } + /** + *
+     * Optional. Information about the HTTP request associated with this
+     * log entry, if applicable.
+     * 
+ * + * .google.logging.type.HttpRequest http_request = 7; + */ + public com.google.logging.type.HttpRequest.Builder getHttpRequestBuilder() { + + onChanged(); + return getHttpRequestFieldBuilder().getBuilder(); + } + /** + *
+     * Optional. Information about the HTTP request associated with this
+     * log entry, if applicable.
+     * 
+ * + * .google.logging.type.HttpRequest http_request = 7; + */ + public com.google.logging.type.HttpRequestOrBuilder getHttpRequestOrBuilder() { + if (httpRequestBuilder_ != null) { + return httpRequestBuilder_.getMessageOrBuilder(); + } else { + return httpRequest_ == null ? + com.google.logging.type.HttpRequest.getDefaultInstance() : httpRequest_; + } + } + /** + *
+     * Optional. Information about the HTTP request associated with this
+     * log entry, if applicable.
+     * 
+ * + * .google.logging.type.HttpRequest http_request = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.type.HttpRequest, com.google.logging.type.HttpRequest.Builder, com.google.logging.type.HttpRequestOrBuilder> + getHttpRequestFieldBuilder() { + if (httpRequestBuilder_ == null) { + httpRequestBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.type.HttpRequest, com.google.logging.type.HttpRequest.Builder, com.google.logging.type.HttpRequestOrBuilder>( + getHttpRequest(), + getParentForChildren(), + isClean()); + httpRequest_ = null; + } + return httpRequestBuilder_; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> labels_; + private com.google.protobuf.MapField + internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField( + LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged();; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField( + LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + *
+     * Optional. A set of user-defined (key, value) data that provides additional
+     * information about the log entry.
+     * 
+ * + * map<string, string> labels = 11; + */ + + public boolean containsLabels( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetLabels().getMap().containsKey(key); + } + /** + * Use {@link #getLabelsMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + *
+     * Optional. A set of user-defined (key, value) data that provides additional
+     * information about the log entry.
+     * 
+ * + * map<string, string> labels = 11; + */ + + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + *
+     * Optional. A set of user-defined (key, value) data that provides additional
+     * information about the log entry.
+     * 
+ * + * map<string, string> labels = 11; + */ + + public java.lang.String getLabelsOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * Optional. A set of user-defined (key, value) data that provides additional
+     * information about the log entry.
+     * 
+ * + * map<string, string> labels = 11; + */ + + public java.lang.String getLabelsOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap() + .clear(); + return this; + } + /** + *
+     * Optional. A set of user-defined (key, value) data that provides additional
+     * information about the log entry.
+     * 
+ * + * map<string, string> labels = 11; + */ + + public Builder removeLabels( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableLabels().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + *
+     * Optional. A set of user-defined (key, value) data that provides additional
+     * information about the log entry.
+     * 
+ * + * map<string, string> labels = 11; + */ + public Builder putLabels( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableLabels().getMutableMap() + .put(key, value); + return this; + } + /** + *
+     * Optional. A set of user-defined (key, value) data that provides additional
+     * information about the log entry.
+     * 
+ * + * map<string, string> labels = 11; + */ + + public Builder putAllLabels( + java.util.Map values) { + internalGetMutableLabels().getMutableMap() + .putAll(values); + return this; + } + + private com.google.logging.v2.LogEntryOperation operation_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogEntryOperation, com.google.logging.v2.LogEntryOperation.Builder, com.google.logging.v2.LogEntryOperationOrBuilder> operationBuilder_; + /** + *
+     * Optional. Information about an operation associated with the log entry, if
+     * applicable.
+     * 
+ * + * .google.logging.v2.LogEntryOperation operation = 15; + */ + public boolean hasOperation() { + return operationBuilder_ != null || operation_ != null; + } + /** + *
+     * Optional. Information about an operation associated with the log entry, if
+     * applicable.
+     * 
+ * + * .google.logging.v2.LogEntryOperation operation = 15; + */ + public com.google.logging.v2.LogEntryOperation getOperation() { + if (operationBuilder_ == null) { + return operation_ == null ? com.google.logging.v2.LogEntryOperation.getDefaultInstance() : operation_; + } else { + return operationBuilder_.getMessage(); + } + } + /** + *
+     * Optional. Information about an operation associated with the log entry, if
+     * applicable.
+     * 
+ * + * .google.logging.v2.LogEntryOperation operation = 15; + */ + public Builder setOperation(com.google.logging.v2.LogEntryOperation value) { + if (operationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + operation_ = value; + onChanged(); + } else { + operationBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Optional. Information about an operation associated with the log entry, if
+     * applicable.
+     * 
+ * + * .google.logging.v2.LogEntryOperation operation = 15; + */ + public Builder setOperation( + com.google.logging.v2.LogEntryOperation.Builder builderForValue) { + if (operationBuilder_ == null) { + operation_ = builderForValue.build(); + onChanged(); + } else { + operationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Optional. Information about an operation associated with the log entry, if
+     * applicable.
+     * 
+ * + * .google.logging.v2.LogEntryOperation operation = 15; + */ + public Builder mergeOperation(com.google.logging.v2.LogEntryOperation value) { + if (operationBuilder_ == null) { + if (operation_ != null) { + operation_ = + com.google.logging.v2.LogEntryOperation.newBuilder(operation_).mergeFrom(value).buildPartial(); + } else { + operation_ = value; + } + onChanged(); + } else { + operationBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Optional. Information about an operation associated with the log entry, if
+     * applicable.
+     * 
+ * + * .google.logging.v2.LogEntryOperation operation = 15; + */ + public Builder clearOperation() { + if (operationBuilder_ == null) { + operation_ = null; + onChanged(); + } else { + operation_ = null; + operationBuilder_ = null; + } + + return this; + } + /** + *
+     * Optional. Information about an operation associated with the log entry, if
+     * applicable.
+     * 
+ * + * .google.logging.v2.LogEntryOperation operation = 15; + */ + public com.google.logging.v2.LogEntryOperation.Builder getOperationBuilder() { + + onChanged(); + return getOperationFieldBuilder().getBuilder(); + } + /** + *
+     * Optional. Information about an operation associated with the log entry, if
+     * applicable.
+     * 
+ * + * .google.logging.v2.LogEntryOperation operation = 15; + */ + public com.google.logging.v2.LogEntryOperationOrBuilder getOperationOrBuilder() { + if (operationBuilder_ != null) { + return operationBuilder_.getMessageOrBuilder(); + } else { + return operation_ == null ? + com.google.logging.v2.LogEntryOperation.getDefaultInstance() : operation_; + } + } + /** + *
+     * Optional. Information about an operation associated with the log entry, if
+     * applicable.
+     * 
+ * + * .google.logging.v2.LogEntryOperation operation = 15; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogEntryOperation, com.google.logging.v2.LogEntryOperation.Builder, com.google.logging.v2.LogEntryOperationOrBuilder> + getOperationFieldBuilder() { + if (operationBuilder_ == null) { + operationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogEntryOperation, com.google.logging.v2.LogEntryOperation.Builder, com.google.logging.v2.LogEntryOperationOrBuilder>( + getOperation(), + getParentForChildren(), + isClean()); + operation_ = null; + } + return operationBuilder_; + } + + private java.lang.Object trace_ = ""; + /** + *
+     * Optional. Resource name of the trace associated with the log entry, if any.
+     * If it contains a relative resource name, the name is assumed to be relative
+     * to `//tracing.googleapis.com`. Example:
+     * `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824`
+     * 
+ * + * string trace = 22; + */ + public java.lang.String getTrace() { + java.lang.Object ref = trace_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + trace_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Optional. Resource name of the trace associated with the log entry, if any.
+     * If it contains a relative resource name, the name is assumed to be relative
+     * to `//tracing.googleapis.com`. Example:
+     * `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824`
+     * 
+ * + * string trace = 22; + */ + public com.google.protobuf.ByteString + getTraceBytes() { + java.lang.Object ref = trace_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + trace_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Optional. Resource name of the trace associated with the log entry, if any.
+     * If it contains a relative resource name, the name is assumed to be relative
+     * to `//tracing.googleapis.com`. Example:
+     * `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824`
+     * 
+ * + * string trace = 22; + */ + public Builder setTrace( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + trace_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. Resource name of the trace associated with the log entry, if any.
+     * If it contains a relative resource name, the name is assumed to be relative
+     * to `//tracing.googleapis.com`. Example:
+     * `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824`
+     * 
+ * + * string trace = 22; + */ + public Builder clearTrace() { + + trace_ = getDefaultInstance().getTrace(); + onChanged(); + return this; + } + /** + *
+     * Optional. Resource name of the trace associated with the log entry, if any.
+     * If it contains a relative resource name, the name is assumed to be relative
+     * to `//tracing.googleapis.com`. Example:
+     * `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824`
+     * 
+ * + * string trace = 22; + */ + public Builder setTraceBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + trace_ = value; + onChanged(); + return this; + } + + private java.lang.Object spanId_ = ""; + /** + *
+     * Optional. Id of the span within the trace associated with the log entry.
+     * e.g. "0000000000000042"
+     * For Stackdriver trace spans, this is the same format that the Stackdriver
+     * trace API uses.
+     * The ID is a 16-character hexadecimal encoding of an 8-byte array.
+     * 
+ * + * string span_id = 27; + */ + public java.lang.String getSpanId() { + java.lang.Object ref = spanId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + spanId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Optional. Id of the span within the trace associated with the log entry.
+     * e.g. "0000000000000042"
+     * For Stackdriver trace spans, this is the same format that the Stackdriver
+     * trace API uses.
+     * The ID is a 16-character hexadecimal encoding of an 8-byte array.
+     * 
+ * + * string span_id = 27; + */ + public com.google.protobuf.ByteString + getSpanIdBytes() { + java.lang.Object ref = spanId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + spanId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Optional. Id of the span within the trace associated with the log entry.
+     * e.g. "0000000000000042"
+     * For Stackdriver trace spans, this is the same format that the Stackdriver
+     * trace API uses.
+     * The ID is a 16-character hexadecimal encoding of an 8-byte array.
+     * 
+ * + * string span_id = 27; + */ + public Builder setSpanId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + spanId_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. Id of the span within the trace associated with the log entry.
+     * e.g. "0000000000000042"
+     * For Stackdriver trace spans, this is the same format that the Stackdriver
+     * trace API uses.
+     * The ID is a 16-character hexadecimal encoding of an 8-byte array.
+     * 
+ * + * string span_id = 27; + */ + public Builder clearSpanId() { + + spanId_ = getDefaultInstance().getSpanId(); + onChanged(); + return this; + } + /** + *
+     * Optional. Id of the span within the trace associated with the log entry.
+     * e.g. "0000000000000042"
+     * For Stackdriver trace spans, this is the same format that the Stackdriver
+     * trace API uses.
+     * The ID is a 16-character hexadecimal encoding of an 8-byte array.
+     * 
+ * + * string span_id = 27; + */ + public Builder setSpanIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + spanId_ = value; + onChanged(); + return this; + } + + private com.google.logging.v2.LogEntrySourceLocation sourceLocation_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogEntrySourceLocation, com.google.logging.v2.LogEntrySourceLocation.Builder, com.google.logging.v2.LogEntrySourceLocationOrBuilder> sourceLocationBuilder_; + /** + *
+     * Optional. Source code location information associated with the log entry,
+     * if any.
+     * 
+ * + * .google.logging.v2.LogEntrySourceLocation source_location = 23; + */ + public boolean hasSourceLocation() { + return sourceLocationBuilder_ != null || sourceLocation_ != null; + } + /** + *
+     * Optional. Source code location information associated with the log entry,
+     * if any.
+     * 
+ * + * .google.logging.v2.LogEntrySourceLocation source_location = 23; + */ + public com.google.logging.v2.LogEntrySourceLocation getSourceLocation() { + if (sourceLocationBuilder_ == null) { + return sourceLocation_ == null ? com.google.logging.v2.LogEntrySourceLocation.getDefaultInstance() : sourceLocation_; + } else { + return sourceLocationBuilder_.getMessage(); + } + } + /** + *
+     * Optional. Source code location information associated with the log entry,
+     * if any.
+     * 
+ * + * .google.logging.v2.LogEntrySourceLocation source_location = 23; + */ + public Builder setSourceLocation(com.google.logging.v2.LogEntrySourceLocation value) { + if (sourceLocationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sourceLocation_ = value; + onChanged(); + } else { + sourceLocationBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Optional. Source code location information associated with the log entry,
+     * if any.
+     * 
+ * + * .google.logging.v2.LogEntrySourceLocation source_location = 23; + */ + public Builder setSourceLocation( + com.google.logging.v2.LogEntrySourceLocation.Builder builderForValue) { + if (sourceLocationBuilder_ == null) { + sourceLocation_ = builderForValue.build(); + onChanged(); + } else { + sourceLocationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Optional. Source code location information associated with the log entry,
+     * if any.
+     * 
+ * + * .google.logging.v2.LogEntrySourceLocation source_location = 23; + */ + public Builder mergeSourceLocation(com.google.logging.v2.LogEntrySourceLocation value) { + if (sourceLocationBuilder_ == null) { + if (sourceLocation_ != null) { + sourceLocation_ = + com.google.logging.v2.LogEntrySourceLocation.newBuilder(sourceLocation_).mergeFrom(value).buildPartial(); + } else { + sourceLocation_ = value; + } + onChanged(); + } else { + sourceLocationBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Optional. Source code location information associated with the log entry,
+     * if any.
+     * 
+ * + * .google.logging.v2.LogEntrySourceLocation source_location = 23; + */ + public Builder clearSourceLocation() { + if (sourceLocationBuilder_ == null) { + sourceLocation_ = null; + onChanged(); + } else { + sourceLocation_ = null; + sourceLocationBuilder_ = null; + } + + return this; + } + /** + *
+     * Optional. Source code location information associated with the log entry,
+     * if any.
+     * 
+ * + * .google.logging.v2.LogEntrySourceLocation source_location = 23; + */ + public com.google.logging.v2.LogEntrySourceLocation.Builder getSourceLocationBuilder() { + + onChanged(); + return getSourceLocationFieldBuilder().getBuilder(); + } + /** + *
+     * Optional. Source code location information associated with the log entry,
+     * if any.
+     * 
+ * + * .google.logging.v2.LogEntrySourceLocation source_location = 23; + */ + public com.google.logging.v2.LogEntrySourceLocationOrBuilder getSourceLocationOrBuilder() { + if (sourceLocationBuilder_ != null) { + return sourceLocationBuilder_.getMessageOrBuilder(); + } else { + return sourceLocation_ == null ? + com.google.logging.v2.LogEntrySourceLocation.getDefaultInstance() : sourceLocation_; + } + } + /** + *
+     * Optional. Source code location information associated with the log entry,
+     * if any.
+     * 
+ * + * .google.logging.v2.LogEntrySourceLocation source_location = 23; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogEntrySourceLocation, com.google.logging.v2.LogEntrySourceLocation.Builder, com.google.logging.v2.LogEntrySourceLocationOrBuilder> + getSourceLocationFieldBuilder() { + if (sourceLocationBuilder_ == null) { + sourceLocationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogEntrySourceLocation, com.google.logging.v2.LogEntrySourceLocation.Builder, com.google.logging.v2.LogEntrySourceLocationOrBuilder>( + getSourceLocation(), + getParentForChildren(), + isClean()); + sourceLocation_ = null; + } + return sourceLocationBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.logging.v2.LogEntry) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.LogEntry) + private static final com.google.logging.v2.LogEntry DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.logging.v2.LogEntry(); + } + + public static com.google.logging.v2.LogEntry getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public LogEntry parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LogEntry(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.logging.v2.LogEntry getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryOperation.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryOperation.java new file mode 100644 index 000000000000..7e96d49f5bf6 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryOperation.java @@ -0,0 +1,880 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/log_entry.proto + +package com.google.logging.v2; + +/** + *
+ * Additional information about a potentially long-running operation with which
+ * a log entry is associated.
+ * 
+ * + * Protobuf type {@code google.logging.v2.LogEntryOperation} + */ +public final class LogEntryOperation extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.logging.v2.LogEntryOperation) + LogEntryOperationOrBuilder { +private static final long serialVersionUID = 0L; + // Use LogEntryOperation.newBuilder() to construct. + private LogEntryOperation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private LogEntryOperation() { + id_ = ""; + producer_ = ""; + first_ = false; + last_ = false; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private LogEntryOperation( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + id_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + producer_ = s; + break; + } + case 24: { + + first_ = input.readBool(); + break; + } + case 32: { + + last_ = input.readBool(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LogEntryProto.internal_static_google_logging_v2_LogEntryOperation_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LogEntryProto.internal_static_google_logging_v2_LogEntryOperation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.LogEntryOperation.class, com.google.logging.v2.LogEntryOperation.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + private volatile java.lang.Object id_; + /** + *
+   * Optional. An arbitrary operation identifier. Log entries with the
+   * same identifier are assumed to be part of the same operation.
+   * 
+ * + * string id = 1; + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } + } + /** + *
+   * Optional. An arbitrary operation identifier. Log entries with the
+   * same identifier are assumed to be part of the same operation.
+   * 
+ * + * string id = 1; + */ + public com.google.protobuf.ByteString + getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRODUCER_FIELD_NUMBER = 2; + private volatile java.lang.Object producer_; + /** + *
+   * Optional. An arbitrary producer identifier. The combination of
+   * `id` and `producer` must be globally unique.  Examples for `producer`:
+   * `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`.
+   * 
+ * + * string producer = 2; + */ + public java.lang.String getProducer() { + java.lang.Object ref = producer_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + producer_ = s; + return s; + } + } + /** + *
+   * Optional. An arbitrary producer identifier. The combination of
+   * `id` and `producer` must be globally unique.  Examples for `producer`:
+   * `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`.
+   * 
+ * + * string producer = 2; + */ + public com.google.protobuf.ByteString + getProducerBytes() { + java.lang.Object ref = producer_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + producer_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FIRST_FIELD_NUMBER = 3; + private boolean first_; + /** + *
+   * Optional. Set this to True if this is the first log entry in the operation.
+   * 
+ * + * bool first = 3; + */ + public boolean getFirst() { + return first_; + } + + public static final int LAST_FIELD_NUMBER = 4; + private boolean last_; + /** + *
+   * Optional. Set this to True if this is the last log entry in the operation.
+   * 
+ * + * bool last = 4; + */ + public boolean getLast() { + return last_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); + } + if (!getProducerBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, producer_); + } + if (first_ != false) { + output.writeBool(3, first_); + } + if (last_ != false) { + output.writeBool(4, last_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + } + if (!getProducerBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, producer_); + } + if (first_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, first_); + } + if (last_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(4, last_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.logging.v2.LogEntryOperation)) { + return super.equals(obj); + } + com.google.logging.v2.LogEntryOperation other = (com.google.logging.v2.LogEntryOperation) obj; + + boolean result = true; + result = result && getId() + .equals(other.getId()); + result = result && getProducer() + .equals(other.getProducer()); + result = result && (getFirst() + == other.getFirst()); + result = result && (getLast() + == other.getLast()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + hash = (37 * hash) + PRODUCER_FIELD_NUMBER; + hash = (53 * hash) + getProducer().hashCode(); + hash = (37 * hash) + FIRST_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getFirst()); + hash = (37 * hash) + LAST_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getLast()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.LogEntryOperation parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.LogEntryOperation parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.LogEntryOperation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.LogEntryOperation parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.LogEntryOperation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.LogEntryOperation parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.LogEntryOperation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.LogEntryOperation parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.LogEntryOperation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.logging.v2.LogEntryOperation parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.LogEntryOperation parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.LogEntryOperation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.logging.v2.LogEntryOperation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Additional information about a potentially long-running operation with which
+   * a log entry is associated.
+   * 
+ * + * Protobuf type {@code google.logging.v2.LogEntryOperation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.LogEntryOperation) + com.google.logging.v2.LogEntryOperationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LogEntryProto.internal_static_google_logging_v2_LogEntryOperation_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LogEntryProto.internal_static_google_logging_v2_LogEntryOperation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.LogEntryOperation.class, com.google.logging.v2.LogEntryOperation.Builder.class); + } + + // Construct using com.google.logging.v2.LogEntryOperation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + id_ = ""; + + producer_ = ""; + + first_ = false; + + last_ = false; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.logging.v2.LogEntryProto.internal_static_google_logging_v2_LogEntryOperation_descriptor; + } + + public com.google.logging.v2.LogEntryOperation getDefaultInstanceForType() { + return com.google.logging.v2.LogEntryOperation.getDefaultInstance(); + } + + public com.google.logging.v2.LogEntryOperation build() { + com.google.logging.v2.LogEntryOperation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.logging.v2.LogEntryOperation buildPartial() { + com.google.logging.v2.LogEntryOperation result = new com.google.logging.v2.LogEntryOperation(this); + result.id_ = id_; + result.producer_ = producer_; + result.first_ = first_; + result.last_ = last_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.logging.v2.LogEntryOperation) { + return mergeFrom((com.google.logging.v2.LogEntryOperation)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.LogEntryOperation other) { + if (other == com.google.logging.v2.LogEntryOperation.getDefaultInstance()) return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + onChanged(); + } + if (!other.getProducer().isEmpty()) { + producer_ = other.producer_; + onChanged(); + } + if (other.getFirst() != false) { + setFirst(other.getFirst()); + } + if (other.getLast() != false) { + setLast(other.getLast()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.logging.v2.LogEntryOperation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.logging.v2.LogEntryOperation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object id_ = ""; + /** + *
+     * Optional. An arbitrary operation identifier. Log entries with the
+     * same identifier are assumed to be part of the same operation.
+     * 
+ * + * string id = 1; + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Optional. An arbitrary operation identifier. Log entries with the
+     * same identifier are assumed to be part of the same operation.
+     * 
+ * + * string id = 1; + */ + public com.google.protobuf.ByteString + getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Optional. An arbitrary operation identifier. Log entries with the
+     * same identifier are assumed to be part of the same operation.
+     * 
+ * + * string id = 1; + */ + public Builder setId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + id_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. An arbitrary operation identifier. Log entries with the
+     * same identifier are assumed to be part of the same operation.
+     * 
+ * + * string id = 1; + */ + public Builder clearId() { + + id_ = getDefaultInstance().getId(); + onChanged(); + return this; + } + /** + *
+     * Optional. An arbitrary operation identifier. Log entries with the
+     * same identifier are assumed to be part of the same operation.
+     * 
+ * + * string id = 1; + */ + public Builder setIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + id_ = value; + onChanged(); + return this; + } + + private java.lang.Object producer_ = ""; + /** + *
+     * Optional. An arbitrary producer identifier. The combination of
+     * `id` and `producer` must be globally unique.  Examples for `producer`:
+     * `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`.
+     * 
+ * + * string producer = 2; + */ + public java.lang.String getProducer() { + java.lang.Object ref = producer_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + producer_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Optional. An arbitrary producer identifier. The combination of
+     * `id` and `producer` must be globally unique.  Examples for `producer`:
+     * `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`.
+     * 
+ * + * string producer = 2; + */ + public com.google.protobuf.ByteString + getProducerBytes() { + java.lang.Object ref = producer_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + producer_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Optional. An arbitrary producer identifier. The combination of
+     * `id` and `producer` must be globally unique.  Examples for `producer`:
+     * `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`.
+     * 
+ * + * string producer = 2; + */ + public Builder setProducer( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + producer_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. An arbitrary producer identifier. The combination of
+     * `id` and `producer` must be globally unique.  Examples for `producer`:
+     * `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`.
+     * 
+ * + * string producer = 2; + */ + public Builder clearProducer() { + + producer_ = getDefaultInstance().getProducer(); + onChanged(); + return this; + } + /** + *
+     * Optional. An arbitrary producer identifier. The combination of
+     * `id` and `producer` must be globally unique.  Examples for `producer`:
+     * `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`.
+     * 
+ * + * string producer = 2; + */ + public Builder setProducerBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + producer_ = value; + onChanged(); + return this; + } + + private boolean first_ ; + /** + *
+     * Optional. Set this to True if this is the first log entry in the operation.
+     * 
+ * + * bool first = 3; + */ + public boolean getFirst() { + return first_; + } + /** + *
+     * Optional. Set this to True if this is the first log entry in the operation.
+     * 
+ * + * bool first = 3; + */ + public Builder setFirst(boolean value) { + + first_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. Set this to True if this is the first log entry in the operation.
+     * 
+ * + * bool first = 3; + */ + public Builder clearFirst() { + + first_ = false; + onChanged(); + return this; + } + + private boolean last_ ; + /** + *
+     * Optional. Set this to True if this is the last log entry in the operation.
+     * 
+ * + * bool last = 4; + */ + public boolean getLast() { + return last_; + } + /** + *
+     * Optional. Set this to True if this is the last log entry in the operation.
+     * 
+ * + * bool last = 4; + */ + public Builder setLast(boolean value) { + + last_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. Set this to True if this is the last log entry in the operation.
+     * 
+ * + * bool last = 4; + */ + public Builder clearLast() { + + last_ = false; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.logging.v2.LogEntryOperation) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.LogEntryOperation) + private static final com.google.logging.v2.LogEntryOperation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.logging.v2.LogEntryOperation(); + } + + public static com.google.logging.v2.LogEntryOperation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public LogEntryOperation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LogEntryOperation(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.logging.v2.LogEntryOperation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryOperationOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryOperationOrBuilder.java new file mode 100644 index 000000000000..b75f018d0aef --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryOperationOrBuilder.java @@ -0,0 +1,69 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/log_entry.proto + +package com.google.logging.v2; + +public interface LogEntryOperationOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.LogEntryOperation) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Optional. An arbitrary operation identifier. Log entries with the
+   * same identifier are assumed to be part of the same operation.
+   * 
+ * + * string id = 1; + */ + java.lang.String getId(); + /** + *
+   * Optional. An arbitrary operation identifier. Log entries with the
+   * same identifier are assumed to be part of the same operation.
+   * 
+ * + * string id = 1; + */ + com.google.protobuf.ByteString + getIdBytes(); + + /** + *
+   * Optional. An arbitrary producer identifier. The combination of
+   * `id` and `producer` must be globally unique.  Examples for `producer`:
+   * `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`.
+   * 
+ * + * string producer = 2; + */ + java.lang.String getProducer(); + /** + *
+   * Optional. An arbitrary producer identifier. The combination of
+   * `id` and `producer` must be globally unique.  Examples for `producer`:
+   * `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`.
+   * 
+ * + * string producer = 2; + */ + com.google.protobuf.ByteString + getProducerBytes(); + + /** + *
+   * Optional. Set this to True if this is the first log entry in the operation.
+   * 
+ * + * bool first = 3; + */ + boolean getFirst(); + + /** + *
+   * Optional. Set this to True if this is the last log entry in the operation.
+   * 
+ * + * bool last = 4; + */ + boolean getLast(); +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryOrBuilder.java new file mode 100644 index 000000000000..76a51956fac4 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryOrBuilder.java @@ -0,0 +1,485 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/log_entry.proto + +package com.google.logging.v2; + +public interface LogEntryOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.LogEntry) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The resource name of the log to which this log entry belongs:
+   *     "projects/[PROJECT_ID]/logs/[LOG_ID]"
+   *     "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
+   *     "folders/[FOLDER_ID]/logs/[LOG_ID]"
+   *  A project number may optionally be used in place of PROJECT_ID. The
+   *  project number is translated to its corresponding PROJECT_ID internally
+   *  and the `log_name` field will contain PROJECT_ID in queries and exports.
+   * `[LOG_ID]` must be URL-encoded within `log_name`. Example:
+   * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+   * `[LOG_ID]` must be less than 512 characters long and can only include the
+   * following characters: upper and lower case alphanumeric characters,
+   * forward-slash, underscore, hyphen, and period.
+   * For backward compatibility, if `log_name` begins with a forward-slash, such
+   * as `/projects/...`, then the log entry is ingested as usual but the
+   * forward-slash is removed. Listing the log entry will not show the leading
+   * slash and filtering for a log name with a leading slash will never return
+   * any results.
+   * 
+ * + * string log_name = 12; + */ + java.lang.String getLogName(); + /** + *
+   * Required. The resource name of the log to which this log entry belongs:
+   *     "projects/[PROJECT_ID]/logs/[LOG_ID]"
+   *     "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
+   *     "folders/[FOLDER_ID]/logs/[LOG_ID]"
+   *  A project number may optionally be used in place of PROJECT_ID. The
+   *  project number is translated to its corresponding PROJECT_ID internally
+   *  and the `log_name` field will contain PROJECT_ID in queries and exports.
+   * `[LOG_ID]` must be URL-encoded within `log_name`. Example:
+   * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+   * `[LOG_ID]` must be less than 512 characters long and can only include the
+   * following characters: upper and lower case alphanumeric characters,
+   * forward-slash, underscore, hyphen, and period.
+   * For backward compatibility, if `log_name` begins with a forward-slash, such
+   * as `/projects/...`, then the log entry is ingested as usual but the
+   * forward-slash is removed. Listing the log entry will not show the leading
+   * slash and filtering for a log name with a leading slash will never return
+   * any results.
+   * 
+ * + * string log_name = 12; + */ + com.google.protobuf.ByteString + getLogNameBytes(); + + /** + *
+   * Required. The monitored resource associated with this log entry.
+   * Example: a log entry that reports a database error would be
+   * associated with the monitored resource designating the particular
+   * database that reported the error.
+   * 
+ * + * .google.api.MonitoredResource resource = 8; + */ + boolean hasResource(); + /** + *
+   * Required. The monitored resource associated with this log entry.
+   * Example: a log entry that reports a database error would be
+   * associated with the monitored resource designating the particular
+   * database that reported the error.
+   * 
+ * + * .google.api.MonitoredResource resource = 8; + */ + com.google.api.MonitoredResource getResource(); + /** + *
+   * Required. The monitored resource associated with this log entry.
+   * Example: a log entry that reports a database error would be
+   * associated with the monitored resource designating the particular
+   * database that reported the error.
+   * 
+ * + * .google.api.MonitoredResource resource = 8; + */ + com.google.api.MonitoredResourceOrBuilder getResourceOrBuilder(); + + /** + *
+   * The log entry payload, represented as a protocol buffer.  Some
+   * Google Cloud Platform services use this field for their log
+   * entry payloads.
+   * 
+ * + * .google.protobuf.Any proto_payload = 2; + */ + boolean hasProtoPayload(); + /** + *
+   * The log entry payload, represented as a protocol buffer.  Some
+   * Google Cloud Platform services use this field for their log
+   * entry payloads.
+   * 
+ * + * .google.protobuf.Any proto_payload = 2; + */ + com.google.protobuf.Any getProtoPayload(); + /** + *
+   * The log entry payload, represented as a protocol buffer.  Some
+   * Google Cloud Platform services use this field for their log
+   * entry payloads.
+   * 
+ * + * .google.protobuf.Any proto_payload = 2; + */ + com.google.protobuf.AnyOrBuilder getProtoPayloadOrBuilder(); + + /** + *
+   * The log entry payload, represented as a Unicode string (UTF-8).
+   * 
+ * + * string text_payload = 3; + */ + java.lang.String getTextPayload(); + /** + *
+   * The log entry payload, represented as a Unicode string (UTF-8).
+   * 
+ * + * string text_payload = 3; + */ + com.google.protobuf.ByteString + getTextPayloadBytes(); + + /** + *
+   * The log entry payload, represented as a structure that is
+   * expressed as a JSON object.
+   * 
+ * + * .google.protobuf.Struct json_payload = 6; + */ + boolean hasJsonPayload(); + /** + *
+   * The log entry payload, represented as a structure that is
+   * expressed as a JSON object.
+   * 
+ * + * .google.protobuf.Struct json_payload = 6; + */ + com.google.protobuf.Struct getJsonPayload(); + /** + *
+   * The log entry payload, represented as a structure that is
+   * expressed as a JSON object.
+   * 
+ * + * .google.protobuf.Struct json_payload = 6; + */ + com.google.protobuf.StructOrBuilder getJsonPayloadOrBuilder(); + + /** + *
+   * Optional. The time the event described by the log entry occurred.
+   * This time is used to compute the log entry's age and to enforce
+   * the logs retention period. If this field is omitted in a new log
+   * entry, then Stackdriver Logging assigns it the current time.
+   * Incoming log entries should have timestamps that are no more than
+   * the [logs retention period](/logging/quota-policy) in the past,
+   * and no more than 24 hours in the future.
+   * See the `entries.write` API method for more information.
+   * 
+ * + * .google.protobuf.Timestamp timestamp = 9; + */ + boolean hasTimestamp(); + /** + *
+   * Optional. The time the event described by the log entry occurred.
+   * This time is used to compute the log entry's age and to enforce
+   * the logs retention period. If this field is omitted in a new log
+   * entry, then Stackdriver Logging assigns it the current time.
+   * Incoming log entries should have timestamps that are no more than
+   * the [logs retention period](/logging/quota-policy) in the past,
+   * and no more than 24 hours in the future.
+   * See the `entries.write` API method for more information.
+   * 
+ * + * .google.protobuf.Timestamp timestamp = 9; + */ + com.google.protobuf.Timestamp getTimestamp(); + /** + *
+   * Optional. The time the event described by the log entry occurred.
+   * This time is used to compute the log entry's age and to enforce
+   * the logs retention period. If this field is omitted in a new log
+   * entry, then Stackdriver Logging assigns it the current time.
+   * Incoming log entries should have timestamps that are no more than
+   * the [logs retention period](/logging/quota-policy) in the past,
+   * and no more than 24 hours in the future.
+   * See the `entries.write` API method for more information.
+   * 
+ * + * .google.protobuf.Timestamp timestamp = 9; + */ + com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder(); + + /** + *
+   * Output only. The time the log entry was received by Stackdriver Logging.
+   * 
+ * + * .google.protobuf.Timestamp receive_timestamp = 24; + */ + boolean hasReceiveTimestamp(); + /** + *
+   * Output only. The time the log entry was received by Stackdriver Logging.
+   * 
+ * + * .google.protobuf.Timestamp receive_timestamp = 24; + */ + com.google.protobuf.Timestamp getReceiveTimestamp(); + /** + *
+   * Output only. The time the log entry was received by Stackdriver Logging.
+   * 
+ * + * .google.protobuf.Timestamp receive_timestamp = 24; + */ + com.google.protobuf.TimestampOrBuilder getReceiveTimestampOrBuilder(); + + /** + *
+   * Optional. The severity of the log entry. The default value is
+   * `LogSeverity.DEFAULT`.
+   * 
+ * + * .google.logging.type.LogSeverity severity = 10; + */ + int getSeverityValue(); + /** + *
+   * Optional. The severity of the log entry. The default value is
+   * `LogSeverity.DEFAULT`.
+   * 
+ * + * .google.logging.type.LogSeverity severity = 10; + */ + com.google.logging.type.LogSeverity getSeverity(); + + /** + *
+   * Optional. A unique identifier for the log entry. If you provide a value,
+   * then Stackdriver Logging considers other log entries in the same project,
+   * with the same `timestamp`, and with the same `insert_id` to be duplicates
+   * which can be removed.  If omitted in new log entries, then Stackdriver
+   * Logging assigns its own unique identifier. The `insert_id` is also used
+   * to order log entries that have the same `timestamp` value.
+   * 
+ * + * string insert_id = 4; + */ + java.lang.String getInsertId(); + /** + *
+   * Optional. A unique identifier for the log entry. If you provide a value,
+   * then Stackdriver Logging considers other log entries in the same project,
+   * with the same `timestamp`, and with the same `insert_id` to be duplicates
+   * which can be removed.  If omitted in new log entries, then Stackdriver
+   * Logging assigns its own unique identifier. The `insert_id` is also used
+   * to order log entries that have the same `timestamp` value.
+   * 
+ * + * string insert_id = 4; + */ + com.google.protobuf.ByteString + getInsertIdBytes(); + + /** + *
+   * Optional. Information about the HTTP request associated with this
+   * log entry, if applicable.
+   * 
+ * + * .google.logging.type.HttpRequest http_request = 7; + */ + boolean hasHttpRequest(); + /** + *
+   * Optional. Information about the HTTP request associated with this
+   * log entry, if applicable.
+   * 
+ * + * .google.logging.type.HttpRequest http_request = 7; + */ + com.google.logging.type.HttpRequest getHttpRequest(); + /** + *
+   * Optional. Information about the HTTP request associated with this
+   * log entry, if applicable.
+   * 
+ * + * .google.logging.type.HttpRequest http_request = 7; + */ + com.google.logging.type.HttpRequestOrBuilder getHttpRequestOrBuilder(); + + /** + *
+   * Optional. A set of user-defined (key, value) data that provides additional
+   * information about the log entry.
+   * 
+ * + * map<string, string> labels = 11; + */ + int getLabelsCount(); + /** + *
+   * Optional. A set of user-defined (key, value) data that provides additional
+   * information about the log entry.
+   * 
+ * + * map<string, string> labels = 11; + */ + boolean containsLabels( + java.lang.String key); + /** + * Use {@link #getLabelsMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getLabels(); + /** + *
+   * Optional. A set of user-defined (key, value) data that provides additional
+   * information about the log entry.
+   * 
+ * + * map<string, string> labels = 11; + */ + java.util.Map + getLabelsMap(); + /** + *
+   * Optional. A set of user-defined (key, value) data that provides additional
+   * information about the log entry.
+   * 
+ * + * map<string, string> labels = 11; + */ + + java.lang.String getLabelsOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + *
+   * Optional. A set of user-defined (key, value) data that provides additional
+   * information about the log entry.
+   * 
+ * + * map<string, string> labels = 11; + */ + + java.lang.String getLabelsOrThrow( + java.lang.String key); + + /** + *
+   * Optional. Information about an operation associated with the log entry, if
+   * applicable.
+   * 
+ * + * .google.logging.v2.LogEntryOperation operation = 15; + */ + boolean hasOperation(); + /** + *
+   * Optional. Information about an operation associated with the log entry, if
+   * applicable.
+   * 
+ * + * .google.logging.v2.LogEntryOperation operation = 15; + */ + com.google.logging.v2.LogEntryOperation getOperation(); + /** + *
+   * Optional. Information about an operation associated with the log entry, if
+   * applicable.
+   * 
+ * + * .google.logging.v2.LogEntryOperation operation = 15; + */ + com.google.logging.v2.LogEntryOperationOrBuilder getOperationOrBuilder(); + + /** + *
+   * Optional. Resource name of the trace associated with the log entry, if any.
+   * If it contains a relative resource name, the name is assumed to be relative
+   * to `//tracing.googleapis.com`. Example:
+   * `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824`
+   * 
+ * + * string trace = 22; + */ + java.lang.String getTrace(); + /** + *
+   * Optional. Resource name of the trace associated with the log entry, if any.
+   * If it contains a relative resource name, the name is assumed to be relative
+   * to `//tracing.googleapis.com`. Example:
+   * `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824`
+   * 
+ * + * string trace = 22; + */ + com.google.protobuf.ByteString + getTraceBytes(); + + /** + *
+   * Optional. Id of the span within the trace associated with the log entry.
+   * e.g. "0000000000000042"
+   * For Stackdriver trace spans, this is the same format that the Stackdriver
+   * trace API uses.
+   * The ID is a 16-character hexadecimal encoding of an 8-byte array.
+   * 
+ * + * string span_id = 27; + */ + java.lang.String getSpanId(); + /** + *
+   * Optional. Id of the span within the trace associated with the log entry.
+   * e.g. "0000000000000042"
+   * For Stackdriver trace spans, this is the same format that the Stackdriver
+   * trace API uses.
+   * The ID is a 16-character hexadecimal encoding of an 8-byte array.
+   * 
+ * + * string span_id = 27; + */ + com.google.protobuf.ByteString + getSpanIdBytes(); + + /** + *
+   * Optional. Source code location information associated with the log entry,
+   * if any.
+   * 
+ * + * .google.logging.v2.LogEntrySourceLocation source_location = 23; + */ + boolean hasSourceLocation(); + /** + *
+   * Optional. Source code location information associated with the log entry,
+   * if any.
+   * 
+ * + * .google.logging.v2.LogEntrySourceLocation source_location = 23; + */ + com.google.logging.v2.LogEntrySourceLocation getSourceLocation(); + /** + *
+   * Optional. Source code location information associated with the log entry,
+   * if any.
+   * 
+ * + * .google.logging.v2.LogEntrySourceLocation source_location = 23; + */ + com.google.logging.v2.LogEntrySourceLocationOrBuilder getSourceLocationOrBuilder(); + + public com.google.logging.v2.LogEntry.PayloadCase getPayloadCase(); +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryProto.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryProto.java new file mode 100644 index 000000000000..1cb256fd6678 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryProto.java @@ -0,0 +1,133 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/log_entry.proto + +package com.google.logging.v2; + +public final class LogEntryProto { + private LogEntryProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_LogEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_LogEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_LogEntry_LabelsEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_LogEntry_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_LogEntryOperation_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_LogEntryOperation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_LogEntrySourceLocation_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_LogEntrySourceLocation_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n!google/logging/v2/log_entry.proto\022\021goo" + + "gle.logging.v2\032\034google/api/annotations.p" + + "roto\032#google/api/monitored_resource.prot" + + "o\032&google/logging/type/http_request.prot" + + "o\032&google/logging/type/log_severity.prot" + + "o\032\031google/protobuf/any.proto\032\034google/pro" + + "tobuf/struct.proto\032\037google/protobuf/time" + + "stamp.proto\"\272\005\n\010LogEntry\022\020\n\010log_name\030\014 \001" + + "(\t\022/\n\010resource\030\010 \001(\0132\035.google.api.Monito" + + "redResource\022-\n\rproto_payload\030\002 \001(\0132\024.goo" + + "gle.protobuf.AnyH\000\022\026\n\014text_payload\030\003 \001(\t" + + "H\000\022/\n\014json_payload\030\006 \001(\0132\027.google.protob" + + "uf.StructH\000\022-\n\ttimestamp\030\t \001(\0132\032.google." + + "protobuf.Timestamp\0225\n\021receive_timestamp\030" + + "\030 \001(\0132\032.google.protobuf.Timestamp\0222\n\010sev" + + "erity\030\n \001(\0162 .google.logging.type.LogSev" + + "erity\022\021\n\tinsert_id\030\004 \001(\t\0226\n\014http_request" + + "\030\007 \001(\0132 .google.logging.type.HttpRequest" + + "\0227\n\006labels\030\013 \003(\0132\'.google.logging.v2.Log" + + "Entry.LabelsEntry\0227\n\toperation\030\017 \001(\0132$.g" + + "oogle.logging.v2.LogEntryOperation\022\r\n\005tr" + + "ace\030\026 \001(\t\022\017\n\007span_id\030\033 \001(\t\022B\n\017source_loc" + + "ation\030\027 \001(\0132).google.logging.v2.LogEntry" + + "SourceLocation\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001" + + "(\t\022\r\n\005value\030\002 \001(\t:\0028\001B\t\n\007payload\"N\n\021LogE" + + "ntryOperation\022\n\n\002id\030\001 \001(\t\022\020\n\010producer\030\002 " + + "\001(\t\022\r\n\005first\030\003 \001(\010\022\014\n\004last\030\004 \001(\010\"F\n\026LogE" + + "ntrySourceLocation\022\014\n\004file\030\001 \001(\t\022\014\n\004line" + + "\030\002 \001(\003\022\020\n\010function\030\003 \001(\tB\231\001\n\025com.google." + + "logging.v2B\rLogEntryProtoP\001Z8google.gola" + + "ng.org/genproto/googleapis/logging/v2;lo" + + "gging\370\001\001\252\002\027Google.Cloud.Logging.V2\312\002\027Goo" + + "gle\\Cloud\\Logging\\V2b\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.MonitoredResourceProto.getDescriptor(), + com.google.logging.type.HttpRequestProto.getDescriptor(), + com.google.logging.type.LogSeverityProto.getDescriptor(), + com.google.protobuf.AnyProto.getDescriptor(), + com.google.protobuf.StructProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }, assigner); + internal_static_google_logging_v2_LogEntry_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_logging_v2_LogEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_LogEntry_descriptor, + new java.lang.String[] { "LogName", "Resource", "ProtoPayload", "TextPayload", "JsonPayload", "Timestamp", "ReceiveTimestamp", "Severity", "InsertId", "HttpRequest", "Labels", "Operation", "Trace", "SpanId", "SourceLocation", "Payload", }); + internal_static_google_logging_v2_LogEntry_LabelsEntry_descriptor = + internal_static_google_logging_v2_LogEntry_descriptor.getNestedTypes().get(0); + internal_static_google_logging_v2_LogEntry_LabelsEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_LogEntry_LabelsEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_google_logging_v2_LogEntryOperation_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_logging_v2_LogEntryOperation_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_LogEntryOperation_descriptor, + new java.lang.String[] { "Id", "Producer", "First", "Last", }); + internal_static_google_logging_v2_LogEntrySourceLocation_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_logging_v2_LogEntrySourceLocation_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_LogEntrySourceLocation_descriptor, + new java.lang.String[] { "File", "Line", "Function", }); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.MonitoredResourceProto.getDescriptor(); + com.google.logging.type.HttpRequestProto.getDescriptor(); + com.google.logging.type.LogSeverityProto.getDescriptor(); + com.google.protobuf.AnyProto.getDescriptor(); + com.google.protobuf.StructProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntrySourceLocation.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntrySourceLocation.java new file mode 100644 index 000000000000..b16f38eb8768 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntrySourceLocation.java @@ -0,0 +1,830 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/log_entry.proto + +package com.google.logging.v2; + +/** + *
+ * Additional information about the source code location that produced the log
+ * entry.
+ * 
+ * + * Protobuf type {@code google.logging.v2.LogEntrySourceLocation} + */ +public final class LogEntrySourceLocation extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.logging.v2.LogEntrySourceLocation) + LogEntrySourceLocationOrBuilder { +private static final long serialVersionUID = 0L; + // Use LogEntrySourceLocation.newBuilder() to construct. + private LogEntrySourceLocation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private LogEntrySourceLocation() { + file_ = ""; + line_ = 0L; + function_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private LogEntrySourceLocation( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + file_ = s; + break; + } + case 16: { + + line_ = input.readInt64(); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + function_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LogEntryProto.internal_static_google_logging_v2_LogEntrySourceLocation_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LogEntryProto.internal_static_google_logging_v2_LogEntrySourceLocation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.LogEntrySourceLocation.class, com.google.logging.v2.LogEntrySourceLocation.Builder.class); + } + + public static final int FILE_FIELD_NUMBER = 1; + private volatile java.lang.Object file_; + /** + *
+   * Optional. Source file name. Depending on the runtime environment, this
+   * might be a simple name or a fully-qualified name.
+   * 
+ * + * string file = 1; + */ + public java.lang.String getFile() { + java.lang.Object ref = file_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + file_ = s; + return s; + } + } + /** + *
+   * Optional. Source file name. Depending on the runtime environment, this
+   * might be a simple name or a fully-qualified name.
+   * 
+ * + * string file = 1; + */ + public com.google.protobuf.ByteString + getFileBytes() { + java.lang.Object ref = file_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + file_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LINE_FIELD_NUMBER = 2; + private long line_; + /** + *
+   * Optional. Line within the source file. 1-based; 0 indicates no line number
+   * available.
+   * 
+ * + * int64 line = 2; + */ + public long getLine() { + return line_; + } + + public static final int FUNCTION_FIELD_NUMBER = 3; + private volatile java.lang.Object function_; + /** + *
+   * Optional. Human-readable name of the function or method being invoked, with
+   * optional context such as the class or package name. This information may be
+   * used in contexts such as the logs viewer, where a file and line number are
+   * less meaningful. The format can vary by language. For example:
+   * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function`
+   * (Python).
+   * 
+ * + * string function = 3; + */ + public java.lang.String getFunction() { + java.lang.Object ref = function_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + function_ = s; + return s; + } + } + /** + *
+   * Optional. Human-readable name of the function or method being invoked, with
+   * optional context such as the class or package name. This information may be
+   * used in contexts such as the logs viewer, where a file and line number are
+   * less meaningful. The format can vary by language. For example:
+   * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function`
+   * (Python).
+   * 
+ * + * string function = 3; + */ + public com.google.protobuf.ByteString + getFunctionBytes() { + java.lang.Object ref = function_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + function_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getFileBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, file_); + } + if (line_ != 0L) { + output.writeInt64(2, line_); + } + if (!getFunctionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, function_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getFileBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, file_); + } + if (line_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, line_); + } + if (!getFunctionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, function_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.logging.v2.LogEntrySourceLocation)) { + return super.equals(obj); + } + com.google.logging.v2.LogEntrySourceLocation other = (com.google.logging.v2.LogEntrySourceLocation) obj; + + boolean result = true; + result = result && getFile() + .equals(other.getFile()); + result = result && (getLine() + == other.getLine()); + result = result && getFunction() + .equals(other.getFunction()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + FILE_FIELD_NUMBER; + hash = (53 * hash) + getFile().hashCode(); + hash = (37 * hash) + LINE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getLine()); + hash = (37 * hash) + FUNCTION_FIELD_NUMBER; + hash = (53 * hash) + getFunction().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.LogEntrySourceLocation parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.LogEntrySourceLocation parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.LogEntrySourceLocation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.LogEntrySourceLocation parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.LogEntrySourceLocation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.LogEntrySourceLocation parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.LogEntrySourceLocation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.LogEntrySourceLocation parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.LogEntrySourceLocation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.logging.v2.LogEntrySourceLocation parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.LogEntrySourceLocation parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.LogEntrySourceLocation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.logging.v2.LogEntrySourceLocation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Additional information about the source code location that produced the log
+   * entry.
+   * 
+ * + * Protobuf type {@code google.logging.v2.LogEntrySourceLocation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.LogEntrySourceLocation) + com.google.logging.v2.LogEntrySourceLocationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LogEntryProto.internal_static_google_logging_v2_LogEntrySourceLocation_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LogEntryProto.internal_static_google_logging_v2_LogEntrySourceLocation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.LogEntrySourceLocation.class, com.google.logging.v2.LogEntrySourceLocation.Builder.class); + } + + // Construct using com.google.logging.v2.LogEntrySourceLocation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + file_ = ""; + + line_ = 0L; + + function_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.logging.v2.LogEntryProto.internal_static_google_logging_v2_LogEntrySourceLocation_descriptor; + } + + public com.google.logging.v2.LogEntrySourceLocation getDefaultInstanceForType() { + return com.google.logging.v2.LogEntrySourceLocation.getDefaultInstance(); + } + + public com.google.logging.v2.LogEntrySourceLocation build() { + com.google.logging.v2.LogEntrySourceLocation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.logging.v2.LogEntrySourceLocation buildPartial() { + com.google.logging.v2.LogEntrySourceLocation result = new com.google.logging.v2.LogEntrySourceLocation(this); + result.file_ = file_; + result.line_ = line_; + result.function_ = function_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.logging.v2.LogEntrySourceLocation) { + return mergeFrom((com.google.logging.v2.LogEntrySourceLocation)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.LogEntrySourceLocation other) { + if (other == com.google.logging.v2.LogEntrySourceLocation.getDefaultInstance()) return this; + if (!other.getFile().isEmpty()) { + file_ = other.file_; + onChanged(); + } + if (other.getLine() != 0L) { + setLine(other.getLine()); + } + if (!other.getFunction().isEmpty()) { + function_ = other.function_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.logging.v2.LogEntrySourceLocation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.logging.v2.LogEntrySourceLocation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object file_ = ""; + /** + *
+     * Optional. Source file name. Depending on the runtime environment, this
+     * might be a simple name or a fully-qualified name.
+     * 
+ * + * string file = 1; + */ + public java.lang.String getFile() { + java.lang.Object ref = file_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + file_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Optional. Source file name. Depending on the runtime environment, this
+     * might be a simple name or a fully-qualified name.
+     * 
+ * + * string file = 1; + */ + public com.google.protobuf.ByteString + getFileBytes() { + java.lang.Object ref = file_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + file_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Optional. Source file name. Depending on the runtime environment, this
+     * might be a simple name or a fully-qualified name.
+     * 
+ * + * string file = 1; + */ + public Builder setFile( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + file_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. Source file name. Depending on the runtime environment, this
+     * might be a simple name or a fully-qualified name.
+     * 
+ * + * string file = 1; + */ + public Builder clearFile() { + + file_ = getDefaultInstance().getFile(); + onChanged(); + return this; + } + /** + *
+     * Optional. Source file name. Depending on the runtime environment, this
+     * might be a simple name or a fully-qualified name.
+     * 
+ * + * string file = 1; + */ + public Builder setFileBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + file_ = value; + onChanged(); + return this; + } + + private long line_ ; + /** + *
+     * Optional. Line within the source file. 1-based; 0 indicates no line number
+     * available.
+     * 
+ * + * int64 line = 2; + */ + public long getLine() { + return line_; + } + /** + *
+     * Optional. Line within the source file. 1-based; 0 indicates no line number
+     * available.
+     * 
+ * + * int64 line = 2; + */ + public Builder setLine(long value) { + + line_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. Line within the source file. 1-based; 0 indicates no line number
+     * available.
+     * 
+ * + * int64 line = 2; + */ + public Builder clearLine() { + + line_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object function_ = ""; + /** + *
+     * Optional. Human-readable name of the function or method being invoked, with
+     * optional context such as the class or package name. This information may be
+     * used in contexts such as the logs viewer, where a file and line number are
+     * less meaningful. The format can vary by language. For example:
+     * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function`
+     * (Python).
+     * 
+ * + * string function = 3; + */ + public java.lang.String getFunction() { + java.lang.Object ref = function_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + function_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Optional. Human-readable name of the function or method being invoked, with
+     * optional context such as the class or package name. This information may be
+     * used in contexts such as the logs viewer, where a file and line number are
+     * less meaningful. The format can vary by language. For example:
+     * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function`
+     * (Python).
+     * 
+ * + * string function = 3; + */ + public com.google.protobuf.ByteString + getFunctionBytes() { + java.lang.Object ref = function_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + function_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Optional. Human-readable name of the function or method being invoked, with
+     * optional context such as the class or package name. This information may be
+     * used in contexts such as the logs viewer, where a file and line number are
+     * less meaningful. The format can vary by language. For example:
+     * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function`
+     * (Python).
+     * 
+ * + * string function = 3; + */ + public Builder setFunction( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + function_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. Human-readable name of the function or method being invoked, with
+     * optional context such as the class or package name. This information may be
+     * used in contexts such as the logs viewer, where a file and line number are
+     * less meaningful. The format can vary by language. For example:
+     * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function`
+     * (Python).
+     * 
+ * + * string function = 3; + */ + public Builder clearFunction() { + + function_ = getDefaultInstance().getFunction(); + onChanged(); + return this; + } + /** + *
+     * Optional. Human-readable name of the function or method being invoked, with
+     * optional context such as the class or package name. This information may be
+     * used in contexts such as the logs viewer, where a file and line number are
+     * less meaningful. The format can vary by language. For example:
+     * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function`
+     * (Python).
+     * 
+ * + * string function = 3; + */ + public Builder setFunctionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + function_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.logging.v2.LogEntrySourceLocation) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.LogEntrySourceLocation) + private static final com.google.logging.v2.LogEntrySourceLocation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.logging.v2.LogEntrySourceLocation(); + } + + public static com.google.logging.v2.LogEntrySourceLocation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public LogEntrySourceLocation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LogEntrySourceLocation(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.logging.v2.LogEntrySourceLocation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntrySourceLocationOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntrySourceLocationOrBuilder.java new file mode 100644 index 000000000000..a22fbc33b826 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntrySourceLocationOrBuilder.java @@ -0,0 +1,67 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/log_entry.proto + +package com.google.logging.v2; + +public interface LogEntrySourceLocationOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.LogEntrySourceLocation) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Optional. Source file name. Depending on the runtime environment, this
+   * might be a simple name or a fully-qualified name.
+   * 
+ * + * string file = 1; + */ + java.lang.String getFile(); + /** + *
+   * Optional. Source file name. Depending on the runtime environment, this
+   * might be a simple name or a fully-qualified name.
+   * 
+ * + * string file = 1; + */ + com.google.protobuf.ByteString + getFileBytes(); + + /** + *
+   * Optional. Line within the source file. 1-based; 0 indicates no line number
+   * available.
+   * 
+ * + * int64 line = 2; + */ + long getLine(); + + /** + *
+   * Optional. Human-readable name of the function or method being invoked, with
+   * optional context such as the class or package name. This information may be
+   * used in contexts such as the logs viewer, where a file and line number are
+   * less meaningful. The format can vary by language. For example:
+   * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function`
+   * (Python).
+   * 
+ * + * string function = 3; + */ + java.lang.String getFunction(); + /** + *
+   * Optional. Human-readable name of the function or method being invoked, with
+   * optional context such as the class or package name. This information may be
+   * used in contexts such as the logs viewer, where a file and line number are
+   * less meaningful. The format can vary by language. For example:
+   * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function`
+   * (Python).
+   * 
+ * + * string function = 3; + */ + com.google.protobuf.ByteString + getFunctionBytes(); +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogExclusion.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogExclusion.java new file mode 100644 index 000000000000..d33cc0862eee --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogExclusion.java @@ -0,0 +1,1022 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_config.proto + +package com.google.logging.v2; + +/** + *
+ * Specifies a set of log entries that are not to be stored in Stackdriver
+ * Logging. If your project receives a large volume of logs, you might be able
+ * to use exclusions to reduce your chargeable logs. Exclusions are processed
+ * after log sinks, so you can export log entries before they are excluded.
+ * Audit log entries and log entries from Amazon Web Services are never
+ * excluded.
+ * 
+ * + * Protobuf type {@code google.logging.v2.LogExclusion} + */ +public final class LogExclusion extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.logging.v2.LogExclusion) + LogExclusionOrBuilder { +private static final long serialVersionUID = 0L; + // Use LogExclusion.newBuilder() to construct. + private LogExclusion(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private LogExclusion() { + name_ = ""; + description_ = ""; + filter_ = ""; + disabled_ = false; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private LogExclusion( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 32: { + + disabled_ = input.readBool(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_LogExclusion_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_LogExclusion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.LogExclusion.class, com.google.logging.v2.LogExclusion.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Required. A client-assigned identifier, such as
+   * `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and
+   * can include only letters, digits, underscores, hyphens, and periods.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * Required. A client-assigned identifier, such as
+   * `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and
+   * can include only letters, digits, underscores, hyphens, and periods.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 2; + private volatile java.lang.Object description_; + /** + *
+   * Optional. A description of this exclusion.
+   * 
+ * + * string description = 2; + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + *
+   * Optional. A description of this exclusion.
+   * 
+ * + * string description = 2; + */ + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 3; + private volatile java.lang.Object filter_; + /** + *
+   * Required.
+   * An [advanced logs filter](/logging/docs/view/advanced_filters)
+   * that matches the log entries to be excluded. By using the
+   * [sample function](/logging/docs/view/advanced_filters#sample),
+   * you can exclude less than 100% of the matching log entries.
+   * For example, the following filter matches 99% of low-severity log
+   * entries from load balancers:
+   *     "resource.type=http_load_balancer severity<ERROR sample(insertId, 0.99)"
+   * 
+ * + * string filter = 3; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + *
+   * Required.
+   * An [advanced logs filter](/logging/docs/view/advanced_filters)
+   * that matches the log entries to be excluded. By using the
+   * [sample function](/logging/docs/view/advanced_filters#sample),
+   * you can exclude less than 100% of the matching log entries.
+   * For example, the following filter matches 99% of low-severity log
+   * entries from load balancers:
+   *     "resource.type=http_load_balancer severity<ERROR sample(insertId, 0.99)"
+   * 
+ * + * string filter = 3; + */ + public com.google.protobuf.ByteString + getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISABLED_FIELD_NUMBER = 4; + private boolean disabled_; + /** + *
+   * Optional. If set to True, then this exclusion is disabled and it does not
+   * exclude any log entries. You can use
+   * [exclusions.patch](/logging/docs/alpha-exclusion/docs/reference/v2/rest/v2/projects.exclusions/patch)
+   * to change the value of this field.
+   * 
+ * + * bool disabled = 4; + */ + public boolean getDisabled() { + return disabled_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, filter_); + } + if (disabled_ != false) { + output.writeBool(4, disabled_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, filter_); + } + if (disabled_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(4, disabled_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.logging.v2.LogExclusion)) { + return super.equals(obj); + } + com.google.logging.v2.LogExclusion other = (com.google.logging.v2.LogExclusion) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && getDescription() + .equals(other.getDescription()); + result = result && getFilter() + .equals(other.getFilter()); + result = result && (getDisabled() + == other.getDisabled()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + DISABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getDisabled()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.LogExclusion parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.LogExclusion parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.LogExclusion parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.LogExclusion parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.LogExclusion parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.LogExclusion parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.LogExclusion parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.LogExclusion parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.LogExclusion parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.logging.v2.LogExclusion parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.LogExclusion parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.LogExclusion parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.logging.v2.LogExclusion prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Specifies a set of log entries that are not to be stored in Stackdriver
+   * Logging. If your project receives a large volume of logs, you might be able
+   * to use exclusions to reduce your chargeable logs. Exclusions are processed
+   * after log sinks, so you can export log entries before they are excluded.
+   * Audit log entries and log entries from Amazon Web Services are never
+   * excluded.
+   * 
+ * + * Protobuf type {@code google.logging.v2.LogExclusion} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.LogExclusion) + com.google.logging.v2.LogExclusionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_LogExclusion_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_LogExclusion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.LogExclusion.class, com.google.logging.v2.LogExclusion.Builder.class); + } + + // Construct using com.google.logging.v2.LogExclusion.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + name_ = ""; + + description_ = ""; + + filter_ = ""; + + disabled_ = false; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_LogExclusion_descriptor; + } + + public com.google.logging.v2.LogExclusion getDefaultInstanceForType() { + return com.google.logging.v2.LogExclusion.getDefaultInstance(); + } + + public com.google.logging.v2.LogExclusion build() { + com.google.logging.v2.LogExclusion result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.logging.v2.LogExclusion buildPartial() { + com.google.logging.v2.LogExclusion result = new com.google.logging.v2.LogExclusion(this); + result.name_ = name_; + result.description_ = description_; + result.filter_ = filter_; + result.disabled_ = disabled_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.logging.v2.LogExclusion) { + return mergeFrom((com.google.logging.v2.LogExclusion)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.LogExclusion other) { + if (other == com.google.logging.v2.LogExclusion.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (other.getDisabled() != false) { + setDisabled(other.getDisabled()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.logging.v2.LogExclusion parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.logging.v2.LogExclusion) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * Required. A client-assigned identifier, such as
+     * `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and
+     * can include only letters, digits, underscores, hyphens, and periods.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. A client-assigned identifier, such as
+     * `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and
+     * can include only letters, digits, underscores, hyphens, and periods.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. A client-assigned identifier, such as
+     * `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and
+     * can include only letters, digits, underscores, hyphens, and periods.
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. A client-assigned identifier, such as
+     * `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and
+     * can include only letters, digits, underscores, hyphens, and periods.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Required. A client-assigned identifier, such as
+     * `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and
+     * can include only letters, digits, underscores, hyphens, and periods.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + *
+     * Optional. A description of this exclusion.
+     * 
+ * + * string description = 2; + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Optional. A description of this exclusion.
+     * 
+ * + * string description = 2; + */ + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Optional. A description of this exclusion.
+     * 
+ * + * string description = 2; + */ + public Builder setDescription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. A description of this exclusion.
+     * 
+ * + * string description = 2; + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + *
+     * Optional. A description of this exclusion.
+     * 
+ * + * string description = 2; + */ + public Builder setDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + *
+     * Required.
+     * An [advanced logs filter](/logging/docs/view/advanced_filters)
+     * that matches the log entries to be excluded. By using the
+     * [sample function](/logging/docs/view/advanced_filters#sample),
+     * you can exclude less than 100% of the matching log entries.
+     * For example, the following filter matches 99% of low-severity log
+     * entries from load balancers:
+     *     "resource.type=http_load_balancer severity<ERROR sample(insertId, 0.99)"
+     * 
+ * + * string filter = 3; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required.
+     * An [advanced logs filter](/logging/docs/view/advanced_filters)
+     * that matches the log entries to be excluded. By using the
+     * [sample function](/logging/docs/view/advanced_filters#sample),
+     * you can exclude less than 100% of the matching log entries.
+     * For example, the following filter matches 99% of low-severity log
+     * entries from load balancers:
+     *     "resource.type=http_load_balancer severity<ERROR sample(insertId, 0.99)"
+     * 
+ * + * string filter = 3; + */ + public com.google.protobuf.ByteString + getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required.
+     * An [advanced logs filter](/logging/docs/view/advanced_filters)
+     * that matches the log entries to be excluded. By using the
+     * [sample function](/logging/docs/view/advanced_filters#sample),
+     * you can exclude less than 100% of the matching log entries.
+     * For example, the following filter matches 99% of low-severity log
+     * entries from load balancers:
+     *     "resource.type=http_load_balancer severity<ERROR sample(insertId, 0.99)"
+     * 
+ * + * string filter = 3; + */ + public Builder setFilter( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + *
+     * Required.
+     * An [advanced logs filter](/logging/docs/view/advanced_filters)
+     * that matches the log entries to be excluded. By using the
+     * [sample function](/logging/docs/view/advanced_filters#sample),
+     * you can exclude less than 100% of the matching log entries.
+     * For example, the following filter matches 99% of low-severity log
+     * entries from load balancers:
+     *     "resource.type=http_load_balancer severity<ERROR sample(insertId, 0.99)"
+     * 
+ * + * string filter = 3; + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + *
+     * Required.
+     * An [advanced logs filter](/logging/docs/view/advanced_filters)
+     * that matches the log entries to be excluded. By using the
+     * [sample function](/logging/docs/view/advanced_filters#sample),
+     * you can exclude less than 100% of the matching log entries.
+     * For example, the following filter matches 99% of low-severity log
+     * entries from load balancers:
+     *     "resource.type=http_load_balancer severity<ERROR sample(insertId, 0.99)"
+     * 
+ * + * string filter = 3; + */ + public Builder setFilterBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private boolean disabled_ ; + /** + *
+     * Optional. If set to True, then this exclusion is disabled and it does not
+     * exclude any log entries. You can use
+     * [exclusions.patch](/logging/docs/alpha-exclusion/docs/reference/v2/rest/v2/projects.exclusions/patch)
+     * to change the value of this field.
+     * 
+ * + * bool disabled = 4; + */ + public boolean getDisabled() { + return disabled_; + } + /** + *
+     * Optional. If set to True, then this exclusion is disabled and it does not
+     * exclude any log entries. You can use
+     * [exclusions.patch](/logging/docs/alpha-exclusion/docs/reference/v2/rest/v2/projects.exclusions/patch)
+     * to change the value of this field.
+     * 
+ * + * bool disabled = 4; + */ + public Builder setDisabled(boolean value) { + + disabled_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. If set to True, then this exclusion is disabled and it does not
+     * exclude any log entries. You can use
+     * [exclusions.patch](/logging/docs/alpha-exclusion/docs/reference/v2/rest/v2/projects.exclusions/patch)
+     * to change the value of this field.
+     * 
+ * + * bool disabled = 4; + */ + public Builder clearDisabled() { + + disabled_ = false; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.logging.v2.LogExclusion) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.LogExclusion) + private static final com.google.logging.v2.LogExclusion DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.logging.v2.LogExclusion(); + } + + public static com.google.logging.v2.LogExclusion getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public LogExclusion parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LogExclusion(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.logging.v2.LogExclusion getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogExclusionOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogExclusionOrBuilder.java new file mode 100644 index 000000000000..bf36ceb70d05 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogExclusionOrBuilder.java @@ -0,0 +1,93 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_config.proto + +package com.google.logging.v2; + +public interface LogExclusionOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.LogExclusion) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. A client-assigned identifier, such as
+   * `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and
+   * can include only letters, digits, underscores, hyphens, and periods.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * Required. A client-assigned identifier, such as
+   * `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and
+   * can include only letters, digits, underscores, hyphens, and periods.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * Optional. A description of this exclusion.
+   * 
+ * + * string description = 2; + */ + java.lang.String getDescription(); + /** + *
+   * Optional. A description of this exclusion.
+   * 
+ * + * string description = 2; + */ + com.google.protobuf.ByteString + getDescriptionBytes(); + + /** + *
+   * Required.
+   * An [advanced logs filter](/logging/docs/view/advanced_filters)
+   * that matches the log entries to be excluded. By using the
+   * [sample function](/logging/docs/view/advanced_filters#sample),
+   * you can exclude less than 100% of the matching log entries.
+   * For example, the following filter matches 99% of low-severity log
+   * entries from load balancers:
+   *     "resource.type=http_load_balancer severity<ERROR sample(insertId, 0.99)"
+   * 
+ * + * string filter = 3; + */ + java.lang.String getFilter(); + /** + *
+   * Required.
+   * An [advanced logs filter](/logging/docs/view/advanced_filters)
+   * that matches the log entries to be excluded. By using the
+   * [sample function](/logging/docs/view/advanced_filters#sample),
+   * you can exclude less than 100% of the matching log entries.
+   * For example, the following filter matches 99% of low-severity log
+   * entries from load balancers:
+   *     "resource.type=http_load_balancer severity<ERROR sample(insertId, 0.99)"
+   * 
+ * + * string filter = 3; + */ + com.google.protobuf.ByteString + getFilterBytes(); + + /** + *
+   * Optional. If set to True, then this exclusion is disabled and it does not
+   * exclude any log entries. You can use
+   * [exclusions.patch](/logging/docs/alpha-exclusion/docs/reference/v2/rest/v2/projects.exclusions/patch)
+   * to change the value of this field.
+   * 
+ * + * bool disabled = 4; + */ + boolean getDisabled(); +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogMetric.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogMetric.java new file mode 100644 index 000000000000..5002a5c06523 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogMetric.java @@ -0,0 +1,2603 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_metrics.proto + +package com.google.logging.v2; + +/** + *
+ * Describes a logs-based metric.  The value of the metric is the
+ * number of log entries that match a logs filter in a given time interval.
+ * Logs-based metric can also be used to extract values from logs and create a
+ * a distribution of the values. The distribution records the statistics of the
+ * extracted values along with an optional histogram of the values as specified
+ * by the bucket options.
+ * 
+ * + * Protobuf type {@code google.logging.v2.LogMetric} + */ +public final class LogMetric extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.logging.v2.LogMetric) + LogMetricOrBuilder { +private static final long serialVersionUID = 0L; + // Use LogMetric.newBuilder() to construct. + private LogMetric(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private LogMetric() { + name_ = ""; + description_ = ""; + filter_ = ""; + valueExtractor_ = ""; + version_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private LogMetric( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 32: { + int rawValue = input.readEnum(); + + version_ = rawValue; + break; + } + case 42: { + com.google.api.MetricDescriptor.Builder subBuilder = null; + if (metricDescriptor_ != null) { + subBuilder = metricDescriptor_.toBuilder(); + } + metricDescriptor_ = input.readMessage(com.google.api.MetricDescriptor.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(metricDescriptor_); + metricDescriptor_ = subBuilder.buildPartial(); + } + + break; + } + case 50: { + java.lang.String s = input.readStringRequireUtf8(); + + valueExtractor_ = s; + break; + } + case 58: { + if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + labelExtractors_ = com.google.protobuf.MapField.newMapField( + LabelExtractorsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000020; + } + com.google.protobuf.MapEntry + labelExtractors__ = input.readMessage( + LabelExtractorsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labelExtractors_.getMutableMap().put( + labelExtractors__.getKey(), labelExtractors__.getValue()); + break; + } + case 66: { + com.google.api.Distribution.BucketOptions.Builder subBuilder = null; + if (bucketOptions_ != null) { + subBuilder = bucketOptions_.toBuilder(); + } + bucketOptions_ = input.readMessage(com.google.api.Distribution.BucketOptions.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(bucketOptions_); + bucketOptions_ = subBuilder.buildPartial(); + } + + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingMetricsProto.internal_static_google_logging_v2_LogMetric_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 7: + return internalGetLabelExtractors(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingMetricsProto.internal_static_google_logging_v2_LogMetric_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.LogMetric.class, com.google.logging.v2.LogMetric.Builder.class); + } + + /** + *
+   * Stackdriver Logging API version.
+   * 
+ * + * Protobuf enum {@code google.logging.v2.LogMetric.ApiVersion} + */ + public enum ApiVersion + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * Stackdriver Logging API v2.
+     * 
+ * + * V2 = 0; + */ + V2(0), + /** + *
+     * Stackdriver Logging API v1.
+     * 
+ * + * V1 = 1; + */ + V1(1), + UNRECOGNIZED(-1), + ; + + /** + *
+     * Stackdriver Logging API v2.
+     * 
+ * + * V2 = 0; + */ + public static final int V2_VALUE = 0; + /** + *
+     * Stackdriver Logging API v1.
+     * 
+ * + * V1 = 1; + */ + public static final int V1_VALUE = 1; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ApiVersion valueOf(int value) { + return forNumber(value); + } + + public static ApiVersion forNumber(int value) { + switch (value) { + case 0: return V2; + case 1: return V1; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + ApiVersion> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ApiVersion findValueByNumber(int number) { + return ApiVersion.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return com.google.logging.v2.LogMetric.getDescriptor().getEnumTypes().get(0); + } + + private static final ApiVersion[] VALUES = values(); + + public static ApiVersion valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ApiVersion(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.logging.v2.LogMetric.ApiVersion) + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Required. The client-assigned metric identifier.
+   * Examples: `"error_count"`, `"nginx/requests"`.
+   * Metric identifiers are limited to 100 characters and can include
+   * only the following characters: `A-Z`, `a-z`, `0-9`, and the
+   * special characters `_-.,+!*',()%/`.  The forward-slash character
+   * (`/`) denotes a hierarchy of name pieces, and it cannot be the
+   * first character of the name.
+   * The metric identifier in this field must not be
+   * [URL-encoded](https://en.wikipedia.org/wiki/Percent-encoding).
+   * However, when the metric identifier appears as the `[METRIC_ID]`
+   * part of a `metric_name` API parameter, then the metric identifier
+   * must be URL-encoded. Example:
+   * `"projects/my-project/metrics/nginx%2Frequests"`.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * Required. The client-assigned metric identifier.
+   * Examples: `"error_count"`, `"nginx/requests"`.
+   * Metric identifiers are limited to 100 characters and can include
+   * only the following characters: `A-Z`, `a-z`, `0-9`, and the
+   * special characters `_-.,+!*',()%/`.  The forward-slash character
+   * (`/`) denotes a hierarchy of name pieces, and it cannot be the
+   * first character of the name.
+   * The metric identifier in this field must not be
+   * [URL-encoded](https://en.wikipedia.org/wiki/Percent-encoding).
+   * However, when the metric identifier appears as the `[METRIC_ID]`
+   * part of a `metric_name` API parameter, then the metric identifier
+   * must be URL-encoded. Example:
+   * `"projects/my-project/metrics/nginx%2Frequests"`.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 2; + private volatile java.lang.Object description_; + /** + *
+   * Optional. A description of this metric, which is used in documentation.
+   * 
+ * + * string description = 2; + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + *
+   * Optional. A description of this metric, which is used in documentation.
+   * 
+ * + * string description = 2; + */ + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 3; + private volatile java.lang.Object filter_; + /** + *
+   * Required. An [advanced logs filter](/logging/docs/view/advanced_filters)
+   * which is used to match log entries.
+   * Example:
+   *     "resource.type=gae_app AND severity>=ERROR"
+   * The maximum length of the filter is 20000 characters.
+   * 
+ * + * string filter = 3; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + *
+   * Required. An [advanced logs filter](/logging/docs/view/advanced_filters)
+   * which is used to match log entries.
+   * Example:
+   *     "resource.type=gae_app AND severity>=ERROR"
+   * The maximum length of the filter is 20000 characters.
+   * 
+ * + * string filter = 3; + */ + public com.google.protobuf.ByteString + getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int METRIC_DESCRIPTOR_FIELD_NUMBER = 5; + private com.google.api.MetricDescriptor metricDescriptor_; + /** + *
+   * Optional. The metric descriptor associated with the logs-based metric.
+   * If unspecified, it uses a default metric descriptor with a DELTA metric
+   * kind, INT64 value type, with no labels and a unit of "1". Such a metric
+   * counts the number of log entries matching the `filter` expression.
+   * The `name`, `type`, and `description` fields in the `metric_descriptor`
+   * are output only, and is constructed using the `name` and `description`
+   * field in the LogMetric.
+   * To create a logs-based metric that records a distribution of log values, a
+   * DELTA metric kind with a DISTRIBUTION value type must be used along with
+   * a `value_extractor` expression in the LogMetric.
+   * Each label in the metric descriptor must have a matching label
+   * name as the key and an extractor expression as the value in the
+   * `label_extractors` map.
+   * The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot
+   * be updated once initially configured. New labels can be added in the
+   * `metric_descriptor`, but existing labels cannot be modified except for
+   * their description.
+   * 
+ * + * .google.api.MetricDescriptor metric_descriptor = 5; + */ + public boolean hasMetricDescriptor() { + return metricDescriptor_ != null; + } + /** + *
+   * Optional. The metric descriptor associated with the logs-based metric.
+   * If unspecified, it uses a default metric descriptor with a DELTA metric
+   * kind, INT64 value type, with no labels and a unit of "1". Such a metric
+   * counts the number of log entries matching the `filter` expression.
+   * The `name`, `type`, and `description` fields in the `metric_descriptor`
+   * are output only, and is constructed using the `name` and `description`
+   * field in the LogMetric.
+   * To create a logs-based metric that records a distribution of log values, a
+   * DELTA metric kind with a DISTRIBUTION value type must be used along with
+   * a `value_extractor` expression in the LogMetric.
+   * Each label in the metric descriptor must have a matching label
+   * name as the key and an extractor expression as the value in the
+   * `label_extractors` map.
+   * The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot
+   * be updated once initially configured. New labels can be added in the
+   * `metric_descriptor`, but existing labels cannot be modified except for
+   * their description.
+   * 
+ * + * .google.api.MetricDescriptor metric_descriptor = 5; + */ + public com.google.api.MetricDescriptor getMetricDescriptor() { + return metricDescriptor_ == null ? com.google.api.MetricDescriptor.getDefaultInstance() : metricDescriptor_; + } + /** + *
+   * Optional. The metric descriptor associated with the logs-based metric.
+   * If unspecified, it uses a default metric descriptor with a DELTA metric
+   * kind, INT64 value type, with no labels and a unit of "1". Such a metric
+   * counts the number of log entries matching the `filter` expression.
+   * The `name`, `type`, and `description` fields in the `metric_descriptor`
+   * are output only, and is constructed using the `name` and `description`
+   * field in the LogMetric.
+   * To create a logs-based metric that records a distribution of log values, a
+   * DELTA metric kind with a DISTRIBUTION value type must be used along with
+   * a `value_extractor` expression in the LogMetric.
+   * Each label in the metric descriptor must have a matching label
+   * name as the key and an extractor expression as the value in the
+   * `label_extractors` map.
+   * The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot
+   * be updated once initially configured. New labels can be added in the
+   * `metric_descriptor`, but existing labels cannot be modified except for
+   * their description.
+   * 
+ * + * .google.api.MetricDescriptor metric_descriptor = 5; + */ + public com.google.api.MetricDescriptorOrBuilder getMetricDescriptorOrBuilder() { + return getMetricDescriptor(); + } + + public static final int VALUE_EXTRACTOR_FIELD_NUMBER = 6; + private volatile java.lang.Object valueExtractor_; + /** + *
+   * Optional. A `value_extractor` is required when using a distribution
+   * logs-based metric to extract the values to record from a log entry.
+   * Two functions are supported for value extraction: `EXTRACT(field)` or
+   * `REGEXP_EXTRACT(field, regex)`. The argument are:
+   *   1. field: The name of the log entry field from which the value is to be
+   *      extracted.
+   *   2. regex: A regular expression using the Google RE2 syntax
+   *      (https://github.com/google/re2/wiki/Syntax) with a single capture
+   *      group to extract data from the specified log entry field. The value
+   *      of the field is converted to a string before applying the regex.
+   *      It is an error to specify a regex that does not include exactly one
+   *      capture group.
+   * The result of the extraction must be convertible to a double type, as the
+   * distribution always records double values. If either the extraction or
+   * the conversion to double fails, then those values are not recorded in the
+   * distribution.
+   * Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")`
+   * 
+ * + * string value_extractor = 6; + */ + public java.lang.String getValueExtractor() { + java.lang.Object ref = valueExtractor_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + valueExtractor_ = s; + return s; + } + } + /** + *
+   * Optional. A `value_extractor` is required when using a distribution
+   * logs-based metric to extract the values to record from a log entry.
+   * Two functions are supported for value extraction: `EXTRACT(field)` or
+   * `REGEXP_EXTRACT(field, regex)`. The argument are:
+   *   1. field: The name of the log entry field from which the value is to be
+   *      extracted.
+   *   2. regex: A regular expression using the Google RE2 syntax
+   *      (https://github.com/google/re2/wiki/Syntax) with a single capture
+   *      group to extract data from the specified log entry field. The value
+   *      of the field is converted to a string before applying the regex.
+   *      It is an error to specify a regex that does not include exactly one
+   *      capture group.
+   * The result of the extraction must be convertible to a double type, as the
+   * distribution always records double values. If either the extraction or
+   * the conversion to double fails, then those values are not recorded in the
+   * distribution.
+   * Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")`
+   * 
+ * + * string value_extractor = 6; + */ + public com.google.protobuf.ByteString + getValueExtractorBytes() { + java.lang.Object ref = valueExtractor_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + valueExtractor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LABEL_EXTRACTORS_FIELD_NUMBER = 7; + private static final class LabelExtractorsDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.logging.v2.LoggingMetricsProto.internal_static_google_logging_v2_LogMetric_LabelExtractorsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> labelExtractors_; + private com.google.protobuf.MapField + internalGetLabelExtractors() { + if (labelExtractors_ == null) { + return com.google.protobuf.MapField.emptyMapField( + LabelExtractorsDefaultEntryHolder.defaultEntry); + } + return labelExtractors_; + } + + public int getLabelExtractorsCount() { + return internalGetLabelExtractors().getMap().size(); + } + /** + *
+   * Optional. A map from a label key string to an extractor expression which is
+   * used to extract data from a log entry field and assign as the label value.
+   * Each label key specified in the LabelDescriptor must have an associated
+   * extractor expression in this map. The syntax of the extractor expression
+   * is the same as for the `value_extractor` field.
+   * The extracted value is converted to the type defined in the label
+   * descriptor. If the either the extraction or the type conversion fails,
+   * the label will have a default value. The default value for a string
+   * label is an empty string, for an integer label its 0, and for a boolean
+   * label its `false`.
+   * Note that there are upper bounds on the maximum number of labels and the
+   * number of active time series that are allowed in a project.
+   * 
+ * + * map<string, string> label_extractors = 7; + */ + + public boolean containsLabelExtractors( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetLabelExtractors().getMap().containsKey(key); + } + /** + * Use {@link #getLabelExtractorsMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getLabelExtractors() { + return getLabelExtractorsMap(); + } + /** + *
+   * Optional. A map from a label key string to an extractor expression which is
+   * used to extract data from a log entry field and assign as the label value.
+   * Each label key specified in the LabelDescriptor must have an associated
+   * extractor expression in this map. The syntax of the extractor expression
+   * is the same as for the `value_extractor` field.
+   * The extracted value is converted to the type defined in the label
+   * descriptor. If the either the extraction or the type conversion fails,
+   * the label will have a default value. The default value for a string
+   * label is an empty string, for an integer label its 0, and for a boolean
+   * label its `false`.
+   * Note that there are upper bounds on the maximum number of labels and the
+   * number of active time series that are allowed in a project.
+   * 
+ * + * map<string, string> label_extractors = 7; + */ + + public java.util.Map getLabelExtractorsMap() { + return internalGetLabelExtractors().getMap(); + } + /** + *
+   * Optional. A map from a label key string to an extractor expression which is
+   * used to extract data from a log entry field and assign as the label value.
+   * Each label key specified in the LabelDescriptor must have an associated
+   * extractor expression in this map. The syntax of the extractor expression
+   * is the same as for the `value_extractor` field.
+   * The extracted value is converted to the type defined in the label
+   * descriptor. If the either the extraction or the type conversion fails,
+   * the label will have a default value. The default value for a string
+   * label is an empty string, for an integer label its 0, and for a boolean
+   * label its `false`.
+   * Note that there are upper bounds on the maximum number of labels and the
+   * number of active time series that are allowed in a project.
+   * 
+ * + * map<string, string> label_extractors = 7; + */ + + public java.lang.String getLabelExtractorsOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetLabelExtractors().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+   * Optional. A map from a label key string to an extractor expression which is
+   * used to extract data from a log entry field and assign as the label value.
+   * Each label key specified in the LabelDescriptor must have an associated
+   * extractor expression in this map. The syntax of the extractor expression
+   * is the same as for the `value_extractor` field.
+   * The extracted value is converted to the type defined in the label
+   * descriptor. If the either the extraction or the type conversion fails,
+   * the label will have a default value. The default value for a string
+   * label is an empty string, for an integer label its 0, and for a boolean
+   * label its `false`.
+   * Note that there are upper bounds on the maximum number of labels and the
+   * number of active time series that are allowed in a project.
+   * 
+ * + * map<string, string> label_extractors = 7; + */ + + public java.lang.String getLabelExtractorsOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetLabelExtractors().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int BUCKET_OPTIONS_FIELD_NUMBER = 8; + private com.google.api.Distribution.BucketOptions bucketOptions_; + /** + *
+   * Optional. The `bucket_options` are required when the logs-based metric is
+   * using a DISTRIBUTION value type and it describes the bucket boundaries
+   * used to create a histogram of the extracted values.
+   * 
+ * + * .google.api.Distribution.BucketOptions bucket_options = 8; + */ + public boolean hasBucketOptions() { + return bucketOptions_ != null; + } + /** + *
+   * Optional. The `bucket_options` are required when the logs-based metric is
+   * using a DISTRIBUTION value type and it describes the bucket boundaries
+   * used to create a histogram of the extracted values.
+   * 
+ * + * .google.api.Distribution.BucketOptions bucket_options = 8; + */ + public com.google.api.Distribution.BucketOptions getBucketOptions() { + return bucketOptions_ == null ? com.google.api.Distribution.BucketOptions.getDefaultInstance() : bucketOptions_; + } + /** + *
+   * Optional. The `bucket_options` are required when the logs-based metric is
+   * using a DISTRIBUTION value type and it describes the bucket boundaries
+   * used to create a histogram of the extracted values.
+   * 
+ * + * .google.api.Distribution.BucketOptions bucket_options = 8; + */ + public com.google.api.Distribution.BucketOptionsOrBuilder getBucketOptionsOrBuilder() { + return getBucketOptions(); + } + + public static final int VERSION_FIELD_NUMBER = 4; + private int version_; + /** + *
+   * Deprecated. The API version that created or updated this metric.
+   * The v2 format is used by default and cannot be changed.
+   * 
+ * + * .google.logging.v2.LogMetric.ApiVersion version = 4; + */ + public int getVersionValue() { + return version_; + } + /** + *
+   * Deprecated. The API version that created or updated this metric.
+   * The v2 format is used by default and cannot be changed.
+   * 
+ * + * .google.logging.v2.LogMetric.ApiVersion version = 4; + */ + public com.google.logging.v2.LogMetric.ApiVersion getVersion() { + com.google.logging.v2.LogMetric.ApiVersion result = com.google.logging.v2.LogMetric.ApiVersion.valueOf(version_); + return result == null ? com.google.logging.v2.LogMetric.ApiVersion.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, filter_); + } + if (version_ != com.google.logging.v2.LogMetric.ApiVersion.V2.getNumber()) { + output.writeEnum(4, version_); + } + if (metricDescriptor_ != null) { + output.writeMessage(5, getMetricDescriptor()); + } + if (!getValueExtractorBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, valueExtractor_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetLabelExtractors(), + LabelExtractorsDefaultEntryHolder.defaultEntry, + 7); + if (bucketOptions_ != null) { + output.writeMessage(8, getBucketOptions()); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, filter_); + } + if (version_ != com.google.logging.v2.LogMetric.ApiVersion.V2.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(4, version_); + } + if (metricDescriptor_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getMetricDescriptor()); + } + if (!getValueExtractorBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, valueExtractor_); + } + for (java.util.Map.Entry entry + : internalGetLabelExtractors().getMap().entrySet()) { + com.google.protobuf.MapEntry + labelExtractors__ = LabelExtractorsDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, labelExtractors__); + } + if (bucketOptions_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, getBucketOptions()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.logging.v2.LogMetric)) { + return super.equals(obj); + } + com.google.logging.v2.LogMetric other = (com.google.logging.v2.LogMetric) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && getDescription() + .equals(other.getDescription()); + result = result && getFilter() + .equals(other.getFilter()); + result = result && (hasMetricDescriptor() == other.hasMetricDescriptor()); + if (hasMetricDescriptor()) { + result = result && getMetricDescriptor() + .equals(other.getMetricDescriptor()); + } + result = result && getValueExtractor() + .equals(other.getValueExtractor()); + result = result && internalGetLabelExtractors().equals( + other.internalGetLabelExtractors()); + result = result && (hasBucketOptions() == other.hasBucketOptions()); + if (hasBucketOptions()) { + result = result && getBucketOptions() + .equals(other.getBucketOptions()); + } + result = result && version_ == other.version_; + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + if (hasMetricDescriptor()) { + hash = (37 * hash) + METRIC_DESCRIPTOR_FIELD_NUMBER; + hash = (53 * hash) + getMetricDescriptor().hashCode(); + } + hash = (37 * hash) + VALUE_EXTRACTOR_FIELD_NUMBER; + hash = (53 * hash) + getValueExtractor().hashCode(); + if (!internalGetLabelExtractors().getMap().isEmpty()) { + hash = (37 * hash) + LABEL_EXTRACTORS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabelExtractors().hashCode(); + } + if (hasBucketOptions()) { + hash = (37 * hash) + BUCKET_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getBucketOptions().hashCode(); + } + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + version_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.LogMetric parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.LogMetric parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.LogMetric parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.LogMetric parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.LogMetric parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.LogMetric parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.LogMetric parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.LogMetric parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.LogMetric parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.logging.v2.LogMetric parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.LogMetric parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.LogMetric parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.logging.v2.LogMetric prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Describes a logs-based metric.  The value of the metric is the
+   * number of log entries that match a logs filter in a given time interval.
+   * Logs-based metric can also be used to extract values from logs and create a
+   * a distribution of the values. The distribution records the statistics of the
+   * extracted values along with an optional histogram of the values as specified
+   * by the bucket options.
+   * 
+ * + * Protobuf type {@code google.logging.v2.LogMetric} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.LogMetric) + com.google.logging.v2.LogMetricOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingMetricsProto.internal_static_google_logging_v2_LogMetric_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 7: + return internalGetLabelExtractors(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 7: + return internalGetMutableLabelExtractors(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingMetricsProto.internal_static_google_logging_v2_LogMetric_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.LogMetric.class, com.google.logging.v2.LogMetric.Builder.class); + } + + // Construct using com.google.logging.v2.LogMetric.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + name_ = ""; + + description_ = ""; + + filter_ = ""; + + if (metricDescriptorBuilder_ == null) { + metricDescriptor_ = null; + } else { + metricDescriptor_ = null; + metricDescriptorBuilder_ = null; + } + valueExtractor_ = ""; + + internalGetMutableLabelExtractors().clear(); + if (bucketOptionsBuilder_ == null) { + bucketOptions_ = null; + } else { + bucketOptions_ = null; + bucketOptionsBuilder_ = null; + } + version_ = 0; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.logging.v2.LoggingMetricsProto.internal_static_google_logging_v2_LogMetric_descriptor; + } + + public com.google.logging.v2.LogMetric getDefaultInstanceForType() { + return com.google.logging.v2.LogMetric.getDefaultInstance(); + } + + public com.google.logging.v2.LogMetric build() { + com.google.logging.v2.LogMetric result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.logging.v2.LogMetric buildPartial() { + com.google.logging.v2.LogMetric result = new com.google.logging.v2.LogMetric(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.name_ = name_; + result.description_ = description_; + result.filter_ = filter_; + if (metricDescriptorBuilder_ == null) { + result.metricDescriptor_ = metricDescriptor_; + } else { + result.metricDescriptor_ = metricDescriptorBuilder_.build(); + } + result.valueExtractor_ = valueExtractor_; + result.labelExtractors_ = internalGetLabelExtractors(); + result.labelExtractors_.makeImmutable(); + if (bucketOptionsBuilder_ == null) { + result.bucketOptions_ = bucketOptions_; + } else { + result.bucketOptions_ = bucketOptionsBuilder_.build(); + } + result.version_ = version_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.logging.v2.LogMetric) { + return mergeFrom((com.google.logging.v2.LogMetric)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.LogMetric other) { + if (other == com.google.logging.v2.LogMetric.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (other.hasMetricDescriptor()) { + mergeMetricDescriptor(other.getMetricDescriptor()); + } + if (!other.getValueExtractor().isEmpty()) { + valueExtractor_ = other.valueExtractor_; + onChanged(); + } + internalGetMutableLabelExtractors().mergeFrom( + other.internalGetLabelExtractors()); + if (other.hasBucketOptions()) { + mergeBucketOptions(other.getBucketOptions()); + } + if (other.version_ != 0) { + setVersionValue(other.getVersionValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.logging.v2.LogMetric parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.logging.v2.LogMetric) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
+     * Required. The client-assigned metric identifier.
+     * Examples: `"error_count"`, `"nginx/requests"`.
+     * Metric identifiers are limited to 100 characters and can include
+     * only the following characters: `A-Z`, `a-z`, `0-9`, and the
+     * special characters `_-.,+!*',()%/`.  The forward-slash character
+     * (`/`) denotes a hierarchy of name pieces, and it cannot be the
+     * first character of the name.
+     * The metric identifier in this field must not be
+     * [URL-encoded](https://en.wikipedia.org/wiki/Percent-encoding).
+     * However, when the metric identifier appears as the `[METRIC_ID]`
+     * part of a `metric_name` API parameter, then the metric identifier
+     * must be URL-encoded. Example:
+     * `"projects/my-project/metrics/nginx%2Frequests"`.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The client-assigned metric identifier.
+     * Examples: `"error_count"`, `"nginx/requests"`.
+     * Metric identifiers are limited to 100 characters and can include
+     * only the following characters: `A-Z`, `a-z`, `0-9`, and the
+     * special characters `_-.,+!*',()%/`.  The forward-slash character
+     * (`/`) denotes a hierarchy of name pieces, and it cannot be the
+     * first character of the name.
+     * The metric identifier in this field must not be
+     * [URL-encoded](https://en.wikipedia.org/wiki/Percent-encoding).
+     * However, when the metric identifier appears as the `[METRIC_ID]`
+     * part of a `metric_name` API parameter, then the metric identifier
+     * must be URL-encoded. Example:
+     * `"projects/my-project/metrics/nginx%2Frequests"`.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The client-assigned metric identifier.
+     * Examples: `"error_count"`, `"nginx/requests"`.
+     * Metric identifiers are limited to 100 characters and can include
+     * only the following characters: `A-Z`, `a-z`, `0-9`, and the
+     * special characters `_-.,+!*',()%/`.  The forward-slash character
+     * (`/`) denotes a hierarchy of name pieces, and it cannot be the
+     * first character of the name.
+     * The metric identifier in this field must not be
+     * [URL-encoded](https://en.wikipedia.org/wiki/Percent-encoding).
+     * However, when the metric identifier appears as the `[METRIC_ID]`
+     * part of a `metric_name` API parameter, then the metric identifier
+     * must be URL-encoded. Example:
+     * `"projects/my-project/metrics/nginx%2Frequests"`.
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The client-assigned metric identifier.
+     * Examples: `"error_count"`, `"nginx/requests"`.
+     * Metric identifiers are limited to 100 characters and can include
+     * only the following characters: `A-Z`, `a-z`, `0-9`, and the
+     * special characters `_-.,+!*',()%/`.  The forward-slash character
+     * (`/`) denotes a hierarchy of name pieces, and it cannot be the
+     * first character of the name.
+     * The metric identifier in this field must not be
+     * [URL-encoded](https://en.wikipedia.org/wiki/Percent-encoding).
+     * However, when the metric identifier appears as the `[METRIC_ID]`
+     * part of a `metric_name` API parameter, then the metric identifier
+     * must be URL-encoded. Example:
+     * `"projects/my-project/metrics/nginx%2Frequests"`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Required. The client-assigned metric identifier.
+     * Examples: `"error_count"`, `"nginx/requests"`.
+     * Metric identifiers are limited to 100 characters and can include
+     * only the following characters: `A-Z`, `a-z`, `0-9`, and the
+     * special characters `_-.,+!*',()%/`.  The forward-slash character
+     * (`/`) denotes a hierarchy of name pieces, and it cannot be the
+     * first character of the name.
+     * The metric identifier in this field must not be
+     * [URL-encoded](https://en.wikipedia.org/wiki/Percent-encoding).
+     * However, when the metric identifier appears as the `[METRIC_ID]`
+     * part of a `metric_name` API parameter, then the metric identifier
+     * must be URL-encoded. Example:
+     * `"projects/my-project/metrics/nginx%2Frequests"`.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + *
+     * Optional. A description of this metric, which is used in documentation.
+     * 
+ * + * string description = 2; + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Optional. A description of this metric, which is used in documentation.
+     * 
+ * + * string description = 2; + */ + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Optional. A description of this metric, which is used in documentation.
+     * 
+ * + * string description = 2; + */ + public Builder setDescription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. A description of this metric, which is used in documentation.
+     * 
+ * + * string description = 2; + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + *
+     * Optional. A description of this metric, which is used in documentation.
+     * 
+ * + * string description = 2; + */ + public Builder setDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + *
+     * Required. An [advanced logs filter](/logging/docs/view/advanced_filters)
+     * which is used to match log entries.
+     * Example:
+     *     "resource.type=gae_app AND severity>=ERROR"
+     * The maximum length of the filter is 20000 characters.
+     * 
+ * + * string filter = 3; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. An [advanced logs filter](/logging/docs/view/advanced_filters)
+     * which is used to match log entries.
+     * Example:
+     *     "resource.type=gae_app AND severity>=ERROR"
+     * The maximum length of the filter is 20000 characters.
+     * 
+ * + * string filter = 3; + */ + public com.google.protobuf.ByteString + getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. An [advanced logs filter](/logging/docs/view/advanced_filters)
+     * which is used to match log entries.
+     * Example:
+     *     "resource.type=gae_app AND severity>=ERROR"
+     * The maximum length of the filter is 20000 characters.
+     * 
+ * + * string filter = 3; + */ + public Builder setFilter( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. An [advanced logs filter](/logging/docs/view/advanced_filters)
+     * which is used to match log entries.
+     * Example:
+     *     "resource.type=gae_app AND severity>=ERROR"
+     * The maximum length of the filter is 20000 characters.
+     * 
+ * + * string filter = 3; + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + *
+     * Required. An [advanced logs filter](/logging/docs/view/advanced_filters)
+     * which is used to match log entries.
+     * Example:
+     *     "resource.type=gae_app AND severity>=ERROR"
+     * The maximum length of the filter is 20000 characters.
+     * 
+ * + * string filter = 3; + */ + public Builder setFilterBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private com.google.api.MetricDescriptor metricDescriptor_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.MetricDescriptor, com.google.api.MetricDescriptor.Builder, com.google.api.MetricDescriptorOrBuilder> metricDescriptorBuilder_; + /** + *
+     * Optional. The metric descriptor associated with the logs-based metric.
+     * If unspecified, it uses a default metric descriptor with a DELTA metric
+     * kind, INT64 value type, with no labels and a unit of "1". Such a metric
+     * counts the number of log entries matching the `filter` expression.
+     * The `name`, `type`, and `description` fields in the `metric_descriptor`
+     * are output only, and is constructed using the `name` and `description`
+     * field in the LogMetric.
+     * To create a logs-based metric that records a distribution of log values, a
+     * DELTA metric kind with a DISTRIBUTION value type must be used along with
+     * a `value_extractor` expression in the LogMetric.
+     * Each label in the metric descriptor must have a matching label
+     * name as the key and an extractor expression as the value in the
+     * `label_extractors` map.
+     * The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot
+     * be updated once initially configured. New labels can be added in the
+     * `metric_descriptor`, but existing labels cannot be modified except for
+     * their description.
+     * 
+ * + * .google.api.MetricDescriptor metric_descriptor = 5; + */ + public boolean hasMetricDescriptor() { + return metricDescriptorBuilder_ != null || metricDescriptor_ != null; + } + /** + *
+     * Optional. The metric descriptor associated with the logs-based metric.
+     * If unspecified, it uses a default metric descriptor with a DELTA metric
+     * kind, INT64 value type, with no labels and a unit of "1". Such a metric
+     * counts the number of log entries matching the `filter` expression.
+     * The `name`, `type`, and `description` fields in the `metric_descriptor`
+     * are output only, and is constructed using the `name` and `description`
+     * field in the LogMetric.
+     * To create a logs-based metric that records a distribution of log values, a
+     * DELTA metric kind with a DISTRIBUTION value type must be used along with
+     * a `value_extractor` expression in the LogMetric.
+     * Each label in the metric descriptor must have a matching label
+     * name as the key and an extractor expression as the value in the
+     * `label_extractors` map.
+     * The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot
+     * be updated once initially configured. New labels can be added in the
+     * `metric_descriptor`, but existing labels cannot be modified except for
+     * their description.
+     * 
+ * + * .google.api.MetricDescriptor metric_descriptor = 5; + */ + public com.google.api.MetricDescriptor getMetricDescriptor() { + if (metricDescriptorBuilder_ == null) { + return metricDescriptor_ == null ? com.google.api.MetricDescriptor.getDefaultInstance() : metricDescriptor_; + } else { + return metricDescriptorBuilder_.getMessage(); + } + } + /** + *
+     * Optional. The metric descriptor associated with the logs-based metric.
+     * If unspecified, it uses a default metric descriptor with a DELTA metric
+     * kind, INT64 value type, with no labels and a unit of "1". Such a metric
+     * counts the number of log entries matching the `filter` expression.
+     * The `name`, `type`, and `description` fields in the `metric_descriptor`
+     * are output only, and is constructed using the `name` and `description`
+     * field in the LogMetric.
+     * To create a logs-based metric that records a distribution of log values, a
+     * DELTA metric kind with a DISTRIBUTION value type must be used along with
+     * a `value_extractor` expression in the LogMetric.
+     * Each label in the metric descriptor must have a matching label
+     * name as the key and an extractor expression as the value in the
+     * `label_extractors` map.
+     * The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot
+     * be updated once initially configured. New labels can be added in the
+     * `metric_descriptor`, but existing labels cannot be modified except for
+     * their description.
+     * 
+ * + * .google.api.MetricDescriptor metric_descriptor = 5; + */ + public Builder setMetricDescriptor(com.google.api.MetricDescriptor value) { + if (metricDescriptorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metricDescriptor_ = value; + onChanged(); + } else { + metricDescriptorBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Optional. The metric descriptor associated with the logs-based metric.
+     * If unspecified, it uses a default metric descriptor with a DELTA metric
+     * kind, INT64 value type, with no labels and a unit of "1". Such a metric
+     * counts the number of log entries matching the `filter` expression.
+     * The `name`, `type`, and `description` fields in the `metric_descriptor`
+     * are output only, and is constructed using the `name` and `description`
+     * field in the LogMetric.
+     * To create a logs-based metric that records a distribution of log values, a
+     * DELTA metric kind with a DISTRIBUTION value type must be used along with
+     * a `value_extractor` expression in the LogMetric.
+     * Each label in the metric descriptor must have a matching label
+     * name as the key and an extractor expression as the value in the
+     * `label_extractors` map.
+     * The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot
+     * be updated once initially configured. New labels can be added in the
+     * `metric_descriptor`, but existing labels cannot be modified except for
+     * their description.
+     * 
+ * + * .google.api.MetricDescriptor metric_descriptor = 5; + */ + public Builder setMetricDescriptor( + com.google.api.MetricDescriptor.Builder builderForValue) { + if (metricDescriptorBuilder_ == null) { + metricDescriptor_ = builderForValue.build(); + onChanged(); + } else { + metricDescriptorBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Optional. The metric descriptor associated with the logs-based metric.
+     * If unspecified, it uses a default metric descriptor with a DELTA metric
+     * kind, INT64 value type, with no labels and a unit of "1". Such a metric
+     * counts the number of log entries matching the `filter` expression.
+     * The `name`, `type`, and `description` fields in the `metric_descriptor`
+     * are output only, and is constructed using the `name` and `description`
+     * field in the LogMetric.
+     * To create a logs-based metric that records a distribution of log values, a
+     * DELTA metric kind with a DISTRIBUTION value type must be used along with
+     * a `value_extractor` expression in the LogMetric.
+     * Each label in the metric descriptor must have a matching label
+     * name as the key and an extractor expression as the value in the
+     * `label_extractors` map.
+     * The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot
+     * be updated once initially configured. New labels can be added in the
+     * `metric_descriptor`, but existing labels cannot be modified except for
+     * their description.
+     * 
+ * + * .google.api.MetricDescriptor metric_descriptor = 5; + */ + public Builder mergeMetricDescriptor(com.google.api.MetricDescriptor value) { + if (metricDescriptorBuilder_ == null) { + if (metricDescriptor_ != null) { + metricDescriptor_ = + com.google.api.MetricDescriptor.newBuilder(metricDescriptor_).mergeFrom(value).buildPartial(); + } else { + metricDescriptor_ = value; + } + onChanged(); + } else { + metricDescriptorBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Optional. The metric descriptor associated with the logs-based metric.
+     * If unspecified, it uses a default metric descriptor with a DELTA metric
+     * kind, INT64 value type, with no labels and a unit of "1". Such a metric
+     * counts the number of log entries matching the `filter` expression.
+     * The `name`, `type`, and `description` fields in the `metric_descriptor`
+     * are output only, and is constructed using the `name` and `description`
+     * field in the LogMetric.
+     * To create a logs-based metric that records a distribution of log values, a
+     * DELTA metric kind with a DISTRIBUTION value type must be used along with
+     * a `value_extractor` expression in the LogMetric.
+     * Each label in the metric descriptor must have a matching label
+     * name as the key and an extractor expression as the value in the
+     * `label_extractors` map.
+     * The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot
+     * be updated once initially configured. New labels can be added in the
+     * `metric_descriptor`, but existing labels cannot be modified except for
+     * their description.
+     * 
+ * + * .google.api.MetricDescriptor metric_descriptor = 5; + */ + public Builder clearMetricDescriptor() { + if (metricDescriptorBuilder_ == null) { + metricDescriptor_ = null; + onChanged(); + } else { + metricDescriptor_ = null; + metricDescriptorBuilder_ = null; + } + + return this; + } + /** + *
+     * Optional. The metric descriptor associated with the logs-based metric.
+     * If unspecified, it uses a default metric descriptor with a DELTA metric
+     * kind, INT64 value type, with no labels and a unit of "1". Such a metric
+     * counts the number of log entries matching the `filter` expression.
+     * The `name`, `type`, and `description` fields in the `metric_descriptor`
+     * are output only, and is constructed using the `name` and `description`
+     * field in the LogMetric.
+     * To create a logs-based metric that records a distribution of log values, a
+     * DELTA metric kind with a DISTRIBUTION value type must be used along with
+     * a `value_extractor` expression in the LogMetric.
+     * Each label in the metric descriptor must have a matching label
+     * name as the key and an extractor expression as the value in the
+     * `label_extractors` map.
+     * The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot
+     * be updated once initially configured. New labels can be added in the
+     * `metric_descriptor`, but existing labels cannot be modified except for
+     * their description.
+     * 
+ * + * .google.api.MetricDescriptor metric_descriptor = 5; + */ + public com.google.api.MetricDescriptor.Builder getMetricDescriptorBuilder() { + + onChanged(); + return getMetricDescriptorFieldBuilder().getBuilder(); + } + /** + *
+     * Optional. The metric descriptor associated with the logs-based metric.
+     * If unspecified, it uses a default metric descriptor with a DELTA metric
+     * kind, INT64 value type, with no labels and a unit of "1". Such a metric
+     * counts the number of log entries matching the `filter` expression.
+     * The `name`, `type`, and `description` fields in the `metric_descriptor`
+     * are output only, and is constructed using the `name` and `description`
+     * field in the LogMetric.
+     * To create a logs-based metric that records a distribution of log values, a
+     * DELTA metric kind with a DISTRIBUTION value type must be used along with
+     * a `value_extractor` expression in the LogMetric.
+     * Each label in the metric descriptor must have a matching label
+     * name as the key and an extractor expression as the value in the
+     * `label_extractors` map.
+     * The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot
+     * be updated once initially configured. New labels can be added in the
+     * `metric_descriptor`, but existing labels cannot be modified except for
+     * their description.
+     * 
+ * + * .google.api.MetricDescriptor metric_descriptor = 5; + */ + public com.google.api.MetricDescriptorOrBuilder getMetricDescriptorOrBuilder() { + if (metricDescriptorBuilder_ != null) { + return metricDescriptorBuilder_.getMessageOrBuilder(); + } else { + return metricDescriptor_ == null ? + com.google.api.MetricDescriptor.getDefaultInstance() : metricDescriptor_; + } + } + /** + *
+     * Optional. The metric descriptor associated with the logs-based metric.
+     * If unspecified, it uses a default metric descriptor with a DELTA metric
+     * kind, INT64 value type, with no labels and a unit of "1". Such a metric
+     * counts the number of log entries matching the `filter` expression.
+     * The `name`, `type`, and `description` fields in the `metric_descriptor`
+     * are output only, and is constructed using the `name` and `description`
+     * field in the LogMetric.
+     * To create a logs-based metric that records a distribution of log values, a
+     * DELTA metric kind with a DISTRIBUTION value type must be used along with
+     * a `value_extractor` expression in the LogMetric.
+     * Each label in the metric descriptor must have a matching label
+     * name as the key and an extractor expression as the value in the
+     * `label_extractors` map.
+     * The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot
+     * be updated once initially configured. New labels can be added in the
+     * `metric_descriptor`, but existing labels cannot be modified except for
+     * their description.
+     * 
+ * + * .google.api.MetricDescriptor metric_descriptor = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.MetricDescriptor, com.google.api.MetricDescriptor.Builder, com.google.api.MetricDescriptorOrBuilder> + getMetricDescriptorFieldBuilder() { + if (metricDescriptorBuilder_ == null) { + metricDescriptorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.api.MetricDescriptor, com.google.api.MetricDescriptor.Builder, com.google.api.MetricDescriptorOrBuilder>( + getMetricDescriptor(), + getParentForChildren(), + isClean()); + metricDescriptor_ = null; + } + return metricDescriptorBuilder_; + } + + private java.lang.Object valueExtractor_ = ""; + /** + *
+     * Optional. A `value_extractor` is required when using a distribution
+     * logs-based metric to extract the values to record from a log entry.
+     * Two functions are supported for value extraction: `EXTRACT(field)` or
+     * `REGEXP_EXTRACT(field, regex)`. The argument are:
+     *   1. field: The name of the log entry field from which the value is to be
+     *      extracted.
+     *   2. regex: A regular expression using the Google RE2 syntax
+     *      (https://github.com/google/re2/wiki/Syntax) with a single capture
+     *      group to extract data from the specified log entry field. The value
+     *      of the field is converted to a string before applying the regex.
+     *      It is an error to specify a regex that does not include exactly one
+     *      capture group.
+     * The result of the extraction must be convertible to a double type, as the
+     * distribution always records double values. If either the extraction or
+     * the conversion to double fails, then those values are not recorded in the
+     * distribution.
+     * Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")`
+     * 
+ * + * string value_extractor = 6; + */ + public java.lang.String getValueExtractor() { + java.lang.Object ref = valueExtractor_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + valueExtractor_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Optional. A `value_extractor` is required when using a distribution
+     * logs-based metric to extract the values to record from a log entry.
+     * Two functions are supported for value extraction: `EXTRACT(field)` or
+     * `REGEXP_EXTRACT(field, regex)`. The argument are:
+     *   1. field: The name of the log entry field from which the value is to be
+     *      extracted.
+     *   2. regex: A regular expression using the Google RE2 syntax
+     *      (https://github.com/google/re2/wiki/Syntax) with a single capture
+     *      group to extract data from the specified log entry field. The value
+     *      of the field is converted to a string before applying the regex.
+     *      It is an error to specify a regex that does not include exactly one
+     *      capture group.
+     * The result of the extraction must be convertible to a double type, as the
+     * distribution always records double values. If either the extraction or
+     * the conversion to double fails, then those values are not recorded in the
+     * distribution.
+     * Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")`
+     * 
+ * + * string value_extractor = 6; + */ + public com.google.protobuf.ByteString + getValueExtractorBytes() { + java.lang.Object ref = valueExtractor_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + valueExtractor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Optional. A `value_extractor` is required when using a distribution
+     * logs-based metric to extract the values to record from a log entry.
+     * Two functions are supported for value extraction: `EXTRACT(field)` or
+     * `REGEXP_EXTRACT(field, regex)`. The argument are:
+     *   1. field: The name of the log entry field from which the value is to be
+     *      extracted.
+     *   2. regex: A regular expression using the Google RE2 syntax
+     *      (https://github.com/google/re2/wiki/Syntax) with a single capture
+     *      group to extract data from the specified log entry field. The value
+     *      of the field is converted to a string before applying the regex.
+     *      It is an error to specify a regex that does not include exactly one
+     *      capture group.
+     * The result of the extraction must be convertible to a double type, as the
+     * distribution always records double values. If either the extraction or
+     * the conversion to double fails, then those values are not recorded in the
+     * distribution.
+     * Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")`
+     * 
+ * + * string value_extractor = 6; + */ + public Builder setValueExtractor( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + valueExtractor_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. A `value_extractor` is required when using a distribution
+     * logs-based metric to extract the values to record from a log entry.
+     * Two functions are supported for value extraction: `EXTRACT(field)` or
+     * `REGEXP_EXTRACT(field, regex)`. The argument are:
+     *   1. field: The name of the log entry field from which the value is to be
+     *      extracted.
+     *   2. regex: A regular expression using the Google RE2 syntax
+     *      (https://github.com/google/re2/wiki/Syntax) with a single capture
+     *      group to extract data from the specified log entry field. The value
+     *      of the field is converted to a string before applying the regex.
+     *      It is an error to specify a regex that does not include exactly one
+     *      capture group.
+     * The result of the extraction must be convertible to a double type, as the
+     * distribution always records double values. If either the extraction or
+     * the conversion to double fails, then those values are not recorded in the
+     * distribution.
+     * Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")`
+     * 
+ * + * string value_extractor = 6; + */ + public Builder clearValueExtractor() { + + valueExtractor_ = getDefaultInstance().getValueExtractor(); + onChanged(); + return this; + } + /** + *
+     * Optional. A `value_extractor` is required when using a distribution
+     * logs-based metric to extract the values to record from a log entry.
+     * Two functions are supported for value extraction: `EXTRACT(field)` or
+     * `REGEXP_EXTRACT(field, regex)`. The argument are:
+     *   1. field: The name of the log entry field from which the value is to be
+     *      extracted.
+     *   2. regex: A regular expression using the Google RE2 syntax
+     *      (https://github.com/google/re2/wiki/Syntax) with a single capture
+     *      group to extract data from the specified log entry field. The value
+     *      of the field is converted to a string before applying the regex.
+     *      It is an error to specify a regex that does not include exactly one
+     *      capture group.
+     * The result of the extraction must be convertible to a double type, as the
+     * distribution always records double values. If either the extraction or
+     * the conversion to double fails, then those values are not recorded in the
+     * distribution.
+     * Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")`
+     * 
+ * + * string value_extractor = 6; + */ + public Builder setValueExtractorBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + valueExtractor_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> labelExtractors_; + private com.google.protobuf.MapField + internalGetLabelExtractors() { + if (labelExtractors_ == null) { + return com.google.protobuf.MapField.emptyMapField( + LabelExtractorsDefaultEntryHolder.defaultEntry); + } + return labelExtractors_; + } + private com.google.protobuf.MapField + internalGetMutableLabelExtractors() { + onChanged();; + if (labelExtractors_ == null) { + labelExtractors_ = com.google.protobuf.MapField.newMapField( + LabelExtractorsDefaultEntryHolder.defaultEntry); + } + if (!labelExtractors_.isMutable()) { + labelExtractors_ = labelExtractors_.copy(); + } + return labelExtractors_; + } + + public int getLabelExtractorsCount() { + return internalGetLabelExtractors().getMap().size(); + } + /** + *
+     * Optional. A map from a label key string to an extractor expression which is
+     * used to extract data from a log entry field and assign as the label value.
+     * Each label key specified in the LabelDescriptor must have an associated
+     * extractor expression in this map. The syntax of the extractor expression
+     * is the same as for the `value_extractor` field.
+     * The extracted value is converted to the type defined in the label
+     * descriptor. If the either the extraction or the type conversion fails,
+     * the label will have a default value. The default value for a string
+     * label is an empty string, for an integer label its 0, and for a boolean
+     * label its `false`.
+     * Note that there are upper bounds on the maximum number of labels and the
+     * number of active time series that are allowed in a project.
+     * 
+ * + * map<string, string> label_extractors = 7; + */ + + public boolean containsLabelExtractors( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetLabelExtractors().getMap().containsKey(key); + } + /** + * Use {@link #getLabelExtractorsMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getLabelExtractors() { + return getLabelExtractorsMap(); + } + /** + *
+     * Optional. A map from a label key string to an extractor expression which is
+     * used to extract data from a log entry field and assign as the label value.
+     * Each label key specified in the LabelDescriptor must have an associated
+     * extractor expression in this map. The syntax of the extractor expression
+     * is the same as for the `value_extractor` field.
+     * The extracted value is converted to the type defined in the label
+     * descriptor. If the either the extraction or the type conversion fails,
+     * the label will have a default value. The default value for a string
+     * label is an empty string, for an integer label its 0, and for a boolean
+     * label its `false`.
+     * Note that there are upper bounds on the maximum number of labels and the
+     * number of active time series that are allowed in a project.
+     * 
+ * + * map<string, string> label_extractors = 7; + */ + + public java.util.Map getLabelExtractorsMap() { + return internalGetLabelExtractors().getMap(); + } + /** + *
+     * Optional. A map from a label key string to an extractor expression which is
+     * used to extract data from a log entry field and assign as the label value.
+     * Each label key specified in the LabelDescriptor must have an associated
+     * extractor expression in this map. The syntax of the extractor expression
+     * is the same as for the `value_extractor` field.
+     * The extracted value is converted to the type defined in the label
+     * descriptor. If the either the extraction or the type conversion fails,
+     * the label will have a default value. The default value for a string
+     * label is an empty string, for an integer label its 0, and for a boolean
+     * label its `false`.
+     * Note that there are upper bounds on the maximum number of labels and the
+     * number of active time series that are allowed in a project.
+     * 
+ * + * map<string, string> label_extractors = 7; + */ + + public java.lang.String getLabelExtractorsOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetLabelExtractors().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * Optional. A map from a label key string to an extractor expression which is
+     * used to extract data from a log entry field and assign as the label value.
+     * Each label key specified in the LabelDescriptor must have an associated
+     * extractor expression in this map. The syntax of the extractor expression
+     * is the same as for the `value_extractor` field.
+     * The extracted value is converted to the type defined in the label
+     * descriptor. If the either the extraction or the type conversion fails,
+     * the label will have a default value. The default value for a string
+     * label is an empty string, for an integer label its 0, and for a boolean
+     * label its `false`.
+     * Note that there are upper bounds on the maximum number of labels and the
+     * number of active time series that are allowed in a project.
+     * 
+ * + * map<string, string> label_extractors = 7; + */ + + public java.lang.String getLabelExtractorsOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetLabelExtractors().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabelExtractors() { + internalGetMutableLabelExtractors().getMutableMap() + .clear(); + return this; + } + /** + *
+     * Optional. A map from a label key string to an extractor expression which is
+     * used to extract data from a log entry field and assign as the label value.
+     * Each label key specified in the LabelDescriptor must have an associated
+     * extractor expression in this map. The syntax of the extractor expression
+     * is the same as for the `value_extractor` field.
+     * The extracted value is converted to the type defined in the label
+     * descriptor. If the either the extraction or the type conversion fails,
+     * the label will have a default value. The default value for a string
+     * label is an empty string, for an integer label its 0, and for a boolean
+     * label its `false`.
+     * Note that there are upper bounds on the maximum number of labels and the
+     * number of active time series that are allowed in a project.
+     * 
+ * + * map<string, string> label_extractors = 7; + */ + + public Builder removeLabelExtractors( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableLabelExtractors().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableLabelExtractors() { + return internalGetMutableLabelExtractors().getMutableMap(); + } + /** + *
+     * Optional. A map from a label key string to an extractor expression which is
+     * used to extract data from a log entry field and assign as the label value.
+     * Each label key specified in the LabelDescriptor must have an associated
+     * extractor expression in this map. The syntax of the extractor expression
+     * is the same as for the `value_extractor` field.
+     * The extracted value is converted to the type defined in the label
+     * descriptor. If the either the extraction or the type conversion fails,
+     * the label will have a default value. The default value for a string
+     * label is an empty string, for an integer label its 0, and for a boolean
+     * label its `false`.
+     * Note that there are upper bounds on the maximum number of labels and the
+     * number of active time series that are allowed in a project.
+     * 
+ * + * map<string, string> label_extractors = 7; + */ + public Builder putLabelExtractors( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableLabelExtractors().getMutableMap() + .put(key, value); + return this; + } + /** + *
+     * Optional. A map from a label key string to an extractor expression which is
+     * used to extract data from a log entry field and assign as the label value.
+     * Each label key specified in the LabelDescriptor must have an associated
+     * extractor expression in this map. The syntax of the extractor expression
+     * is the same as for the `value_extractor` field.
+     * The extracted value is converted to the type defined in the label
+     * descriptor. If the either the extraction or the type conversion fails,
+     * the label will have a default value. The default value for a string
+     * label is an empty string, for an integer label its 0, and for a boolean
+     * label its `false`.
+     * Note that there are upper bounds on the maximum number of labels and the
+     * number of active time series that are allowed in a project.
+     * 
+ * + * map<string, string> label_extractors = 7; + */ + + public Builder putAllLabelExtractors( + java.util.Map values) { + internalGetMutableLabelExtractors().getMutableMap() + .putAll(values); + return this; + } + + private com.google.api.Distribution.BucketOptions bucketOptions_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.Distribution.BucketOptions, com.google.api.Distribution.BucketOptions.Builder, com.google.api.Distribution.BucketOptionsOrBuilder> bucketOptionsBuilder_; + /** + *
+     * Optional. The `bucket_options` are required when the logs-based metric is
+     * using a DISTRIBUTION value type and it describes the bucket boundaries
+     * used to create a histogram of the extracted values.
+     * 
+ * + * .google.api.Distribution.BucketOptions bucket_options = 8; + */ + public boolean hasBucketOptions() { + return bucketOptionsBuilder_ != null || bucketOptions_ != null; + } + /** + *
+     * Optional. The `bucket_options` are required when the logs-based metric is
+     * using a DISTRIBUTION value type and it describes the bucket boundaries
+     * used to create a histogram of the extracted values.
+     * 
+ * + * .google.api.Distribution.BucketOptions bucket_options = 8; + */ + public com.google.api.Distribution.BucketOptions getBucketOptions() { + if (bucketOptionsBuilder_ == null) { + return bucketOptions_ == null ? com.google.api.Distribution.BucketOptions.getDefaultInstance() : bucketOptions_; + } else { + return bucketOptionsBuilder_.getMessage(); + } + } + /** + *
+     * Optional. The `bucket_options` are required when the logs-based metric is
+     * using a DISTRIBUTION value type and it describes the bucket boundaries
+     * used to create a histogram of the extracted values.
+     * 
+ * + * .google.api.Distribution.BucketOptions bucket_options = 8; + */ + public Builder setBucketOptions(com.google.api.Distribution.BucketOptions value) { + if (bucketOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + bucketOptions_ = value; + onChanged(); + } else { + bucketOptionsBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Optional. The `bucket_options` are required when the logs-based metric is
+     * using a DISTRIBUTION value type and it describes the bucket boundaries
+     * used to create a histogram of the extracted values.
+     * 
+ * + * .google.api.Distribution.BucketOptions bucket_options = 8; + */ + public Builder setBucketOptions( + com.google.api.Distribution.BucketOptions.Builder builderForValue) { + if (bucketOptionsBuilder_ == null) { + bucketOptions_ = builderForValue.build(); + onChanged(); + } else { + bucketOptionsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Optional. The `bucket_options` are required when the logs-based metric is
+     * using a DISTRIBUTION value type and it describes the bucket boundaries
+     * used to create a histogram of the extracted values.
+     * 
+ * + * .google.api.Distribution.BucketOptions bucket_options = 8; + */ + public Builder mergeBucketOptions(com.google.api.Distribution.BucketOptions value) { + if (bucketOptionsBuilder_ == null) { + if (bucketOptions_ != null) { + bucketOptions_ = + com.google.api.Distribution.BucketOptions.newBuilder(bucketOptions_).mergeFrom(value).buildPartial(); + } else { + bucketOptions_ = value; + } + onChanged(); + } else { + bucketOptionsBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Optional. The `bucket_options` are required when the logs-based metric is
+     * using a DISTRIBUTION value type and it describes the bucket boundaries
+     * used to create a histogram of the extracted values.
+     * 
+ * + * .google.api.Distribution.BucketOptions bucket_options = 8; + */ + public Builder clearBucketOptions() { + if (bucketOptionsBuilder_ == null) { + bucketOptions_ = null; + onChanged(); + } else { + bucketOptions_ = null; + bucketOptionsBuilder_ = null; + } + + return this; + } + /** + *
+     * Optional. The `bucket_options` are required when the logs-based metric is
+     * using a DISTRIBUTION value type and it describes the bucket boundaries
+     * used to create a histogram of the extracted values.
+     * 
+ * + * .google.api.Distribution.BucketOptions bucket_options = 8; + */ + public com.google.api.Distribution.BucketOptions.Builder getBucketOptionsBuilder() { + + onChanged(); + return getBucketOptionsFieldBuilder().getBuilder(); + } + /** + *
+     * Optional. The `bucket_options` are required when the logs-based metric is
+     * using a DISTRIBUTION value type and it describes the bucket boundaries
+     * used to create a histogram of the extracted values.
+     * 
+ * + * .google.api.Distribution.BucketOptions bucket_options = 8; + */ + public com.google.api.Distribution.BucketOptionsOrBuilder getBucketOptionsOrBuilder() { + if (bucketOptionsBuilder_ != null) { + return bucketOptionsBuilder_.getMessageOrBuilder(); + } else { + return bucketOptions_ == null ? + com.google.api.Distribution.BucketOptions.getDefaultInstance() : bucketOptions_; + } + } + /** + *
+     * Optional. The `bucket_options` are required when the logs-based metric is
+     * using a DISTRIBUTION value type and it describes the bucket boundaries
+     * used to create a histogram of the extracted values.
+     * 
+ * + * .google.api.Distribution.BucketOptions bucket_options = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.Distribution.BucketOptions, com.google.api.Distribution.BucketOptions.Builder, com.google.api.Distribution.BucketOptionsOrBuilder> + getBucketOptionsFieldBuilder() { + if (bucketOptionsBuilder_ == null) { + bucketOptionsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.api.Distribution.BucketOptions, com.google.api.Distribution.BucketOptions.Builder, com.google.api.Distribution.BucketOptionsOrBuilder>( + getBucketOptions(), + getParentForChildren(), + isClean()); + bucketOptions_ = null; + } + return bucketOptionsBuilder_; + } + + private int version_ = 0; + /** + *
+     * Deprecated. The API version that created or updated this metric.
+     * The v2 format is used by default and cannot be changed.
+     * 
+ * + * .google.logging.v2.LogMetric.ApiVersion version = 4; + */ + public int getVersionValue() { + return version_; + } + /** + *
+     * Deprecated. The API version that created or updated this metric.
+     * The v2 format is used by default and cannot be changed.
+     * 
+ * + * .google.logging.v2.LogMetric.ApiVersion version = 4; + */ + public Builder setVersionValue(int value) { + version_ = value; + onChanged(); + return this; + } + /** + *
+     * Deprecated. The API version that created or updated this metric.
+     * The v2 format is used by default and cannot be changed.
+     * 
+ * + * .google.logging.v2.LogMetric.ApiVersion version = 4; + */ + public com.google.logging.v2.LogMetric.ApiVersion getVersion() { + com.google.logging.v2.LogMetric.ApiVersion result = com.google.logging.v2.LogMetric.ApiVersion.valueOf(version_); + return result == null ? com.google.logging.v2.LogMetric.ApiVersion.UNRECOGNIZED : result; + } + /** + *
+     * Deprecated. The API version that created or updated this metric.
+     * The v2 format is used by default and cannot be changed.
+     * 
+ * + * .google.logging.v2.LogMetric.ApiVersion version = 4; + */ + public Builder setVersion(com.google.logging.v2.LogMetric.ApiVersion value) { + if (value == null) { + throw new NullPointerException(); + } + + version_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Deprecated. The API version that created or updated this metric.
+     * The v2 format is used by default and cannot be changed.
+     * 
+ * + * .google.logging.v2.LogMetric.ApiVersion version = 4; + */ + public Builder clearVersion() { + + version_ = 0; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.logging.v2.LogMetric) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.LogMetric) + private static final com.google.logging.v2.LogMetric DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.logging.v2.LogMetric(); + } + + public static com.google.logging.v2.LogMetric getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public LogMetric parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LogMetric(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.logging.v2.LogMetric getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogMetricOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogMetricOrBuilder.java new file mode 100644 index 000000000000..3d0901f96afe --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogMetricOrBuilder.java @@ -0,0 +1,377 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_metrics.proto + +package com.google.logging.v2; + +public interface LogMetricOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.LogMetric) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The client-assigned metric identifier.
+   * Examples: `"error_count"`, `"nginx/requests"`.
+   * Metric identifiers are limited to 100 characters and can include
+   * only the following characters: `A-Z`, `a-z`, `0-9`, and the
+   * special characters `_-.,+!*',()%/`.  The forward-slash character
+   * (`/`) denotes a hierarchy of name pieces, and it cannot be the
+   * first character of the name.
+   * The metric identifier in this field must not be
+   * [URL-encoded](https://en.wikipedia.org/wiki/Percent-encoding).
+   * However, when the metric identifier appears as the `[METRIC_ID]`
+   * part of a `metric_name` API parameter, then the metric identifier
+   * must be URL-encoded. Example:
+   * `"projects/my-project/metrics/nginx%2Frequests"`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * Required. The client-assigned metric identifier.
+   * Examples: `"error_count"`, `"nginx/requests"`.
+   * Metric identifiers are limited to 100 characters and can include
+   * only the following characters: `A-Z`, `a-z`, `0-9`, and the
+   * special characters `_-.,+!*',()%/`.  The forward-slash character
+   * (`/`) denotes a hierarchy of name pieces, and it cannot be the
+   * first character of the name.
+   * The metric identifier in this field must not be
+   * [URL-encoded](https://en.wikipedia.org/wiki/Percent-encoding).
+   * However, when the metric identifier appears as the `[METRIC_ID]`
+   * part of a `metric_name` API parameter, then the metric identifier
+   * must be URL-encoded. Example:
+   * `"projects/my-project/metrics/nginx%2Frequests"`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * Optional. A description of this metric, which is used in documentation.
+   * 
+ * + * string description = 2; + */ + java.lang.String getDescription(); + /** + *
+   * Optional. A description of this metric, which is used in documentation.
+   * 
+ * + * string description = 2; + */ + com.google.protobuf.ByteString + getDescriptionBytes(); + + /** + *
+   * Required. An [advanced logs filter](/logging/docs/view/advanced_filters)
+   * which is used to match log entries.
+   * Example:
+   *     "resource.type=gae_app AND severity>=ERROR"
+   * The maximum length of the filter is 20000 characters.
+   * 
+ * + * string filter = 3; + */ + java.lang.String getFilter(); + /** + *
+   * Required. An [advanced logs filter](/logging/docs/view/advanced_filters)
+   * which is used to match log entries.
+   * Example:
+   *     "resource.type=gae_app AND severity>=ERROR"
+   * The maximum length of the filter is 20000 characters.
+   * 
+ * + * string filter = 3; + */ + com.google.protobuf.ByteString + getFilterBytes(); + + /** + *
+   * Optional. The metric descriptor associated with the logs-based metric.
+   * If unspecified, it uses a default metric descriptor with a DELTA metric
+   * kind, INT64 value type, with no labels and a unit of "1". Such a metric
+   * counts the number of log entries matching the `filter` expression.
+   * The `name`, `type`, and `description` fields in the `metric_descriptor`
+   * are output only, and is constructed using the `name` and `description`
+   * field in the LogMetric.
+   * To create a logs-based metric that records a distribution of log values, a
+   * DELTA metric kind with a DISTRIBUTION value type must be used along with
+   * a `value_extractor` expression in the LogMetric.
+   * Each label in the metric descriptor must have a matching label
+   * name as the key and an extractor expression as the value in the
+   * `label_extractors` map.
+   * The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot
+   * be updated once initially configured. New labels can be added in the
+   * `metric_descriptor`, but existing labels cannot be modified except for
+   * their description.
+   * 
+ * + * .google.api.MetricDescriptor metric_descriptor = 5; + */ + boolean hasMetricDescriptor(); + /** + *
+   * Optional. The metric descriptor associated with the logs-based metric.
+   * If unspecified, it uses a default metric descriptor with a DELTA metric
+   * kind, INT64 value type, with no labels and a unit of "1". Such a metric
+   * counts the number of log entries matching the `filter` expression.
+   * The `name`, `type`, and `description` fields in the `metric_descriptor`
+   * are output only, and is constructed using the `name` and `description`
+   * field in the LogMetric.
+   * To create a logs-based metric that records a distribution of log values, a
+   * DELTA metric kind with a DISTRIBUTION value type must be used along with
+   * a `value_extractor` expression in the LogMetric.
+   * Each label in the metric descriptor must have a matching label
+   * name as the key and an extractor expression as the value in the
+   * `label_extractors` map.
+   * The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot
+   * be updated once initially configured. New labels can be added in the
+   * `metric_descriptor`, but existing labels cannot be modified except for
+   * their description.
+   * 
+ * + * .google.api.MetricDescriptor metric_descriptor = 5; + */ + com.google.api.MetricDescriptor getMetricDescriptor(); + /** + *
+   * Optional. The metric descriptor associated with the logs-based metric.
+   * If unspecified, it uses a default metric descriptor with a DELTA metric
+   * kind, INT64 value type, with no labels and a unit of "1". Such a metric
+   * counts the number of log entries matching the `filter` expression.
+   * The `name`, `type`, and `description` fields in the `metric_descriptor`
+   * are output only, and is constructed using the `name` and `description`
+   * field in the LogMetric.
+   * To create a logs-based metric that records a distribution of log values, a
+   * DELTA metric kind with a DISTRIBUTION value type must be used along with
+   * a `value_extractor` expression in the LogMetric.
+   * Each label in the metric descriptor must have a matching label
+   * name as the key and an extractor expression as the value in the
+   * `label_extractors` map.
+   * The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot
+   * be updated once initially configured. New labels can be added in the
+   * `metric_descriptor`, but existing labels cannot be modified except for
+   * their description.
+   * 
+ * + * .google.api.MetricDescriptor metric_descriptor = 5; + */ + com.google.api.MetricDescriptorOrBuilder getMetricDescriptorOrBuilder(); + + /** + *
+   * Optional. A `value_extractor` is required when using a distribution
+   * logs-based metric to extract the values to record from a log entry.
+   * Two functions are supported for value extraction: `EXTRACT(field)` or
+   * `REGEXP_EXTRACT(field, regex)`. The argument are:
+   *   1. field: The name of the log entry field from which the value is to be
+   *      extracted.
+   *   2. regex: A regular expression using the Google RE2 syntax
+   *      (https://github.com/google/re2/wiki/Syntax) with a single capture
+   *      group to extract data from the specified log entry field. The value
+   *      of the field is converted to a string before applying the regex.
+   *      It is an error to specify a regex that does not include exactly one
+   *      capture group.
+   * The result of the extraction must be convertible to a double type, as the
+   * distribution always records double values. If either the extraction or
+   * the conversion to double fails, then those values are not recorded in the
+   * distribution.
+   * Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")`
+   * 
+ * + * string value_extractor = 6; + */ + java.lang.String getValueExtractor(); + /** + *
+   * Optional. A `value_extractor` is required when using a distribution
+   * logs-based metric to extract the values to record from a log entry.
+   * Two functions are supported for value extraction: `EXTRACT(field)` or
+   * `REGEXP_EXTRACT(field, regex)`. The argument are:
+   *   1. field: The name of the log entry field from which the value is to be
+   *      extracted.
+   *   2. regex: A regular expression using the Google RE2 syntax
+   *      (https://github.com/google/re2/wiki/Syntax) with a single capture
+   *      group to extract data from the specified log entry field. The value
+   *      of the field is converted to a string before applying the regex.
+   *      It is an error to specify a regex that does not include exactly one
+   *      capture group.
+   * The result of the extraction must be convertible to a double type, as the
+   * distribution always records double values. If either the extraction or
+   * the conversion to double fails, then those values are not recorded in the
+   * distribution.
+   * Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")`
+   * 
+ * + * string value_extractor = 6; + */ + com.google.protobuf.ByteString + getValueExtractorBytes(); + + /** + *
+   * Optional. A map from a label key string to an extractor expression which is
+   * used to extract data from a log entry field and assign as the label value.
+   * Each label key specified in the LabelDescriptor must have an associated
+   * extractor expression in this map. The syntax of the extractor expression
+   * is the same as for the `value_extractor` field.
+   * The extracted value is converted to the type defined in the label
+   * descriptor. If the either the extraction or the type conversion fails,
+   * the label will have a default value. The default value for a string
+   * label is an empty string, for an integer label its 0, and for a boolean
+   * label its `false`.
+   * Note that there are upper bounds on the maximum number of labels and the
+   * number of active time series that are allowed in a project.
+   * 
+ * + * map<string, string> label_extractors = 7; + */ + int getLabelExtractorsCount(); + /** + *
+   * Optional. A map from a label key string to an extractor expression which is
+   * used to extract data from a log entry field and assign as the label value.
+   * Each label key specified in the LabelDescriptor must have an associated
+   * extractor expression in this map. The syntax of the extractor expression
+   * is the same as for the `value_extractor` field.
+   * The extracted value is converted to the type defined in the label
+   * descriptor. If the either the extraction or the type conversion fails,
+   * the label will have a default value. The default value for a string
+   * label is an empty string, for an integer label its 0, and for a boolean
+   * label its `false`.
+   * Note that there are upper bounds on the maximum number of labels and the
+   * number of active time series that are allowed in a project.
+   * 
+ * + * map<string, string> label_extractors = 7; + */ + boolean containsLabelExtractors( + java.lang.String key); + /** + * Use {@link #getLabelExtractorsMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getLabelExtractors(); + /** + *
+   * Optional. A map from a label key string to an extractor expression which is
+   * used to extract data from a log entry field and assign as the label value.
+   * Each label key specified in the LabelDescriptor must have an associated
+   * extractor expression in this map. The syntax of the extractor expression
+   * is the same as for the `value_extractor` field.
+   * The extracted value is converted to the type defined in the label
+   * descriptor. If the either the extraction or the type conversion fails,
+   * the label will have a default value. The default value for a string
+   * label is an empty string, for an integer label its 0, and for a boolean
+   * label its `false`.
+   * Note that there are upper bounds on the maximum number of labels and the
+   * number of active time series that are allowed in a project.
+   * 
+ * + * map<string, string> label_extractors = 7; + */ + java.util.Map + getLabelExtractorsMap(); + /** + *
+   * Optional. A map from a label key string to an extractor expression which is
+   * used to extract data from a log entry field and assign as the label value.
+   * Each label key specified in the LabelDescriptor must have an associated
+   * extractor expression in this map. The syntax of the extractor expression
+   * is the same as for the `value_extractor` field.
+   * The extracted value is converted to the type defined in the label
+   * descriptor. If the either the extraction or the type conversion fails,
+   * the label will have a default value. The default value for a string
+   * label is an empty string, for an integer label its 0, and for a boolean
+   * label its `false`.
+   * Note that there are upper bounds on the maximum number of labels and the
+   * number of active time series that are allowed in a project.
+   * 
+ * + * map<string, string> label_extractors = 7; + */ + + java.lang.String getLabelExtractorsOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + *
+   * Optional. A map from a label key string to an extractor expression which is
+   * used to extract data from a log entry field and assign as the label value.
+   * Each label key specified in the LabelDescriptor must have an associated
+   * extractor expression in this map. The syntax of the extractor expression
+   * is the same as for the `value_extractor` field.
+   * The extracted value is converted to the type defined in the label
+   * descriptor. If the either the extraction or the type conversion fails,
+   * the label will have a default value. The default value for a string
+   * label is an empty string, for an integer label its 0, and for a boolean
+   * label its `false`.
+   * Note that there are upper bounds on the maximum number of labels and the
+   * number of active time series that are allowed in a project.
+   * 
+ * + * map<string, string> label_extractors = 7; + */ + + java.lang.String getLabelExtractorsOrThrow( + java.lang.String key); + + /** + *
+   * Optional. The `bucket_options` are required when the logs-based metric is
+   * using a DISTRIBUTION value type and it describes the bucket boundaries
+   * used to create a histogram of the extracted values.
+   * 
+ * + * .google.api.Distribution.BucketOptions bucket_options = 8; + */ + boolean hasBucketOptions(); + /** + *
+   * Optional. The `bucket_options` are required when the logs-based metric is
+   * using a DISTRIBUTION value type and it describes the bucket boundaries
+   * used to create a histogram of the extracted values.
+   * 
+ * + * .google.api.Distribution.BucketOptions bucket_options = 8; + */ + com.google.api.Distribution.BucketOptions getBucketOptions(); + /** + *
+   * Optional. The `bucket_options` are required when the logs-based metric is
+   * using a DISTRIBUTION value type and it describes the bucket boundaries
+   * used to create a histogram of the extracted values.
+   * 
+ * + * .google.api.Distribution.BucketOptions bucket_options = 8; + */ + com.google.api.Distribution.BucketOptionsOrBuilder getBucketOptionsOrBuilder(); + + /** + *
+   * Deprecated. The API version that created or updated this metric.
+   * The v2 format is used by default and cannot be changed.
+   * 
+ * + * .google.logging.v2.LogMetric.ApiVersion version = 4; + */ + int getVersionValue(); + /** + *
+   * Deprecated. The API version that created or updated this metric.
+   * The v2 format is used by default and cannot be changed.
+   * 
+ * + * .google.logging.v2.LogMetric.ApiVersion version = 4; + */ + com.google.logging.v2.LogMetric.ApiVersion getVersion(); +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogName.java new file mode 100644 index 000000000000..5f1235cc50e0 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogName.java @@ -0,0 +1,23 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.logging.v2; + +import com.google.api.resourcenames.ResourceName; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public abstract class LogName implements ResourceName { + protected LogName() {} +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogNames.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogNames.java new file mode 100644 index 000000000000..b435eb77ee89 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogNames.java @@ -0,0 +1,39 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.logging.v2; + +import com.google.api.resourcenames.ResourceName; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class LogNames { + private LogNames() {} + + public static LogName parse(String resourceNameString) { + if (ProjectLogName.isParsableFrom(resourceNameString)) { + return ProjectLogName.parse(resourceNameString); + } + if (OrganizationLogName.isParsableFrom(resourceNameString)) { + return OrganizationLogName.parse(resourceNameString); + } + if (FolderLogName.isParsableFrom(resourceNameString)) { + return FolderLogName.parse(resourceNameString); + } + if (BillingLogName.isParsableFrom(resourceNameString)) { + return BillingLogName.parse(resourceNameString); + } + return UntypedLogName.parse(resourceNameString); + } +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogSink.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogSink.java new file mode 100644 index 000000000000..4845b50b0885 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogSink.java @@ -0,0 +1,2046 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_config.proto + +package com.google.logging.v2; + +/** + *
+ * Describes a sink used to export log entries to one of the following
+ * destinations in any project: a Cloud Storage bucket, a BigQuery dataset, or a
+ * Cloud Pub/Sub topic.  A logs filter controls which log entries are
+ * exported. The sink must be created within a project, organization, billing
+ * account, or folder.
+ * 
+ * + * Protobuf type {@code google.logging.v2.LogSink} + */ +public final class LogSink extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.logging.v2.LogSink) + LogSinkOrBuilder { +private static final long serialVersionUID = 0L; + // Use LogSink.newBuilder() to construct. + private LogSink(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private LogSink() { + name_ = ""; + destination_ = ""; + filter_ = ""; + outputVersionFormat_ = 0; + writerIdentity_ = ""; + includeChildren_ = false; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private LogSink( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + destination_ = s; + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 48: { + int rawValue = input.readEnum(); + + outputVersionFormat_ = rawValue; + break; + } + case 66: { + java.lang.String s = input.readStringRequireUtf8(); + + writerIdentity_ = s; + break; + } + case 72: { + + includeChildren_ = input.readBool(); + break; + } + case 82: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (startTime_ != null) { + subBuilder = startTime_.toBuilder(); + } + startTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(startTime_); + startTime_ = subBuilder.buildPartial(); + } + + break; + } + case 90: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (endTime_ != null) { + subBuilder = endTime_.toBuilder(); + } + endTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endTime_); + endTime_ = subBuilder.buildPartial(); + } + + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_LogSink_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_LogSink_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.LogSink.class, com.google.logging.v2.LogSink.Builder.class); + } + + /** + *
+   * Available log entry formats. Log entries can be written to Stackdriver
+   * Logging in either format and can be exported in either format.
+   * Version 2 is the preferred format.
+   * 
+ * + * Protobuf enum {@code google.logging.v2.LogSink.VersionFormat} + */ + public enum VersionFormat + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * An unspecified format version that will default to V2.
+     * 
+ * + * VERSION_FORMAT_UNSPECIFIED = 0; + */ + VERSION_FORMAT_UNSPECIFIED(0), + /** + *
+     * `LogEntry` version 2 format.
+     * 
+ * + * V2 = 1; + */ + V2(1), + /** + *
+     * `LogEntry` version 1 format.
+     * 
+ * + * V1 = 2; + */ + V1(2), + UNRECOGNIZED(-1), + ; + + /** + *
+     * An unspecified format version that will default to V2.
+     * 
+ * + * VERSION_FORMAT_UNSPECIFIED = 0; + */ + public static final int VERSION_FORMAT_UNSPECIFIED_VALUE = 0; + /** + *
+     * `LogEntry` version 2 format.
+     * 
+ * + * V2 = 1; + */ + public static final int V2_VALUE = 1; + /** + *
+     * `LogEntry` version 1 format.
+     * 
+ * + * V1 = 2; + */ + public static final int V1_VALUE = 2; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static VersionFormat valueOf(int value) { + return forNumber(value); + } + + public static VersionFormat forNumber(int value) { + switch (value) { + case 0: return VERSION_FORMAT_UNSPECIFIED; + case 1: return V2; + case 2: return V1; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + VersionFormat> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public VersionFormat findValueByNumber(int number) { + return VersionFormat.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return com.google.logging.v2.LogSink.getDescriptor().getEnumTypes().get(0); + } + + private static final VersionFormat[] VALUES = values(); + + public static VersionFormat valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private VersionFormat(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.logging.v2.LogSink.VersionFormat) + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Required. The client-assigned sink identifier, unique within the
+   * project. Example: `"my-syslog-errors-to-pubsub"`.  Sink identifiers are
+   * limited to 100 characters and can include only the following characters:
+   * upper and lower-case alphanumeric characters, underscores, hyphens, and
+   * periods.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * Required. The client-assigned sink identifier, unique within the
+   * project. Example: `"my-syslog-errors-to-pubsub"`.  Sink identifiers are
+   * limited to 100 characters and can include only the following characters:
+   * upper and lower-case alphanumeric characters, underscores, hyphens, and
+   * periods.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESTINATION_FIELD_NUMBER = 3; + private volatile java.lang.Object destination_; + /** + *
+   * Required. The export destination:
+   *     "storage.googleapis.com/[GCS_BUCKET]"
+   *     "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]"
+   *     "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]"
+   * The sink's `writer_identity`, set when the sink is created, must
+   * have permission to write to the destination or else the log
+   * entries are not exported.  For more information, see
+   * [Exporting Logs With Sinks](/logging/docs/api/tasks/exporting-logs).
+   * 
+ * + * string destination = 3; + */ + public java.lang.String getDestination() { + java.lang.Object ref = destination_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + destination_ = s; + return s; + } + } + /** + *
+   * Required. The export destination:
+   *     "storage.googleapis.com/[GCS_BUCKET]"
+   *     "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]"
+   *     "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]"
+   * The sink's `writer_identity`, set when the sink is created, must
+   * have permission to write to the destination or else the log
+   * entries are not exported.  For more information, see
+   * [Exporting Logs With Sinks](/logging/docs/api/tasks/exporting-logs).
+   * 
+ * + * string destination = 3; + */ + public com.google.protobuf.ByteString + getDestinationBytes() { + java.lang.Object ref = destination_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + destination_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 5; + private volatile java.lang.Object filter_; + /** + *
+   * Optional.
+   * An [advanced logs filter](/logging/docs/view/advanced_filters).  The only
+   * exported log entries are those that are in the resource owning the sink and
+   * that match the filter.  For example:
+   *     logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR
+   * 
+ * + * string filter = 5; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + *
+   * Optional.
+   * An [advanced logs filter](/logging/docs/view/advanced_filters).  The only
+   * exported log entries are those that are in the resource owning the sink and
+   * that match the filter.  For example:
+   *     logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR
+   * 
+ * + * string filter = 5; + */ + public com.google.protobuf.ByteString + getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OUTPUT_VERSION_FORMAT_FIELD_NUMBER = 6; + private int outputVersionFormat_; + /** + *
+   * Deprecated. The log entry format to use for this sink's exported log
+   * entries.  The v2 format is used by default and cannot be changed.
+   * 
+ * + * .google.logging.v2.LogSink.VersionFormat output_version_format = 6; + */ + public int getOutputVersionFormatValue() { + return outputVersionFormat_; + } + /** + *
+   * Deprecated. The log entry format to use for this sink's exported log
+   * entries.  The v2 format is used by default and cannot be changed.
+   * 
+ * + * .google.logging.v2.LogSink.VersionFormat output_version_format = 6; + */ + public com.google.logging.v2.LogSink.VersionFormat getOutputVersionFormat() { + com.google.logging.v2.LogSink.VersionFormat result = com.google.logging.v2.LogSink.VersionFormat.valueOf(outputVersionFormat_); + return result == null ? com.google.logging.v2.LogSink.VersionFormat.UNRECOGNIZED : result; + } + + public static final int WRITER_IDENTITY_FIELD_NUMBER = 8; + private volatile java.lang.Object writerIdentity_; + /** + *
+   * Output only. An IAM identity&mdash;a service account or group&mdash;under
+   * which Stackdriver Logging writes the exported log entries to the sink's
+   * destination.  This field is set by
+   * [sinks.create](/logging/docs/api/reference/rest/v2/projects.sinks/create)
+   * and
+   * [sinks.update](/logging/docs/api/reference/rest/v2/projects.sinks/update),
+   * based on the setting of `unique_writer_identity` in those methods.
+   * Until you grant this identity write-access to the destination, log entry
+   * exports from this sink will fail. For more information,
+   * see [Granting access for a
+   * resource](/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource).
+   * Consult the destination service's documentation to determine the
+   * appropriate IAM roles to assign to the identity.
+   * 
+ * + * string writer_identity = 8; + */ + public java.lang.String getWriterIdentity() { + java.lang.Object ref = writerIdentity_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + writerIdentity_ = s; + return s; + } + } + /** + *
+   * Output only. An IAM identity&mdash;a service account or group&mdash;under
+   * which Stackdriver Logging writes the exported log entries to the sink's
+   * destination.  This field is set by
+   * [sinks.create](/logging/docs/api/reference/rest/v2/projects.sinks/create)
+   * and
+   * [sinks.update](/logging/docs/api/reference/rest/v2/projects.sinks/update),
+   * based on the setting of `unique_writer_identity` in those methods.
+   * Until you grant this identity write-access to the destination, log entry
+   * exports from this sink will fail. For more information,
+   * see [Granting access for a
+   * resource](/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource).
+   * Consult the destination service's documentation to determine the
+   * appropriate IAM roles to assign to the identity.
+   * 
+ * + * string writer_identity = 8; + */ + public com.google.protobuf.ByteString + getWriterIdentityBytes() { + java.lang.Object ref = writerIdentity_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + writerIdentity_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INCLUDE_CHILDREN_FIELD_NUMBER = 9; + private boolean includeChildren_; + /** + *
+   * Optional. This field applies only to sinks owned by organizations and
+   * folders. If the field is false, the default, only the logs owned by the
+   * sink's parent resource are available for export. If the field is true, then
+   * logs from all the projects, folders, and billing accounts contained in the
+   * sink's parent resource are also available for export. Whether a particular
+   * log entry from the children is exported depends on the sink's filter
+   * expression. For example, if this field is true, then the filter
+   * `resource.type=gce_instance` would export all Compute Engine VM instance
+   * log entries from all projects in the sink's parent. To only export entries
+   * from certain child projects, filter on the project part of the log name:
+   *     logName:("projects/test-project1/" OR "projects/test-project2/") AND
+   *     resource.type=gce_instance
+   * 
+ * + * bool include_children = 9; + */ + public boolean getIncludeChildren() { + return includeChildren_; + } + + public static final int START_TIME_FIELD_NUMBER = 10; + private com.google.protobuf.Timestamp startTime_; + /** + *
+   * Deprecated. This field is ignored when creating or updating sinks.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 10; + */ + public boolean hasStartTime() { + return startTime_ != null; + } + /** + *
+   * Deprecated. This field is ignored when creating or updating sinks.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 10; + */ + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + /** + *
+   * Deprecated. This field is ignored when creating or updating sinks.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 10; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return getStartTime(); + } + + public static final int END_TIME_FIELD_NUMBER = 11; + private com.google.protobuf.Timestamp endTime_; + /** + *
+   * Deprecated. This field is ignored when creating or updating sinks.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 11; + */ + public boolean hasEndTime() { + return endTime_ != null; + } + /** + *
+   * Deprecated. This field is ignored when creating or updating sinks.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 11; + */ + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + *
+   * Deprecated. This field is ignored when creating or updating sinks.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 11; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return getEndTime(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getDestinationBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, destination_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, filter_); + } + if (outputVersionFormat_ != com.google.logging.v2.LogSink.VersionFormat.VERSION_FORMAT_UNSPECIFIED.getNumber()) { + output.writeEnum(6, outputVersionFormat_); + } + if (!getWriterIdentityBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, writerIdentity_); + } + if (includeChildren_ != false) { + output.writeBool(9, includeChildren_); + } + if (startTime_ != null) { + output.writeMessage(10, getStartTime()); + } + if (endTime_ != null) { + output.writeMessage(11, getEndTime()); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getDestinationBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, destination_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, filter_); + } + if (outputVersionFormat_ != com.google.logging.v2.LogSink.VersionFormat.VERSION_FORMAT_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(6, outputVersionFormat_); + } + if (!getWriterIdentityBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, writerIdentity_); + } + if (includeChildren_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(9, includeChildren_); + } + if (startTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(10, getStartTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(11, getEndTime()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.logging.v2.LogSink)) { + return super.equals(obj); + } + com.google.logging.v2.LogSink other = (com.google.logging.v2.LogSink) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && getDestination() + .equals(other.getDestination()); + result = result && getFilter() + .equals(other.getFilter()); + result = result && outputVersionFormat_ == other.outputVersionFormat_; + result = result && getWriterIdentity() + .equals(other.getWriterIdentity()); + result = result && (getIncludeChildren() + == other.getIncludeChildren()); + result = result && (hasStartTime() == other.hasStartTime()); + if (hasStartTime()) { + result = result && getStartTime() + .equals(other.getStartTime()); + } + result = result && (hasEndTime() == other.hasEndTime()); + if (hasEndTime()) { + result = result && getEndTime() + .equals(other.getEndTime()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DESTINATION_FIELD_NUMBER; + hash = (53 * hash) + getDestination().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + OUTPUT_VERSION_FORMAT_FIELD_NUMBER; + hash = (53 * hash) + outputVersionFormat_; + hash = (37 * hash) + WRITER_IDENTITY_FIELD_NUMBER; + hash = (53 * hash) + getWriterIdentity().hashCode(); + hash = (37 * hash) + INCLUDE_CHILDREN_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIncludeChildren()); + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.LogSink parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.LogSink parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.LogSink parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.LogSink parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.LogSink parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.LogSink parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.LogSink parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.LogSink parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.LogSink parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.logging.v2.LogSink parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.LogSink parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.LogSink parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.logging.v2.LogSink prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Describes a sink used to export log entries to one of the following
+   * destinations in any project: a Cloud Storage bucket, a BigQuery dataset, or a
+   * Cloud Pub/Sub topic.  A logs filter controls which log entries are
+   * exported. The sink must be created within a project, organization, billing
+   * account, or folder.
+   * 
+ * + * Protobuf type {@code google.logging.v2.LogSink} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.LogSink) + com.google.logging.v2.LogSinkOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_LogSink_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_LogSink_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.LogSink.class, com.google.logging.v2.LogSink.Builder.class); + } + + // Construct using com.google.logging.v2.LogSink.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + name_ = ""; + + destination_ = ""; + + filter_ = ""; + + outputVersionFormat_ = 0; + + writerIdentity_ = ""; + + includeChildren_ = false; + + if (startTimeBuilder_ == null) { + startTime_ = null; + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + if (endTimeBuilder_ == null) { + endTime_ = null; + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_LogSink_descriptor; + } + + public com.google.logging.v2.LogSink getDefaultInstanceForType() { + return com.google.logging.v2.LogSink.getDefaultInstance(); + } + + public com.google.logging.v2.LogSink build() { + com.google.logging.v2.LogSink result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.logging.v2.LogSink buildPartial() { + com.google.logging.v2.LogSink result = new com.google.logging.v2.LogSink(this); + result.name_ = name_; + result.destination_ = destination_; + result.filter_ = filter_; + result.outputVersionFormat_ = outputVersionFormat_; + result.writerIdentity_ = writerIdentity_; + result.includeChildren_ = includeChildren_; + if (startTimeBuilder_ == null) { + result.startTime_ = startTime_; + } else { + result.startTime_ = startTimeBuilder_.build(); + } + if (endTimeBuilder_ == null) { + result.endTime_ = endTime_; + } else { + result.endTime_ = endTimeBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.logging.v2.LogSink) { + return mergeFrom((com.google.logging.v2.LogSink)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.LogSink other) { + if (other == com.google.logging.v2.LogSink.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDestination().isEmpty()) { + destination_ = other.destination_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (other.outputVersionFormat_ != 0) { + setOutputVersionFormatValue(other.getOutputVersionFormatValue()); + } + if (!other.getWriterIdentity().isEmpty()) { + writerIdentity_ = other.writerIdentity_; + onChanged(); + } + if (other.getIncludeChildren() != false) { + setIncludeChildren(other.getIncludeChildren()); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.logging.v2.LogSink parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.logging.v2.LogSink) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * Required. The client-assigned sink identifier, unique within the
+     * project. Example: `"my-syslog-errors-to-pubsub"`.  Sink identifiers are
+     * limited to 100 characters and can include only the following characters:
+     * upper and lower-case alphanumeric characters, underscores, hyphens, and
+     * periods.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The client-assigned sink identifier, unique within the
+     * project. Example: `"my-syslog-errors-to-pubsub"`.  Sink identifiers are
+     * limited to 100 characters and can include only the following characters:
+     * upper and lower-case alphanumeric characters, underscores, hyphens, and
+     * periods.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The client-assigned sink identifier, unique within the
+     * project. Example: `"my-syslog-errors-to-pubsub"`.  Sink identifiers are
+     * limited to 100 characters and can include only the following characters:
+     * upper and lower-case alphanumeric characters, underscores, hyphens, and
+     * periods.
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The client-assigned sink identifier, unique within the
+     * project. Example: `"my-syslog-errors-to-pubsub"`.  Sink identifiers are
+     * limited to 100 characters and can include only the following characters:
+     * upper and lower-case alphanumeric characters, underscores, hyphens, and
+     * periods.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Required. The client-assigned sink identifier, unique within the
+     * project. Example: `"my-syslog-errors-to-pubsub"`.  Sink identifiers are
+     * limited to 100 characters and can include only the following characters:
+     * upper and lower-case alphanumeric characters, underscores, hyphens, and
+     * periods.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object destination_ = ""; + /** + *
+     * Required. The export destination:
+     *     "storage.googleapis.com/[GCS_BUCKET]"
+     *     "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]"
+     *     "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]"
+     * The sink's `writer_identity`, set when the sink is created, must
+     * have permission to write to the destination or else the log
+     * entries are not exported.  For more information, see
+     * [Exporting Logs With Sinks](/logging/docs/api/tasks/exporting-logs).
+     * 
+ * + * string destination = 3; + */ + public java.lang.String getDestination() { + java.lang.Object ref = destination_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + destination_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The export destination:
+     *     "storage.googleapis.com/[GCS_BUCKET]"
+     *     "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]"
+     *     "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]"
+     * The sink's `writer_identity`, set when the sink is created, must
+     * have permission to write to the destination or else the log
+     * entries are not exported.  For more information, see
+     * [Exporting Logs With Sinks](/logging/docs/api/tasks/exporting-logs).
+     * 
+ * + * string destination = 3; + */ + public com.google.protobuf.ByteString + getDestinationBytes() { + java.lang.Object ref = destination_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + destination_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The export destination:
+     *     "storage.googleapis.com/[GCS_BUCKET]"
+     *     "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]"
+     *     "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]"
+     * The sink's `writer_identity`, set when the sink is created, must
+     * have permission to write to the destination or else the log
+     * entries are not exported.  For more information, see
+     * [Exporting Logs With Sinks](/logging/docs/api/tasks/exporting-logs).
+     * 
+ * + * string destination = 3; + */ + public Builder setDestination( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + destination_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The export destination:
+     *     "storage.googleapis.com/[GCS_BUCKET]"
+     *     "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]"
+     *     "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]"
+     * The sink's `writer_identity`, set when the sink is created, must
+     * have permission to write to the destination or else the log
+     * entries are not exported.  For more information, see
+     * [Exporting Logs With Sinks](/logging/docs/api/tasks/exporting-logs).
+     * 
+ * + * string destination = 3; + */ + public Builder clearDestination() { + + destination_ = getDefaultInstance().getDestination(); + onChanged(); + return this; + } + /** + *
+     * Required. The export destination:
+     *     "storage.googleapis.com/[GCS_BUCKET]"
+     *     "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]"
+     *     "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]"
+     * The sink's `writer_identity`, set when the sink is created, must
+     * have permission to write to the destination or else the log
+     * entries are not exported.  For more information, see
+     * [Exporting Logs With Sinks](/logging/docs/api/tasks/exporting-logs).
+     * 
+ * + * string destination = 3; + */ + public Builder setDestinationBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + destination_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + *
+     * Optional.
+     * An [advanced logs filter](/logging/docs/view/advanced_filters).  The only
+     * exported log entries are those that are in the resource owning the sink and
+     * that match the filter.  For example:
+     *     logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR
+     * 
+ * + * string filter = 5; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Optional.
+     * An [advanced logs filter](/logging/docs/view/advanced_filters).  The only
+     * exported log entries are those that are in the resource owning the sink and
+     * that match the filter.  For example:
+     *     logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR
+     * 
+ * + * string filter = 5; + */ + public com.google.protobuf.ByteString + getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Optional.
+     * An [advanced logs filter](/logging/docs/view/advanced_filters).  The only
+     * exported log entries are those that are in the resource owning the sink and
+     * that match the filter.  For example:
+     *     logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR
+     * 
+ * + * string filter = 5; + */ + public Builder setFilter( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional.
+     * An [advanced logs filter](/logging/docs/view/advanced_filters).  The only
+     * exported log entries are those that are in the resource owning the sink and
+     * that match the filter.  For example:
+     *     logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR
+     * 
+ * + * string filter = 5; + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + *
+     * Optional.
+     * An [advanced logs filter](/logging/docs/view/advanced_filters).  The only
+     * exported log entries are those that are in the resource owning the sink and
+     * that match the filter.  For example:
+     *     logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR
+     * 
+ * + * string filter = 5; + */ + public Builder setFilterBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private int outputVersionFormat_ = 0; + /** + *
+     * Deprecated. The log entry format to use for this sink's exported log
+     * entries.  The v2 format is used by default and cannot be changed.
+     * 
+ * + * .google.logging.v2.LogSink.VersionFormat output_version_format = 6; + */ + public int getOutputVersionFormatValue() { + return outputVersionFormat_; + } + /** + *
+     * Deprecated. The log entry format to use for this sink's exported log
+     * entries.  The v2 format is used by default and cannot be changed.
+     * 
+ * + * .google.logging.v2.LogSink.VersionFormat output_version_format = 6; + */ + public Builder setOutputVersionFormatValue(int value) { + outputVersionFormat_ = value; + onChanged(); + return this; + } + /** + *
+     * Deprecated. The log entry format to use for this sink's exported log
+     * entries.  The v2 format is used by default and cannot be changed.
+     * 
+ * + * .google.logging.v2.LogSink.VersionFormat output_version_format = 6; + */ + public com.google.logging.v2.LogSink.VersionFormat getOutputVersionFormat() { + com.google.logging.v2.LogSink.VersionFormat result = com.google.logging.v2.LogSink.VersionFormat.valueOf(outputVersionFormat_); + return result == null ? com.google.logging.v2.LogSink.VersionFormat.UNRECOGNIZED : result; + } + /** + *
+     * Deprecated. The log entry format to use for this sink's exported log
+     * entries.  The v2 format is used by default and cannot be changed.
+     * 
+ * + * .google.logging.v2.LogSink.VersionFormat output_version_format = 6; + */ + public Builder setOutputVersionFormat(com.google.logging.v2.LogSink.VersionFormat value) { + if (value == null) { + throw new NullPointerException(); + } + + outputVersionFormat_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Deprecated. The log entry format to use for this sink's exported log
+     * entries.  The v2 format is used by default and cannot be changed.
+     * 
+ * + * .google.logging.v2.LogSink.VersionFormat output_version_format = 6; + */ + public Builder clearOutputVersionFormat() { + + outputVersionFormat_ = 0; + onChanged(); + return this; + } + + private java.lang.Object writerIdentity_ = ""; + /** + *
+     * Output only. An IAM identity&mdash;a service account or group&mdash;under
+     * which Stackdriver Logging writes the exported log entries to the sink's
+     * destination.  This field is set by
+     * [sinks.create](/logging/docs/api/reference/rest/v2/projects.sinks/create)
+     * and
+     * [sinks.update](/logging/docs/api/reference/rest/v2/projects.sinks/update),
+     * based on the setting of `unique_writer_identity` in those methods.
+     * Until you grant this identity write-access to the destination, log entry
+     * exports from this sink will fail. For more information,
+     * see [Granting access for a
+     * resource](/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource).
+     * Consult the destination service's documentation to determine the
+     * appropriate IAM roles to assign to the identity.
+     * 
+ * + * string writer_identity = 8; + */ + public java.lang.String getWriterIdentity() { + java.lang.Object ref = writerIdentity_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + writerIdentity_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Output only. An IAM identity&mdash;a service account or group&mdash;under
+     * which Stackdriver Logging writes the exported log entries to the sink's
+     * destination.  This field is set by
+     * [sinks.create](/logging/docs/api/reference/rest/v2/projects.sinks/create)
+     * and
+     * [sinks.update](/logging/docs/api/reference/rest/v2/projects.sinks/update),
+     * based on the setting of `unique_writer_identity` in those methods.
+     * Until you grant this identity write-access to the destination, log entry
+     * exports from this sink will fail. For more information,
+     * see [Granting access for a
+     * resource](/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource).
+     * Consult the destination service's documentation to determine the
+     * appropriate IAM roles to assign to the identity.
+     * 
+ * + * string writer_identity = 8; + */ + public com.google.protobuf.ByteString + getWriterIdentityBytes() { + java.lang.Object ref = writerIdentity_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + writerIdentity_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Output only. An IAM identity&mdash;a service account or group&mdash;under
+     * which Stackdriver Logging writes the exported log entries to the sink's
+     * destination.  This field is set by
+     * [sinks.create](/logging/docs/api/reference/rest/v2/projects.sinks/create)
+     * and
+     * [sinks.update](/logging/docs/api/reference/rest/v2/projects.sinks/update),
+     * based on the setting of `unique_writer_identity` in those methods.
+     * Until you grant this identity write-access to the destination, log entry
+     * exports from this sink will fail. For more information,
+     * see [Granting access for a
+     * resource](/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource).
+     * Consult the destination service's documentation to determine the
+     * appropriate IAM roles to assign to the identity.
+     * 
+ * + * string writer_identity = 8; + */ + public Builder setWriterIdentity( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + writerIdentity_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. An IAM identity&mdash;a service account or group&mdash;under
+     * which Stackdriver Logging writes the exported log entries to the sink's
+     * destination.  This field is set by
+     * [sinks.create](/logging/docs/api/reference/rest/v2/projects.sinks/create)
+     * and
+     * [sinks.update](/logging/docs/api/reference/rest/v2/projects.sinks/update),
+     * based on the setting of `unique_writer_identity` in those methods.
+     * Until you grant this identity write-access to the destination, log entry
+     * exports from this sink will fail. For more information,
+     * see [Granting access for a
+     * resource](/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource).
+     * Consult the destination service's documentation to determine the
+     * appropriate IAM roles to assign to the identity.
+     * 
+ * + * string writer_identity = 8; + */ + public Builder clearWriterIdentity() { + + writerIdentity_ = getDefaultInstance().getWriterIdentity(); + onChanged(); + return this; + } + /** + *
+     * Output only. An IAM identity&mdash;a service account or group&mdash;under
+     * which Stackdriver Logging writes the exported log entries to the sink's
+     * destination.  This field is set by
+     * [sinks.create](/logging/docs/api/reference/rest/v2/projects.sinks/create)
+     * and
+     * [sinks.update](/logging/docs/api/reference/rest/v2/projects.sinks/update),
+     * based on the setting of `unique_writer_identity` in those methods.
+     * Until you grant this identity write-access to the destination, log entry
+     * exports from this sink will fail. For more information,
+     * see [Granting access for a
+     * resource](/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource).
+     * Consult the destination service's documentation to determine the
+     * appropriate IAM roles to assign to the identity.
+     * 
+ * + * string writer_identity = 8; + */ + public Builder setWriterIdentityBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + writerIdentity_ = value; + onChanged(); + return this; + } + + private boolean includeChildren_ ; + /** + *
+     * Optional. This field applies only to sinks owned by organizations and
+     * folders. If the field is false, the default, only the logs owned by the
+     * sink's parent resource are available for export. If the field is true, then
+     * logs from all the projects, folders, and billing accounts contained in the
+     * sink's parent resource are also available for export. Whether a particular
+     * log entry from the children is exported depends on the sink's filter
+     * expression. For example, if this field is true, then the filter
+     * `resource.type=gce_instance` would export all Compute Engine VM instance
+     * log entries from all projects in the sink's parent. To only export entries
+     * from certain child projects, filter on the project part of the log name:
+     *     logName:("projects/test-project1/" OR "projects/test-project2/") AND
+     *     resource.type=gce_instance
+     * 
+ * + * bool include_children = 9; + */ + public boolean getIncludeChildren() { + return includeChildren_; + } + /** + *
+     * Optional. This field applies only to sinks owned by organizations and
+     * folders. If the field is false, the default, only the logs owned by the
+     * sink's parent resource are available for export. If the field is true, then
+     * logs from all the projects, folders, and billing accounts contained in the
+     * sink's parent resource are also available for export. Whether a particular
+     * log entry from the children is exported depends on the sink's filter
+     * expression. For example, if this field is true, then the filter
+     * `resource.type=gce_instance` would export all Compute Engine VM instance
+     * log entries from all projects in the sink's parent. To only export entries
+     * from certain child projects, filter on the project part of the log name:
+     *     logName:("projects/test-project1/" OR "projects/test-project2/") AND
+     *     resource.type=gce_instance
+     * 
+ * + * bool include_children = 9; + */ + public Builder setIncludeChildren(boolean value) { + + includeChildren_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. This field applies only to sinks owned by organizations and
+     * folders. If the field is false, the default, only the logs owned by the
+     * sink's parent resource are available for export. If the field is true, then
+     * logs from all the projects, folders, and billing accounts contained in the
+     * sink's parent resource are also available for export. Whether a particular
+     * log entry from the children is exported depends on the sink's filter
+     * expression. For example, if this field is true, then the filter
+     * `resource.type=gce_instance` would export all Compute Engine VM instance
+     * log entries from all projects in the sink's parent. To only export entries
+     * from certain child projects, filter on the project part of the log name:
+     *     logName:("projects/test-project1/" OR "projects/test-project2/") AND
+     *     resource.type=gce_instance
+     * 
+ * + * bool include_children = 9; + */ + public Builder clearIncludeChildren() { + + includeChildren_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp startTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> startTimeBuilder_; + /** + *
+     * Deprecated. This field is ignored when creating or updating sinks.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 10; + */ + public boolean hasStartTime() { + return startTimeBuilder_ != null || startTime_ != null; + } + /** + *
+     * Deprecated. This field is ignored when creating or updating sinks.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 10; + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + /** + *
+     * Deprecated. This field is ignored when creating or updating sinks.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 10; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + onChanged(); + } else { + startTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Deprecated. This field is ignored when creating or updating sinks.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 10; + */ + public Builder setStartTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + onChanged(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Deprecated. This field is ignored when creating or updating sinks.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 10; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (startTime_ != null) { + startTime_ = + com.google.protobuf.Timestamp.newBuilder(startTime_).mergeFrom(value).buildPartial(); + } else { + startTime_ = value; + } + onChanged(); + } else { + startTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Deprecated. This field is ignored when creating or updating sinks.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 10; + */ + public Builder clearStartTime() { + if (startTimeBuilder_ == null) { + startTime_ = null; + onChanged(); + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Deprecated. This field is ignored when creating or updating sinks.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 10; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Deprecated. This field is ignored when creating or updating sinks.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 10; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + /** + *
+     * Deprecated. This field is ignored when creating or updating sinks.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getStartTime(), + getParentForChildren(), + isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> endTimeBuilder_; + /** + *
+     * Deprecated. This field is ignored when creating or updating sinks.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 11; + */ + public boolean hasEndTime() { + return endTimeBuilder_ != null || endTime_ != null; + } + /** + *
+     * Deprecated. This field is ignored when creating or updating sinks.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 11; + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + *
+     * Deprecated. This field is ignored when creating or updating sinks.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 11; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + onChanged(); + } else { + endTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Deprecated. This field is ignored when creating or updating sinks.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 11; + */ + public Builder setEndTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + onChanged(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Deprecated. This field is ignored when creating or updating sinks.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 11; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (endTime_ != null) { + endTime_ = + com.google.protobuf.Timestamp.newBuilder(endTime_).mergeFrom(value).buildPartial(); + } else { + endTime_ = value; + } + onChanged(); + } else { + endTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Deprecated. This field is ignored when creating or updating sinks.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 11; + */ + public Builder clearEndTime() { + if (endTimeBuilder_ == null) { + endTime_ = null; + onChanged(); + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Deprecated. This field is ignored when creating or updating sinks.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 11; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Deprecated. This field is ignored when creating or updating sinks.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 11; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + *
+     * Deprecated. This field is ignored when creating or updating sinks.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 11; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getEndTime(), + getParentForChildren(), + isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.logging.v2.LogSink) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.LogSink) + private static final com.google.logging.v2.LogSink DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.logging.v2.LogSink(); + } + + public static com.google.logging.v2.LogSink getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public LogSink parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LogSink(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.logging.v2.LogSink getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogSinkOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogSinkOrBuilder.java new file mode 100644 index 000000000000..6ce5c4ca91ee --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogSinkOrBuilder.java @@ -0,0 +1,224 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_config.proto + +package com.google.logging.v2; + +public interface LogSinkOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.LogSink) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The client-assigned sink identifier, unique within the
+   * project. Example: `"my-syslog-errors-to-pubsub"`.  Sink identifiers are
+   * limited to 100 characters and can include only the following characters:
+   * upper and lower-case alphanumeric characters, underscores, hyphens, and
+   * periods.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * Required. The client-assigned sink identifier, unique within the
+   * project. Example: `"my-syslog-errors-to-pubsub"`.  Sink identifiers are
+   * limited to 100 characters and can include only the following characters:
+   * upper and lower-case alphanumeric characters, underscores, hyphens, and
+   * periods.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * Required. The export destination:
+   *     "storage.googleapis.com/[GCS_BUCKET]"
+   *     "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]"
+   *     "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]"
+   * The sink's `writer_identity`, set when the sink is created, must
+   * have permission to write to the destination or else the log
+   * entries are not exported.  For more information, see
+   * [Exporting Logs With Sinks](/logging/docs/api/tasks/exporting-logs).
+   * 
+ * + * string destination = 3; + */ + java.lang.String getDestination(); + /** + *
+   * Required. The export destination:
+   *     "storage.googleapis.com/[GCS_BUCKET]"
+   *     "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]"
+   *     "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]"
+   * The sink's `writer_identity`, set when the sink is created, must
+   * have permission to write to the destination or else the log
+   * entries are not exported.  For more information, see
+   * [Exporting Logs With Sinks](/logging/docs/api/tasks/exporting-logs).
+   * 
+ * + * string destination = 3; + */ + com.google.protobuf.ByteString + getDestinationBytes(); + + /** + *
+   * Optional.
+   * An [advanced logs filter](/logging/docs/view/advanced_filters).  The only
+   * exported log entries are those that are in the resource owning the sink and
+   * that match the filter.  For example:
+   *     logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR
+   * 
+ * + * string filter = 5; + */ + java.lang.String getFilter(); + /** + *
+   * Optional.
+   * An [advanced logs filter](/logging/docs/view/advanced_filters).  The only
+   * exported log entries are those that are in the resource owning the sink and
+   * that match the filter.  For example:
+   *     logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR
+   * 
+ * + * string filter = 5; + */ + com.google.protobuf.ByteString + getFilterBytes(); + + /** + *
+   * Deprecated. The log entry format to use for this sink's exported log
+   * entries.  The v2 format is used by default and cannot be changed.
+   * 
+ * + * .google.logging.v2.LogSink.VersionFormat output_version_format = 6; + */ + int getOutputVersionFormatValue(); + /** + *
+   * Deprecated. The log entry format to use for this sink's exported log
+   * entries.  The v2 format is used by default and cannot be changed.
+   * 
+ * + * .google.logging.v2.LogSink.VersionFormat output_version_format = 6; + */ + com.google.logging.v2.LogSink.VersionFormat getOutputVersionFormat(); + + /** + *
+   * Output only. An IAM identity&mdash;a service account or group&mdash;under
+   * which Stackdriver Logging writes the exported log entries to the sink's
+   * destination.  This field is set by
+   * [sinks.create](/logging/docs/api/reference/rest/v2/projects.sinks/create)
+   * and
+   * [sinks.update](/logging/docs/api/reference/rest/v2/projects.sinks/update),
+   * based on the setting of `unique_writer_identity` in those methods.
+   * Until you grant this identity write-access to the destination, log entry
+   * exports from this sink will fail. For more information,
+   * see [Granting access for a
+   * resource](/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource).
+   * Consult the destination service's documentation to determine the
+   * appropriate IAM roles to assign to the identity.
+   * 
+ * + * string writer_identity = 8; + */ + java.lang.String getWriterIdentity(); + /** + *
+   * Output only. An IAM identity&mdash;a service account or group&mdash;under
+   * which Stackdriver Logging writes the exported log entries to the sink's
+   * destination.  This field is set by
+   * [sinks.create](/logging/docs/api/reference/rest/v2/projects.sinks/create)
+   * and
+   * [sinks.update](/logging/docs/api/reference/rest/v2/projects.sinks/update),
+   * based on the setting of `unique_writer_identity` in those methods.
+   * Until you grant this identity write-access to the destination, log entry
+   * exports from this sink will fail. For more information,
+   * see [Granting access for a
+   * resource](/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource).
+   * Consult the destination service's documentation to determine the
+   * appropriate IAM roles to assign to the identity.
+   * 
+ * + * string writer_identity = 8; + */ + com.google.protobuf.ByteString + getWriterIdentityBytes(); + + /** + *
+   * Optional. This field applies only to sinks owned by organizations and
+   * folders. If the field is false, the default, only the logs owned by the
+   * sink's parent resource are available for export. If the field is true, then
+   * logs from all the projects, folders, and billing accounts contained in the
+   * sink's parent resource are also available for export. Whether a particular
+   * log entry from the children is exported depends on the sink's filter
+   * expression. For example, if this field is true, then the filter
+   * `resource.type=gce_instance` would export all Compute Engine VM instance
+   * log entries from all projects in the sink's parent. To only export entries
+   * from certain child projects, filter on the project part of the log name:
+   *     logName:("projects/test-project1/" OR "projects/test-project2/") AND
+   *     resource.type=gce_instance
+   * 
+ * + * bool include_children = 9; + */ + boolean getIncludeChildren(); + + /** + *
+   * Deprecated. This field is ignored when creating or updating sinks.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 10; + */ + boolean hasStartTime(); + /** + *
+   * Deprecated. This field is ignored when creating or updating sinks.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 10; + */ + com.google.protobuf.Timestamp getStartTime(); + /** + *
+   * Deprecated. This field is ignored when creating or updating sinks.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 10; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + *
+   * Deprecated. This field is ignored when creating or updating sinks.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 11; + */ + boolean hasEndTime(); + /** + *
+   * Deprecated. This field is ignored when creating or updating sinks.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 11; + */ + com.google.protobuf.Timestamp getEndTime(); + /** + *
+   * Deprecated. This field is ignored when creating or updating sinks.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 11; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingConfigProto.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingConfigProto.java new file mode 100644 index 000000000000..88a12ccba4fd --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingConfigProto.java @@ -0,0 +1,287 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_config.proto + +package com.google.logging.v2; + +public final class LoggingConfigProto { + private LoggingConfigProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_LogSink_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_LogSink_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_ListSinksRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_ListSinksRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_ListSinksResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_ListSinksResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_GetSinkRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_GetSinkRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_CreateSinkRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_CreateSinkRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_UpdateSinkRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_UpdateSinkRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_DeleteSinkRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_DeleteSinkRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_LogExclusion_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_LogExclusion_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_ListExclusionsRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_ListExclusionsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_ListExclusionsResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_ListExclusionsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_GetExclusionRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_GetExclusionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_CreateExclusionRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_CreateExclusionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_UpdateExclusionRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_UpdateExclusionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_DeleteExclusionRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_DeleteExclusionRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n&google/logging/v2/logging_config.proto" + + "\022\021google.logging.v2\032\034google/api/annotati" + + "ons.proto\032\033google/protobuf/empty.proto\032 " + + "google/protobuf/field_mask.proto\032\037google" + + "/protobuf/timestamp.proto\"\327\002\n\007LogSink\022\014\n" + + "\004name\030\001 \001(\t\022\023\n\013destination\030\003 \001(\t\022\016\n\006filt" + + "er\030\005 \001(\t\022G\n\025output_version_format\030\006 \001(\0162" + + "(.google.logging.v2.LogSink.VersionForma" + + "t\022\027\n\017writer_identity\030\010 \001(\t\022\030\n\020include_ch" + + "ildren\030\t \001(\010\022.\n\nstart_time\030\n \001(\0132\032.googl" + + "e.protobuf.Timestamp\022,\n\010end_time\030\013 \001(\0132\032" + + ".google.protobuf.Timestamp\"?\n\rVersionFor" + + "mat\022\036\n\032VERSION_FORMAT_UNSPECIFIED\020\000\022\006\n\002V" + + "2\020\001\022\006\n\002V1\020\002\"I\n\020ListSinksRequest\022\016\n\006paren" + + "t\030\001 \001(\t\022\022\n\npage_token\030\002 \001(\t\022\021\n\tpage_size" + + "\030\003 \001(\005\"W\n\021ListSinksResponse\022)\n\005sinks\030\001 \003" + + "(\0132\032.google.logging.v2.LogSink\022\027\n\017next_p" + + "age_token\030\002 \001(\t\"#\n\016GetSinkRequest\022\021\n\tsin" + + "k_name\030\001 \001(\t\"m\n\021CreateSinkRequest\022\016\n\006par" + + "ent\030\001 \001(\t\022(\n\004sink\030\002 \001(\0132\032.google.logging" + + ".v2.LogSink\022\036\n\026unique_writer_identity\030\003 " + + "\001(\010\"\241\001\n\021UpdateSinkRequest\022\021\n\tsink_name\030\001" + + " \001(\t\022(\n\004sink\030\002 \001(\0132\032.google.logging.v2.L" + + "ogSink\022\036\n\026unique_writer_identity\030\003 \001(\010\022/" + + "\n\013update_mask\030\004 \001(\0132\032.google.protobuf.Fi" + + "eldMask\"&\n\021DeleteSinkRequest\022\021\n\tsink_nam" + + "e\030\001 \001(\t\"S\n\014LogExclusion\022\014\n\004name\030\001 \001(\t\022\023\n" + + "\013description\030\002 \001(\t\022\016\n\006filter\030\003 \001(\t\022\020\n\010di" + + "sabled\030\004 \001(\010\"N\n\025ListExclusionsRequest\022\016\n" + + "\006parent\030\001 \001(\t\022\022\n\npage_token\030\002 \001(\t\022\021\n\tpag" + + "e_size\030\003 \001(\005\"f\n\026ListExclusionsResponse\0223" + + "\n\nexclusions\030\001 \003(\0132\037.google.logging.v2.L" + + "ogExclusion\022\027\n\017next_page_token\030\002 \001(\t\"#\n\023" + + "GetExclusionRequest\022\014\n\004name\030\001 \001(\t\"\\\n\026Cre" + + "ateExclusionRequest\022\016\n\006parent\030\001 \001(\t\0222\n\te" + + "xclusion\030\002 \001(\0132\037.google.logging.v2.LogEx" + + "clusion\"\213\001\n\026UpdateExclusionRequest\022\014\n\004na" + + "me\030\001 \001(\t\0222\n\texclusion\030\002 \001(\0132\037.google.log" + + "ging.v2.LogExclusion\022/\n\013update_mask\030\003 \001(" + + "\0132\032.google.protobuf.FieldMask\"&\n\026DeleteE" + + "xclusionRequest\022\014\n\004name\030\001 \001(\t2\200\n\n\017Config" + + "ServiceV2\022v\n\tListSinks\022#.google.logging." + + "v2.ListSinksRequest\032$.google.logging.v2." + + "ListSinksResponse\"\036\202\323\344\223\002\030\022\026/v2/{parent=*" + + "/*}/sinks\022m\n\007GetSink\022!.google.logging.v2" + + ".GetSinkRequest\032\032.google.logging.v2.LogS" + + "ink\"#\202\323\344\223\002\035\022\033/v2/{sink_name=*/*/sinks/*}" + + "\022t\n\nCreateSink\022$.google.logging.v2.Creat" + + "eSinkRequest\032\032.google.logging.v2.LogSink" + + "\"$\202\323\344\223\002\036\"\026/v2/{parent=*/*}/sinks:\004sink\022y" + + "\n\nUpdateSink\022$.google.logging.v2.UpdateS" + + "inkRequest\032\032.google.logging.v2.LogSink\")" + + "\202\323\344\223\002#\032\033/v2/{sink_name=*/*/sinks/*}:\004sin" + + "k\022o\n\nDeleteSink\022$.google.logging.v2.Dele" + + "teSinkRequest\032\026.google.protobuf.Empty\"#\202" + + "\323\344\223\002\035*\033/v2/{sink_name=*/*/sinks/*}\022\212\001\n\016L" + + "istExclusions\022(.google.logging.v2.ListEx" + + "clusionsRequest\032).google.logging.v2.List" + + "ExclusionsResponse\"#\202\323\344\223\002\035\022\033/v2/{parent=" + + "*/*}/exclusions\022|\n\014GetExclusion\022&.google" + + ".logging.v2.GetExclusionRequest\032\037.google" + + ".logging.v2.LogExclusion\"#\202\323\344\223\002\035\022\033/v2/{n" + + "ame=*/*/exclusions/*}\022\215\001\n\017CreateExclusio" + + "n\022).google.logging.v2.CreateExclusionReq" + + "uest\032\037.google.logging.v2.LogExclusion\".\202" + + "\323\344\223\002(\"\033/v2/{parent=*/*}/exclusions:\texcl" + + "usion\022\215\001\n\017UpdateExclusion\022).google.loggi" + + "ng.v2.UpdateExclusionRequest\032\037.google.lo" + + "gging.v2.LogExclusion\".\202\323\344\223\002(2\033/v2/{name" + + "=*/*/exclusions/*}:\texclusion\022y\n\017DeleteE" + + "xclusion\022).google.logging.v2.DeleteExclu" + + "sionRequest\032\026.google.protobuf.Empty\"#\202\323\344" + + "\223\002\035*\033/v2/{name=*/*/exclusions/*}B\236\001\n\025com" + + ".google.logging.v2B\022LoggingConfigProtoP\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" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }, assigner); + internal_static_google_logging_v2_LogSink_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_logging_v2_LogSink_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_LogSink_descriptor, + new java.lang.String[] { "Name", "Destination", "Filter", "OutputVersionFormat", "WriterIdentity", "IncludeChildren", "StartTime", "EndTime", }); + internal_static_google_logging_v2_ListSinksRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_logging_v2_ListSinksRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_ListSinksRequest_descriptor, + new java.lang.String[] { "Parent", "PageToken", "PageSize", }); + internal_static_google_logging_v2_ListSinksResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_logging_v2_ListSinksResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_ListSinksResponse_descriptor, + new java.lang.String[] { "Sinks", "NextPageToken", }); + internal_static_google_logging_v2_GetSinkRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_logging_v2_GetSinkRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_GetSinkRequest_descriptor, + new java.lang.String[] { "SinkName", }); + internal_static_google_logging_v2_CreateSinkRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_logging_v2_CreateSinkRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_CreateSinkRequest_descriptor, + new java.lang.String[] { "Parent", "Sink", "UniqueWriterIdentity", }); + internal_static_google_logging_v2_UpdateSinkRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_logging_v2_UpdateSinkRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_UpdateSinkRequest_descriptor, + new java.lang.String[] { "SinkName", "Sink", "UniqueWriterIdentity", "UpdateMask", }); + internal_static_google_logging_v2_DeleteSinkRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_logging_v2_DeleteSinkRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_DeleteSinkRequest_descriptor, + new java.lang.String[] { "SinkName", }); + internal_static_google_logging_v2_LogExclusion_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_logging_v2_LogExclusion_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_LogExclusion_descriptor, + new java.lang.String[] { "Name", "Description", "Filter", "Disabled", }); + internal_static_google_logging_v2_ListExclusionsRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_logging_v2_ListExclusionsRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_ListExclusionsRequest_descriptor, + new java.lang.String[] { "Parent", "PageToken", "PageSize", }); + internal_static_google_logging_v2_ListExclusionsResponse_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_logging_v2_ListExclusionsResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_ListExclusionsResponse_descriptor, + new java.lang.String[] { "Exclusions", "NextPageToken", }); + internal_static_google_logging_v2_GetExclusionRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_logging_v2_GetExclusionRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_GetExclusionRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_logging_v2_CreateExclusionRequest_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_logging_v2_CreateExclusionRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_CreateExclusionRequest_descriptor, + new java.lang.String[] { "Parent", "Exclusion", }); + internal_static_google_logging_v2_UpdateExclusionRequest_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_logging_v2_UpdateExclusionRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_UpdateExclusionRequest_descriptor, + new java.lang.String[] { "Name", "Exclusion", "UpdateMask", }); + internal_static_google_logging_v2_DeleteExclusionRequest_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_logging_v2_DeleteExclusionRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_DeleteExclusionRequest_descriptor, + new java.lang.String[] { "Name", }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.AnnotationsProto.http); + com.google.protobuf.Descriptors.FileDescriptor + .internalUpdateFileDescriptor(descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} 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 new file mode 100644 index 000000000000..e51a3615a54f --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingMetricsProto.java @@ -0,0 +1,195 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_metrics.proto + +package com.google.logging.v2; + +public final class LoggingMetricsProto { + private LoggingMetricsProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_LogMetric_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_LogMetric_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_LogMetric_LabelExtractorsEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_LogMetric_LabelExtractorsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_ListLogMetricsRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_ListLogMetricsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_ListLogMetricsResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_ListLogMetricsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_GetLogMetricRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_GetLogMetricRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_CreateLogMetricRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_CreateLogMetricRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_UpdateLogMetricRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_UpdateLogMetricRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_DeleteLogMetricRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_DeleteLogMetricRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\'google/logging/v2/logging_metrics.prot" + + "o\022\021google.logging.v2\032\034google/api/annotat" + + "ions.proto\032\035google/api/distribution.prot" + + "o\032\027google/api/metric.proto\032\033google/proto" + + "buf/empty.proto\032 google/protobuf/field_m" + + "ask.proto\"\255\003\n\tLogMetric\022\014\n\004name\030\001 \001(\t\022\023\n" + + "\013description\030\002 \001(\t\022\016\n\006filter\030\003 \001(\t\0227\n\021me" + + "tric_descriptor\030\005 \001(\0132\034.google.api.Metri" + + "cDescriptor\022\027\n\017value_extractor\030\006 \001(\t\022K\n\020" + + "label_extractors\030\007 \003(\01321.google.logging." + + "v2.LogMetric.LabelExtractorsEntry\022>\n\016buc" + + "ket_options\030\010 \001(\0132&.google.api.Distribut" + + "ion.BucketOptions\0228\n\007version\030\004 \001(\0162\'.goo" + + "gle.logging.v2.LogMetric.ApiVersion\0326\n\024L" + + "abelExtractorsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005valu" + + "e\030\002 \001(\t:\0028\001\"\034\n\nApiVersion\022\006\n\002V2\020\000\022\006\n\002V1\020" + + "\001\"N\n\025ListLogMetricsRequest\022\016\n\006parent\030\001 \001" + + "(\t\022\022\n\npage_token\030\002 \001(\t\022\021\n\tpage_size\030\003 \001(" + + "\005\"`\n\026ListLogMetricsResponse\022-\n\007metrics\030\001" + + " \003(\0132\034.google.logging.v2.LogMetric\022\027\n\017ne" + + "xt_page_token\030\002 \001(\t\"*\n\023GetLogMetricReque" + + "st\022\023\n\013metric_name\030\001 \001(\t\"V\n\026CreateLogMetr" + + "icRequest\022\016\n\006parent\030\001 \001(\t\022,\n\006metric\030\002 \001(" + + "\0132\034.google.logging.v2.LogMetric\"[\n\026Updat" + + "eLogMetricRequest\022\023\n\013metric_name\030\001 \001(\t\022," + + "\n\006metric\030\002 \001(\0132\034.google.logging.v2.LogMe" + + "tric\"-\n\026DeleteLogMetricRequest\022\023\n\013metric" + + "_name\030\001 \001(\t2\324\005\n\020MetricsServiceV2\022\216\001\n\016Lis" + + "tLogMetrics\022(.google.logging.v2.ListLogM" + + "etricsRequest\032).google.logging.v2.ListLo" + + "gMetricsResponse\"\'\202\323\344\223\002!\022\037/v2/{parent=pr" + + "ojects/*}/metrics\022\204\001\n\014GetLogMetric\022&.goo" + + "gle.logging.v2.GetLogMetricRequest\032\034.goo" + + "gle.logging.v2.LogMetric\".\202\323\344\223\002(\022&/v2/{m" + + "etric_name=projects/*/metrics/*}\022\213\001\n\017Cre" + + "ateLogMetric\022).google.logging.v2.CreateL" + + "ogMetricRequest\032\034.google.logging.v2.LogM" + + "etric\"/\202\323\344\223\002)\"\037/v2/{parent=projects/*}/m" + + "etrics:\006metric\022\222\001\n\017UpdateLogMetric\022).goo" + + "gle.logging.v2.UpdateLogMetricRequest\032\034." + + "google.logging.v2.LogMetric\"6\202\323\344\223\0020\032&/v2" + + "/{metric_name=projects/*/metrics/*}:\006met" + + "ric\022\204\001\n\017DeleteLogMetric\022).google.logging" + + ".v2.DeleteLogMetricRequest\032\026.google.prot" + + "obuf.Empty\".\202\323\344\223\002(*&/v2/{metric_name=pro" + + "jects/*/metrics/*}B\237\001\n\025com.google.loggin" + + "g.v2B\023LoggingMetricsProtoP\001Z8google.gola" + + "ng.org/genproto/googleapis/logging/v2;lo" + + "gging\370\001\001\252\002\027Google.Cloud.Logging.V2\312\002\027Goo" + + "gle\\Cloud\\Logging\\V2b\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.DistributionProto.getDescriptor(), + com.google.api.MetricProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + }, assigner); + internal_static_google_logging_v2_LogMetric_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_logging_v2_LogMetric_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_LogMetric_descriptor, + new java.lang.String[] { "Name", "Description", "Filter", "MetricDescriptor", "ValueExtractor", "LabelExtractors", "BucketOptions", "Version", }); + internal_static_google_logging_v2_LogMetric_LabelExtractorsEntry_descriptor = + internal_static_google_logging_v2_LogMetric_descriptor.getNestedTypes().get(0); + internal_static_google_logging_v2_LogMetric_LabelExtractorsEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_LogMetric_LabelExtractorsEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_google_logging_v2_ListLogMetricsRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_logging_v2_ListLogMetricsRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_ListLogMetricsRequest_descriptor, + new java.lang.String[] { "Parent", "PageToken", "PageSize", }); + internal_static_google_logging_v2_ListLogMetricsResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_logging_v2_ListLogMetricsResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_ListLogMetricsResponse_descriptor, + new java.lang.String[] { "Metrics", "NextPageToken", }); + internal_static_google_logging_v2_GetLogMetricRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_logging_v2_GetLogMetricRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_GetLogMetricRequest_descriptor, + new java.lang.String[] { "MetricName", }); + internal_static_google_logging_v2_CreateLogMetricRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_logging_v2_CreateLogMetricRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_CreateLogMetricRequest_descriptor, + new java.lang.String[] { "Parent", "Metric", }); + internal_static_google_logging_v2_UpdateLogMetricRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_logging_v2_UpdateLogMetricRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_UpdateLogMetricRequest_descriptor, + new java.lang.String[] { "MetricName", "Metric", }); + internal_static_google_logging_v2_DeleteLogMetricRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_logging_v2_DeleteLogMetricRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_DeleteLogMetricRequest_descriptor, + new java.lang.String[] { "MetricName", }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.AnnotationsProto.http); + com.google.protobuf.Descriptors.FileDescriptor + .internalUpdateFileDescriptor(descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.DistributionProto.getDescriptor(); + com.google.api.MetricProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} 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 new file mode 100644 index 000000000000..aa8cb015383a --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingProto.java @@ -0,0 +1,251 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging.proto + +package com.google.logging.v2; + +public final class LoggingProto { + private LoggingProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_DeleteLogRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_DeleteLogRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_WriteLogEntriesRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_WriteLogEntriesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_WriteLogEntriesRequest_LabelsEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_WriteLogEntriesRequest_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_WriteLogEntriesResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_WriteLogEntriesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_WriteLogEntriesPartialErrors_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_WriteLogEntriesPartialErrors_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_WriteLogEntriesPartialErrors_LogEntryErrorsEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_WriteLogEntriesPartialErrors_LogEntryErrorsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_ListLogEntriesRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_ListLogEntriesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_ListLogEntriesResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_ListLogEntriesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_ListMonitoredResourceDescriptorsRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_ListMonitoredResourceDescriptorsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_ListMonitoredResourceDescriptorsResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_ListMonitoredResourceDescriptorsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_ListLogsRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_ListLogsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_ListLogsResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_ListLogsResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\037google/logging/v2/logging.proto\022\021googl" + + "e.logging.v2\032\034google/api/annotations.pro" + + "to\032#google/api/monitored_resource.proto\032" + + "!google/logging/v2/log_entry.proto\032\036goog" + + "le/protobuf/duration.proto\032\033google/proto" + + "buf/empty.proto\032\037google/protobuf/timesta" + + "mp.proto\032\027google/rpc/status.proto\"$\n\020Del" + + "eteLogRequest\022\020\n\010log_name\030\001 \001(\t\"\230\002\n\026Writ" + + "eLogEntriesRequest\022\020\n\010log_name\030\001 \001(\t\022/\n\010" + + "resource\030\002 \001(\0132\035.google.api.MonitoredRes" + + "ource\022E\n\006labels\030\003 \003(\01325.google.logging.v" + + "2.WriteLogEntriesRequest.LabelsEntry\022,\n\007" + + "entries\030\004 \003(\0132\033.google.logging.v2.LogEnt" + + "ry\022\027\n\017partial_success\030\005 \001(\010\032-\n\013LabelsEnt" + + "ry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\031\n\027Wr" + + "iteLogEntriesResponse\"\310\001\n\034WriteLogEntrie" + + "sPartialErrors\022]\n\020log_entry_errors\030\001 \003(\013" + + "2C.google.logging.v2.WriteLogEntriesPart" + + "ialErrors.LogEntryErrorsEntry\032I\n\023LogEntr" + + "yErrorsEntry\022\013\n\003key\030\001 \001(\005\022!\n\005value\030\002 \001(\013" + + "2\022.google.rpc.Status:\0028\001\"\215\001\n\025ListLogEntr" + + "iesRequest\022\023\n\013project_ids\030\001 \003(\t\022\026\n\016resou" + + "rce_names\030\010 \003(\t\022\016\n\006filter\030\002 \001(\t\022\020\n\010order" + + "_by\030\003 \001(\t\022\021\n\tpage_size\030\004 \001(\005\022\022\n\npage_tok" + + "en\030\005 \001(\t\"_\n\026ListLogEntriesResponse\022,\n\007en" + + "tries\030\001 \003(\0132\033.google.logging.v2.LogEntry" + + "\022\027\n\017next_page_token\030\002 \001(\t\"P\n\'ListMonitor" + + "edResourceDescriptorsRequest\022\021\n\tpage_siz" + + "e\030\001 \001(\005\022\022\n\npage_token\030\002 \001(\t\"\212\001\n(ListMoni" + + "toredResourceDescriptorsResponse\022E\n\024reso" + + "urce_descriptors\030\001 \003(\0132\'.google.api.Moni" + + "toredResourceDescriptor\022\027\n\017next_page_tok" + + "en\030\002 \001(\t\"H\n\017ListLogsRequest\022\016\n\006parent\030\001 " + + "\001(\t\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001" + + "(\t\">\n\020ListLogsResponse\022\021\n\tlog_names\030\003 \003(" + + "\t\022\027\n\017next_page_token\030\002 \001(\t2\325\005\n\020LoggingSe" + + "rviceV2\022w\n\tDeleteLog\022#.google.logging.v2" + + ".DeleteLogRequest\032\026.google.protobuf.Empt" + + "y\"-\202\323\344\223\002\'*%/v2beta1/{log_name=projects/*" + + "/logs/*}\022\206\001\n\017WriteLogEntries\022).google.lo" + + "gging.v2.WriteLogEntriesRequest\032*.google" + + ".logging.v2.WriteLogEntriesResponse\"\034\202\323\344" + + "\223\002\026\"\021/v2/entries:write:\001*\022\202\001\n\016ListLogEnt" + + "ries\022(.google.logging.v2.ListLogEntriesR" + + "equest\032).google.logging.v2.ListLogEntrie" + + "sResponse\"\033\202\323\344\223\002\025\"\020/v2/entries:list:\001*\022\305" + + "\001\n ListMonitoredResourceDescriptors\022:.go" + + "ogle.logging.v2.ListMonitoredResourceDes" + + "criptorsRequest\032;.google.logging.v2.List" + + "MonitoredResourceDescriptorsResponse\"(\202\323" + + "\344\223\002\"\022 /v2/monitoredResourceDescriptors\022r" + + "\n\010ListLogs\022\".google.logging.v2.ListLogsR" + + "equest\032#.google.logging.v2.ListLogsRespo" + + "nse\"\035\202\323\344\223\002\027\022\025/v2/{parent=*/*}/logsB\230\001\n\025c" + + "om.google.logging.v2B\014LoggingProtoP\001Z8go" + + "ogle.golang.org/genproto/googleapis/logg" + + "ing/v2;logging\370\001\001\252\002\027Google.Cloud.Logging" + + ".V2\312\002\027Google\\Cloud\\Logging\\V2b\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.MonitoredResourceProto.getDescriptor(), + com.google.logging.v2.LogEntryProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.rpc.StatusProto.getDescriptor(), + }, assigner); + internal_static_google_logging_v2_DeleteLogRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_logging_v2_DeleteLogRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_DeleteLogRequest_descriptor, + new java.lang.String[] { "LogName", }); + internal_static_google_logging_v2_WriteLogEntriesRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_logging_v2_WriteLogEntriesRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_WriteLogEntriesRequest_descriptor, + new java.lang.String[] { "LogName", "Resource", "Labels", "Entries", "PartialSuccess", }); + internal_static_google_logging_v2_WriteLogEntriesRequest_LabelsEntry_descriptor = + internal_static_google_logging_v2_WriteLogEntriesRequest_descriptor.getNestedTypes().get(0); + internal_static_google_logging_v2_WriteLogEntriesRequest_LabelsEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_WriteLogEntriesRequest_LabelsEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_google_logging_v2_WriteLogEntriesResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_logging_v2_WriteLogEntriesResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_WriteLogEntriesResponse_descriptor, + new java.lang.String[] { }); + internal_static_google_logging_v2_WriteLogEntriesPartialErrors_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_logging_v2_WriteLogEntriesPartialErrors_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_WriteLogEntriesPartialErrors_descriptor, + new java.lang.String[] { "LogEntryErrors", }); + internal_static_google_logging_v2_WriteLogEntriesPartialErrors_LogEntryErrorsEntry_descriptor = + internal_static_google_logging_v2_WriteLogEntriesPartialErrors_descriptor.getNestedTypes().get(0); + internal_static_google_logging_v2_WriteLogEntriesPartialErrors_LogEntryErrorsEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_WriteLogEntriesPartialErrors_LogEntryErrorsEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_google_logging_v2_ListLogEntriesRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_logging_v2_ListLogEntriesRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_ListLogEntriesRequest_descriptor, + new java.lang.String[] { "ProjectIds", "ResourceNames", "Filter", "OrderBy", "PageSize", "PageToken", }); + internal_static_google_logging_v2_ListLogEntriesResponse_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_logging_v2_ListLogEntriesResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_ListLogEntriesResponse_descriptor, + new java.lang.String[] { "Entries", "NextPageToken", }); + internal_static_google_logging_v2_ListMonitoredResourceDescriptorsRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_logging_v2_ListMonitoredResourceDescriptorsRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_ListMonitoredResourceDescriptorsRequest_descriptor, + new java.lang.String[] { "PageSize", "PageToken", }); + internal_static_google_logging_v2_ListMonitoredResourceDescriptorsResponse_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_logging_v2_ListMonitoredResourceDescriptorsResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_ListMonitoredResourceDescriptorsResponse_descriptor, + new java.lang.String[] { "ResourceDescriptors", "NextPageToken", }); + internal_static_google_logging_v2_ListLogsRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_logging_v2_ListLogsRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_ListLogsRequest_descriptor, + new java.lang.String[] { "Parent", "PageSize", "PageToken", }); + internal_static_google_logging_v2_ListLogsResponse_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_logging_v2_ListLogsResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_ListLogsResponse_descriptor, + new java.lang.String[] { "LogNames", "NextPageToken", }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.AnnotationsProto.http); + com.google.protobuf.Descriptors.FileDescriptor + .internalUpdateFileDescriptor(descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.MonitoredResourceProto.getDescriptor(); + com.google.logging.v2.LogEntryProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.rpc.StatusProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/MetricName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/MetricName.java new file mode 100644 index 000000000000..be95f44ed9ba --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/MetricName.java @@ -0,0 +1,23 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.logging.v2; + +import com.google.api.resourcenames.ResourceName; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public abstract class MetricName implements ResourceName { + protected MetricName() {} +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/MetricNames.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/MetricNames.java new file mode 100644 index 000000000000..0e3801ffdd11 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/MetricNames.java @@ -0,0 +1,30 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.logging.v2; + +import com.google.api.resourcenames.ResourceName; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class MetricNames { + private MetricNames() {} + + public static MetricName parse(String resourceNameString) { + if (ProjectMetricName.isParsableFrom(resourceNameString)) { + return ProjectMetricName.parse(resourceNameString); + } + return UntypedMetricName.parse(resourceNameString); + } +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/OrganizationExclusionName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/OrganizationExclusionName.java new file mode 100644 index 000000000000..4303b0a08468 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/OrganizationExclusionName.java @@ -0,0 +1,198 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.logging.v2; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameType; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class OrganizationExclusionName extends ExclusionName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("organizations/{organization}/exclusions/{exclusion}"); + + private volatile Map fieldValuesMap; + + private final String organization; + private final String exclusion; + + public String getOrganization() { + return organization; + } + + public String getExclusion() { + return exclusion; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private OrganizationExclusionName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + exclusion = Preconditions.checkNotNull(builder.getExclusion()); + } + + public static OrganizationExclusionName of(String organization, String exclusion) { + return newBuilder() + .setOrganization(organization) + .setExclusion(exclusion) + .build(); + } + + public static String format(String organization, String exclusion) { + return newBuilder() + .setOrganization(organization) + .setExclusion(exclusion) + .build() + .toString(); + } + + public static OrganizationExclusionName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "OrganizationExclusionName.parse: formattedString not in valid format"); + return of(matchMap.get("organization"), matchMap.get("exclusion")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (OrganizationExclusionName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("organization", organization); + fieldMapBuilder.put("exclusion", exclusion); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + /** + * @deprecated This method is only present to satisfy the ResourceName interface. + */ + @Deprecated + public ResourceNameType getType() { + throw new UnsupportedOperationException("OrganizationExclusionName.getType() not supported"); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("organization", organization, "exclusion", exclusion); + } + + /** Builder for OrganizationExclusionName. */ + public static class Builder { + + private String organization; + private String exclusion; + + public String getOrganization() { + return organization; + } + + public String getExclusion() { + return exclusion; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setExclusion(String exclusion) { + this.exclusion = exclusion; + return this; + } + + private Builder() { + } + + private Builder(OrganizationExclusionName organizationExclusionName) { + organization = organizationExclusionName.organization; + exclusion = organizationExclusionName.exclusion; + } + + public OrganizationExclusionName build() { + return new OrganizationExclusionName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof OrganizationExclusionName) { + OrganizationExclusionName that = (OrganizationExclusionName) o; + return (this.organization.equals(that.organization)) + && (this.exclusion.equals(that.exclusion)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= organization.hashCode(); + h *= 1000003; + h ^= exclusion.hashCode(); + return h; + } +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/OrganizationLogName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/OrganizationLogName.java new file mode 100644 index 000000000000..3e36ac28eaff --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/OrganizationLogName.java @@ -0,0 +1,198 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.logging.v2; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameType; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class OrganizationLogName extends LogName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("organizations/{organization}/logs/{log}"); + + private volatile Map fieldValuesMap; + + private final String organization; + private final String log; + + public String getOrganization() { + return organization; + } + + public String getLog() { + return log; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private OrganizationLogName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + log = Preconditions.checkNotNull(builder.getLog()); + } + + public static OrganizationLogName of(String organization, String log) { + return newBuilder() + .setOrganization(organization) + .setLog(log) + .build(); + } + + public static String format(String organization, String log) { + return newBuilder() + .setOrganization(organization) + .setLog(log) + .build() + .toString(); + } + + public static OrganizationLogName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "OrganizationLogName.parse: formattedString not in valid format"); + return of(matchMap.get("organization"), matchMap.get("log")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (OrganizationLogName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("organization", organization); + fieldMapBuilder.put("log", log); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + /** + * @deprecated This method is only present to satisfy the ResourceName interface. + */ + @Deprecated + public ResourceNameType getType() { + throw new UnsupportedOperationException("OrganizationLogName.getType() not supported"); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("organization", organization, "log", log); + } + + /** Builder for OrganizationLogName. */ + public static class Builder { + + private String organization; + private String log; + + public String getOrganization() { + return organization; + } + + public String getLog() { + return log; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setLog(String log) { + this.log = log; + return this; + } + + private Builder() { + } + + private Builder(OrganizationLogName organizationLogName) { + organization = organizationLogName.organization; + log = organizationLogName.log; + } + + public OrganizationLogName build() { + return new OrganizationLogName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof OrganizationLogName) { + OrganizationLogName that = (OrganizationLogName) o; + return (this.organization.equals(that.organization)) + && (this.log.equals(that.log)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= organization.hashCode(); + h *= 1000003; + h ^= log.hashCode(); + return h; + } +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/OrganizationName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/OrganizationName.java new file mode 100644 index 000000000000..9f5490254675 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/OrganizationName.java @@ -0,0 +1,175 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.logging.v2; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameType; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class OrganizationName extends ParentName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("organizations/{organization}"); + + private volatile Map fieldValuesMap; + + private final String organization; + + public String getOrganization() { + return organization; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private OrganizationName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + } + + public static OrganizationName of(String organization) { + return newBuilder() + .setOrganization(organization) + .build(); + } + + public static String format(String organization) { + return newBuilder() + .setOrganization(organization) + .build() + .toString(); + } + + public static OrganizationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "OrganizationName.parse: formattedString not in valid format"); + return of(matchMap.get("organization")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (OrganizationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("organization", organization); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + /** + * @deprecated This method is only present to satisfy the ResourceName interface. + */ + @Deprecated + public ResourceNameType getType() { + throw new UnsupportedOperationException("OrganizationName.getType() not supported"); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("organization", organization); + } + + /** Builder for OrganizationName. */ + public static class Builder { + + private String organization; + + public String getOrganization() { + return organization; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + private Builder() { + } + + private Builder(OrganizationName organizationName) { + organization = organizationName.organization; + } + + public OrganizationName build() { + return new OrganizationName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof OrganizationName) { + OrganizationName that = (OrganizationName) o; + return (this.organization.equals(that.organization)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= organization.hashCode(); + return h; + } +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/OrganizationSinkName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/OrganizationSinkName.java new file mode 100644 index 000000000000..b632cbd6a312 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/OrganizationSinkName.java @@ -0,0 +1,198 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.logging.v2; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameType; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class OrganizationSinkName extends SinkName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("organizations/{organization}/sinks/{sink}"); + + private volatile Map fieldValuesMap; + + private final String organization; + private final String sink; + + public String getOrganization() { + return organization; + } + + public String getSink() { + return sink; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private OrganizationSinkName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + sink = Preconditions.checkNotNull(builder.getSink()); + } + + public static OrganizationSinkName of(String organization, String sink) { + return newBuilder() + .setOrganization(organization) + .setSink(sink) + .build(); + } + + public static String format(String organization, String sink) { + return newBuilder() + .setOrganization(organization) + .setSink(sink) + .build() + .toString(); + } + + public static OrganizationSinkName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "OrganizationSinkName.parse: formattedString not in valid format"); + return of(matchMap.get("organization"), matchMap.get("sink")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (OrganizationSinkName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("organization", organization); + fieldMapBuilder.put("sink", sink); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + /** + * @deprecated This method is only present to satisfy the ResourceName interface. + */ + @Deprecated + public ResourceNameType getType() { + throw new UnsupportedOperationException("OrganizationSinkName.getType() not supported"); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("organization", organization, "sink", sink); + } + + /** Builder for OrganizationSinkName. */ + public static class Builder { + + private String organization; + private String sink; + + public String getOrganization() { + return organization; + } + + public String getSink() { + return sink; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setSink(String sink) { + this.sink = sink; + return this; + } + + private Builder() { + } + + private Builder(OrganizationSinkName organizationSinkName) { + organization = organizationSinkName.organization; + sink = organizationSinkName.sink; + } + + public OrganizationSinkName build() { + return new OrganizationSinkName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof OrganizationSinkName) { + OrganizationSinkName that = (OrganizationSinkName) o; + return (this.organization.equals(that.organization)) + && (this.sink.equals(that.sink)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= organization.hashCode(); + h *= 1000003; + h ^= sink.hashCode(); + return h; + } +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ParentName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ParentName.java new file mode 100644 index 000000000000..1c7011862e78 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ParentName.java @@ -0,0 +1,23 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.logging.v2; + +import com.google.api.resourcenames.ResourceName; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public abstract class ParentName implements ResourceName { + protected ParentName() {} +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ParentNames.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ParentNames.java new file mode 100644 index 000000000000..666cbaff5951 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ParentNames.java @@ -0,0 +1,39 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.logging.v2; + +import com.google.api.resourcenames.ResourceName; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class ParentNames { + private ParentNames() {} + + public static ParentName parse(String resourceNameString) { + if (ProjectName.isParsableFrom(resourceNameString)) { + return ProjectName.parse(resourceNameString); + } + if (OrganizationName.isParsableFrom(resourceNameString)) { + return OrganizationName.parse(resourceNameString); + } + if (FolderName.isParsableFrom(resourceNameString)) { + return FolderName.parse(resourceNameString); + } + if (BillingName.isParsableFrom(resourceNameString)) { + return BillingName.parse(resourceNameString); + } + return UntypedParentName.parse(resourceNameString); + } +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ProjectExclusionName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ProjectExclusionName.java new file mode 100644 index 000000000000..71b45fb3e3b5 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ProjectExclusionName.java @@ -0,0 +1,198 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.logging.v2; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameType; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class ProjectExclusionName extends ExclusionName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/exclusions/{exclusion}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String exclusion; + + public String getProject() { + return project; + } + + public String getExclusion() { + return exclusion; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ProjectExclusionName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + exclusion = Preconditions.checkNotNull(builder.getExclusion()); + } + + public static ProjectExclusionName of(String project, String exclusion) { + return newBuilder() + .setProject(project) + .setExclusion(exclusion) + .build(); + } + + public static String format(String project, String exclusion) { + return newBuilder() + .setProject(project) + .setExclusion(exclusion) + .build() + .toString(); + } + + public static ProjectExclusionName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "ProjectExclusionName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("exclusion")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (ProjectExclusionName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("exclusion", exclusion); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + /** + * @deprecated This method is only present to satisfy the ResourceName interface. + */ + @Deprecated + public ResourceNameType getType() { + throw new UnsupportedOperationException("ProjectExclusionName.getType() not supported"); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "exclusion", exclusion); + } + + /** Builder for ProjectExclusionName. */ + public static class Builder { + + private String project; + private String exclusion; + + public String getProject() { + return project; + } + + public String getExclusion() { + return exclusion; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setExclusion(String exclusion) { + this.exclusion = exclusion; + return this; + } + + private Builder() { + } + + private Builder(ProjectExclusionName projectExclusionName) { + project = projectExclusionName.project; + exclusion = projectExclusionName.exclusion; + } + + public ProjectExclusionName build() { + return new ProjectExclusionName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ProjectExclusionName) { + ProjectExclusionName that = (ProjectExclusionName) o; + return (this.project.equals(that.project)) + && (this.exclusion.equals(that.exclusion)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= exclusion.hashCode(); + return h; + } +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ProjectLogName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ProjectLogName.java new file mode 100644 index 000000000000..d6dd792b19e0 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ProjectLogName.java @@ -0,0 +1,198 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.logging.v2; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameType; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class ProjectLogName extends LogName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/logs/{log}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String log; + + public String getProject() { + return project; + } + + public String getLog() { + return log; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ProjectLogName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + log = Preconditions.checkNotNull(builder.getLog()); + } + + public static ProjectLogName of(String project, String log) { + return newBuilder() + .setProject(project) + .setLog(log) + .build(); + } + + public static String format(String project, String log) { + return newBuilder() + .setProject(project) + .setLog(log) + .build() + .toString(); + } + + public static ProjectLogName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "ProjectLogName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("log")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (ProjectLogName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("log", log); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + /** + * @deprecated This method is only present to satisfy the ResourceName interface. + */ + @Deprecated + public ResourceNameType getType() { + throw new UnsupportedOperationException("ProjectLogName.getType() not supported"); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "log", log); + } + + /** Builder for ProjectLogName. */ + public static class Builder { + + private String project; + private String log; + + public String getProject() { + return project; + } + + public String getLog() { + return log; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLog(String log) { + this.log = log; + return this; + } + + private Builder() { + } + + private Builder(ProjectLogName projectLogName) { + project = projectLogName.project; + log = projectLogName.log; + } + + public ProjectLogName build() { + return new ProjectLogName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ProjectLogName) { + ProjectLogName that = (ProjectLogName) o; + return (this.project.equals(that.project)) + && (this.log.equals(that.log)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= log.hashCode(); + return h; + } +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ProjectMetricName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ProjectMetricName.java new file mode 100644 index 000000000000..4c3d1307ecaa --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ProjectMetricName.java @@ -0,0 +1,198 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.logging.v2; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameType; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class ProjectMetricName extends MetricName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/metrics/{metric}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String metric; + + public String getProject() { + return project; + } + + public String getMetric() { + return metric; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ProjectMetricName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + metric = Preconditions.checkNotNull(builder.getMetric()); + } + + public static ProjectMetricName of(String project, String metric) { + return newBuilder() + .setProject(project) + .setMetric(metric) + .build(); + } + + public static String format(String project, String metric) { + return newBuilder() + .setProject(project) + .setMetric(metric) + .build() + .toString(); + } + + public static ProjectMetricName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "ProjectMetricName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("metric")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (ProjectMetricName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("metric", metric); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + /** + * @deprecated This method is only present to satisfy the ResourceName interface. + */ + @Deprecated + public ResourceNameType getType() { + throw new UnsupportedOperationException("ProjectMetricName.getType() not supported"); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "metric", metric); + } + + /** Builder for ProjectMetricName. */ + public static class Builder { + + private String project; + private String metric; + + public String getProject() { + return project; + } + + public String getMetric() { + return metric; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setMetric(String metric) { + this.metric = metric; + return this; + } + + private Builder() { + } + + private Builder(ProjectMetricName projectMetricName) { + project = projectMetricName.project; + metric = projectMetricName.metric; + } + + public ProjectMetricName build() { + return new ProjectMetricName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ProjectMetricName) { + ProjectMetricName that = (ProjectMetricName) o; + return (this.project.equals(that.project)) + && (this.metric.equals(that.metric)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= metric.hashCode(); + return h; + } +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ProjectName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ProjectName.java new file mode 100644 index 000000000000..a2fc3c3233af --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ProjectName.java @@ -0,0 +1,175 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.logging.v2; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameType; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class ProjectName extends ParentName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}"); + + private volatile Map fieldValuesMap; + + private final String project; + + public String getProject() { + return project; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ProjectName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + } + + public static ProjectName of(String project) { + return newBuilder() + .setProject(project) + .build(); + } + + public static String format(String project) { + return newBuilder() + .setProject(project) + .build() + .toString(); + } + + public static ProjectName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "ProjectName.parse: formattedString not in valid format"); + return of(matchMap.get("project")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (ProjectName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + /** + * @deprecated This method is only present to satisfy the ResourceName interface. + */ + @Deprecated + public ResourceNameType getType() { + throw new UnsupportedOperationException("ProjectName.getType() not supported"); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project); + } + + /** Builder for ProjectName. */ + public static class Builder { + + private String project; + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + private Builder() { + } + + private Builder(ProjectName projectName) { + project = projectName.project; + } + + public ProjectName build() { + return new ProjectName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ProjectName) { + ProjectName that = (ProjectName) o; + return (this.project.equals(that.project)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + return h; + } +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ProjectSinkName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ProjectSinkName.java new file mode 100644 index 000000000000..d904019f50fe --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ProjectSinkName.java @@ -0,0 +1,198 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.logging.v2; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameType; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class ProjectSinkName extends SinkName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/sinks/{sink}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String sink; + + public String getProject() { + return project; + } + + public String getSink() { + return sink; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ProjectSinkName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + sink = Preconditions.checkNotNull(builder.getSink()); + } + + public static ProjectSinkName of(String project, String sink) { + return newBuilder() + .setProject(project) + .setSink(sink) + .build(); + } + + public static String format(String project, String sink) { + return newBuilder() + .setProject(project) + .setSink(sink) + .build() + .toString(); + } + + public static ProjectSinkName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "ProjectSinkName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("sink")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (ProjectSinkName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("sink", sink); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + /** + * @deprecated This method is only present to satisfy the ResourceName interface. + */ + @Deprecated + public ResourceNameType getType() { + throw new UnsupportedOperationException("ProjectSinkName.getType() not supported"); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "sink", sink); + } + + /** Builder for ProjectSinkName. */ + public static class Builder { + + private String project; + private String sink; + + public String getProject() { + return project; + } + + public String getSink() { + return sink; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setSink(String sink) { + this.sink = sink; + return this; + } + + private Builder() { + } + + private Builder(ProjectSinkName projectSinkName) { + project = projectSinkName.project; + sink = projectSinkName.sink; + } + + public ProjectSinkName build() { + return new ProjectSinkName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ProjectSinkName) { + ProjectSinkName that = (ProjectSinkName) o; + return (this.project.equals(that.project)) + && (this.sink.equals(that.sink)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= sink.hashCode(); + return h; + } +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/SinkName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/SinkName.java new file mode 100644 index 000000000000..46f4de84f534 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/SinkName.java @@ -0,0 +1,23 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.logging.v2; + +import com.google.api.resourcenames.ResourceName; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public abstract class SinkName implements ResourceName { + protected SinkName() {} +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/SinkNames.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/SinkNames.java new file mode 100644 index 000000000000..43a2dad32c03 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/SinkNames.java @@ -0,0 +1,39 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.logging.v2; + +import com.google.api.resourcenames.ResourceName; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class SinkNames { + private SinkNames() {} + + public static SinkName parse(String resourceNameString) { + if (ProjectSinkName.isParsableFrom(resourceNameString)) { + return ProjectSinkName.parse(resourceNameString); + } + if (OrganizationSinkName.isParsableFrom(resourceNameString)) { + return OrganizationSinkName.parse(resourceNameString); + } + if (FolderSinkName.isParsableFrom(resourceNameString)) { + return FolderSinkName.parse(resourceNameString); + } + if (BillingSinkName.isParsableFrom(resourceNameString)) { + return BillingSinkName.parse(resourceNameString); + } + return UntypedSinkName.parse(resourceNameString); + } +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UntypedExclusionName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UntypedExclusionName.java new file mode 100644 index 000000000000..defb47e86af0 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UntypedExclusionName.java @@ -0,0 +1,112 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.logging.v2; + +import com.google.common.base.Preconditions; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameType; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class UntypedExclusionName extends ExclusionName { + + private final String rawValue; + private Map valueMap; + + private UntypedExclusionName(String rawValue) { + this.rawValue = Preconditions.checkNotNull(rawValue); + this.valueMap = ImmutableMap.of("", rawValue); + } + + public static UntypedExclusionName from(ResourceName resourceName) { + return new UntypedExclusionName(resourceName.toString()); + } + + public static UntypedExclusionName parse(String formattedString) { + return new UntypedExclusionName(formattedString); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (UntypedExclusionName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return true; + } + + /** + * Return a map with a single value rawValue keyed on an empty String "". + */ + public Map getFieldValuesMap() { + return valueMap; + } + + /** + * Return the initial rawValue if @param fieldName is an empty String, else return null. + */ + public String getFieldValue(String fieldName) { + return valueMap.get(fieldName); + } + + /** + * @deprecated This method is only present to satisfy the ResourceName interface. + */ + @Deprecated + public ResourceNameType getType() { + throw new UnsupportedOperationException("UntypedExclusionName.getType() not supported"); + } + + @Override + public String toString() { + return rawValue; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof UntypedExclusionName) { + UntypedExclusionName that = (UntypedExclusionName) o; + return this.rawValue.equals(that.rawValue); + } + return false; + } + + @Override + public int hashCode() { + return rawValue.hashCode(); + } +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UntypedLogName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UntypedLogName.java new file mode 100644 index 000000000000..cae45308a882 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UntypedLogName.java @@ -0,0 +1,112 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.logging.v2; + +import com.google.common.base.Preconditions; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameType; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class UntypedLogName extends LogName { + + private final String rawValue; + private Map valueMap; + + private UntypedLogName(String rawValue) { + this.rawValue = Preconditions.checkNotNull(rawValue); + this.valueMap = ImmutableMap.of("", rawValue); + } + + public static UntypedLogName from(ResourceName resourceName) { + return new UntypedLogName(resourceName.toString()); + } + + public static UntypedLogName parse(String formattedString) { + return new UntypedLogName(formattedString); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (UntypedLogName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return true; + } + + /** + * Return a map with a single value rawValue keyed on an empty String "". + */ + public Map getFieldValuesMap() { + return valueMap; + } + + /** + * Return the initial rawValue if @param fieldName is an empty String, else return null. + */ + public String getFieldValue(String fieldName) { + return valueMap.get(fieldName); + } + + /** + * @deprecated This method is only present to satisfy the ResourceName interface. + */ + @Deprecated + public ResourceNameType getType() { + throw new UnsupportedOperationException("UntypedLogName.getType() not supported"); + } + + @Override + public String toString() { + return rawValue; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof UntypedLogName) { + UntypedLogName that = (UntypedLogName) o; + return this.rawValue.equals(that.rawValue); + } + return false; + } + + @Override + public int hashCode() { + return rawValue.hashCode(); + } +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UntypedMetricName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UntypedMetricName.java new file mode 100644 index 000000000000..c08d6d201997 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UntypedMetricName.java @@ -0,0 +1,112 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.logging.v2; + +import com.google.common.base.Preconditions; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameType; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class UntypedMetricName extends MetricName { + + private final String rawValue; + private Map valueMap; + + private UntypedMetricName(String rawValue) { + this.rawValue = Preconditions.checkNotNull(rawValue); + this.valueMap = ImmutableMap.of("", rawValue); + } + + public static UntypedMetricName from(ResourceName resourceName) { + return new UntypedMetricName(resourceName.toString()); + } + + public static UntypedMetricName parse(String formattedString) { + return new UntypedMetricName(formattedString); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (UntypedMetricName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return true; + } + + /** + * Return a map with a single value rawValue keyed on an empty String "". + */ + public Map getFieldValuesMap() { + return valueMap; + } + + /** + * Return the initial rawValue if @param fieldName is an empty String, else return null. + */ + public String getFieldValue(String fieldName) { + return valueMap.get(fieldName); + } + + /** + * @deprecated This method is only present to satisfy the ResourceName interface. + */ + @Deprecated + public ResourceNameType getType() { + throw new UnsupportedOperationException("UntypedMetricName.getType() not supported"); + } + + @Override + public String toString() { + return rawValue; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof UntypedMetricName) { + UntypedMetricName that = (UntypedMetricName) o; + return this.rawValue.equals(that.rawValue); + } + return false; + } + + @Override + public int hashCode() { + return rawValue.hashCode(); + } +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UntypedParentName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UntypedParentName.java new file mode 100644 index 000000000000..51c58bf59035 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UntypedParentName.java @@ -0,0 +1,112 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.logging.v2; + +import com.google.common.base.Preconditions; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameType; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class UntypedParentName extends ParentName { + + private final String rawValue; + private Map valueMap; + + private UntypedParentName(String rawValue) { + this.rawValue = Preconditions.checkNotNull(rawValue); + this.valueMap = ImmutableMap.of("", rawValue); + } + + public static UntypedParentName from(ResourceName resourceName) { + return new UntypedParentName(resourceName.toString()); + } + + public static UntypedParentName parse(String formattedString) { + return new UntypedParentName(formattedString); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (UntypedParentName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return true; + } + + /** + * Return a map with a single value rawValue keyed on an empty String "". + */ + public Map getFieldValuesMap() { + return valueMap; + } + + /** + * Return the initial rawValue if @param fieldName is an empty String, else return null. + */ + public String getFieldValue(String fieldName) { + return valueMap.get(fieldName); + } + + /** + * @deprecated This method is only present to satisfy the ResourceName interface. + */ + @Deprecated + public ResourceNameType getType() { + throw new UnsupportedOperationException("UntypedParentName.getType() not supported"); + } + + @Override + public String toString() { + return rawValue; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof UntypedParentName) { + UntypedParentName that = (UntypedParentName) o; + return this.rawValue.equals(that.rawValue); + } + return false; + } + + @Override + public int hashCode() { + return rawValue.hashCode(); + } +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UntypedSinkName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UntypedSinkName.java new file mode 100644 index 000000000000..40300901c46f --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UntypedSinkName.java @@ -0,0 +1,112 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.logging.v2; + +import com.google.common.base.Preconditions; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameType; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class UntypedSinkName extends SinkName { + + private final String rawValue; + private Map valueMap; + + private UntypedSinkName(String rawValue) { + this.rawValue = Preconditions.checkNotNull(rawValue); + this.valueMap = ImmutableMap.of("", rawValue); + } + + public static UntypedSinkName from(ResourceName resourceName) { + return new UntypedSinkName(resourceName.toString()); + } + + public static UntypedSinkName parse(String formattedString) { + return new UntypedSinkName(formattedString); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (UntypedSinkName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return true; + } + + /** + * Return a map with a single value rawValue keyed on an empty String "". + */ + public Map getFieldValuesMap() { + return valueMap; + } + + /** + * Return the initial rawValue if @param fieldName is an empty String, else return null. + */ + public String getFieldValue(String fieldName) { + return valueMap.get(fieldName); + } + + /** + * @deprecated This method is only present to satisfy the ResourceName interface. + */ + @Deprecated + public ResourceNameType getType() { + throw new UnsupportedOperationException("UntypedSinkName.getType() not supported"); + } + + @Override + public String toString() { + return rawValue; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof UntypedSinkName) { + UntypedSinkName that = (UntypedSinkName) o; + return this.rawValue.equals(that.rawValue); + } + return false; + } + + @Override + public int hashCode() { + return rawValue.hashCode(); + } +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateExclusionRequest.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateExclusionRequest.java new file mode 100644 index 000000000000..221e5ab18b70 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateExclusionRequest.java @@ -0,0 +1,1117 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_config.proto + +package com.google.logging.v2; + +/** + *
+ * The parameters to `UpdateExclusion`.
+ * 
+ * + * Protobuf type {@code google.logging.v2.UpdateExclusionRequest} + */ +public final class UpdateExclusionRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.logging.v2.UpdateExclusionRequest) + UpdateExclusionRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use UpdateExclusionRequest.newBuilder() to construct. + private UpdateExclusionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private UpdateExclusionRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private UpdateExclusionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: { + com.google.logging.v2.LogExclusion.Builder subBuilder = null; + if (exclusion_ != null) { + subBuilder = exclusion_.toBuilder(); + } + exclusion_ = input.readMessage(com.google.logging.v2.LogExclusion.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(exclusion_); + exclusion_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_UpdateExclusionRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_UpdateExclusionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.UpdateExclusionRequest.class, com.google.logging.v2.UpdateExclusionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Required. The resource name of the exclusion to update:
+   *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+   * Example: `"projects/my-project-id/exclusions/my-exclusion-id"`.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * Required. The resource name of the exclusion to update:
+   *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+   * Example: `"projects/my-project-id/exclusions/my-exclusion-id"`.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXCLUSION_FIELD_NUMBER = 2; + private com.google.logging.v2.LogExclusion exclusion_; + /** + *
+   * Required. New values for the existing exclusion. Only the fields specified
+   * in `update_mask` are relevant.
+   * 
+ * + * .google.logging.v2.LogExclusion exclusion = 2; + */ + public boolean hasExclusion() { + return exclusion_ != null; + } + /** + *
+   * Required. New values for the existing exclusion. Only the fields specified
+   * in `update_mask` are relevant.
+   * 
+ * + * .google.logging.v2.LogExclusion exclusion = 2; + */ + public com.google.logging.v2.LogExclusion getExclusion() { + return exclusion_ == null ? com.google.logging.v2.LogExclusion.getDefaultInstance() : exclusion_; + } + /** + *
+   * Required. New values for the existing exclusion. Only the fields specified
+   * in `update_mask` are relevant.
+   * 
+ * + * .google.logging.v2.LogExclusion exclusion = 2; + */ + public com.google.logging.v2.LogExclusionOrBuilder getExclusionOrBuilder() { + return getExclusion(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 3; + private com.google.protobuf.FieldMask updateMask_; + /** + *
+   * Required. A nonempty list of fields to change in the existing exclusion.
+   * New values for the fields are taken from the corresponding fields in the
+   * [LogExclusion][google.logging.v2.LogExclusion] included in this request. Fields not mentioned in
+   * `update_mask` are not changed and are ignored in the request.
+   * For example, to change the filter and description of an exclusion,
+   * specify an `update_mask` of `"filter,description"`.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + *
+   * Required. A nonempty list of fields to change in the existing exclusion.
+   * New values for the fields are taken from the corresponding fields in the
+   * [LogExclusion][google.logging.v2.LogExclusion] included in this request. Fields not mentioned in
+   * `update_mask` are not changed and are ignored in the request.
+   * For example, to change the filter and description of an exclusion,
+   * specify an `update_mask` of `"filter,description"`.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + *
+   * Required. A nonempty list of fields to change in the existing exclusion.
+   * New values for the fields are taken from the corresponding fields in the
+   * [LogExclusion][google.logging.v2.LogExclusion] included in this request. Fields not mentioned in
+   * `update_mask` are not changed and are ignored in the request.
+   * For example, to change the filter and description of an exclusion,
+   * specify an `update_mask` of `"filter,description"`.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (exclusion_ != null) { + output.writeMessage(2, getExclusion()); + } + if (updateMask_ != null) { + output.writeMessage(3, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (exclusion_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getExclusion()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getUpdateMask()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.logging.v2.UpdateExclusionRequest)) { + return super.equals(obj); + } + com.google.logging.v2.UpdateExclusionRequest other = (com.google.logging.v2.UpdateExclusionRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && (hasExclusion() == other.hasExclusion()); + if (hasExclusion()) { + result = result && getExclusion() + .equals(other.getExclusion()); + } + result = result && (hasUpdateMask() == other.hasUpdateMask()); + if (hasUpdateMask()) { + result = result && getUpdateMask() + .equals(other.getUpdateMask()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasExclusion()) { + hash = (37 * hash) + EXCLUSION_FIELD_NUMBER; + hash = (53 * hash) + getExclusion().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.UpdateExclusionRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.UpdateExclusionRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.UpdateExclusionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.UpdateExclusionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.UpdateExclusionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.UpdateExclusionRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.UpdateExclusionRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.UpdateExclusionRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.UpdateExclusionRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.logging.v2.UpdateExclusionRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.UpdateExclusionRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.UpdateExclusionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.logging.v2.UpdateExclusionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * The parameters to `UpdateExclusion`.
+   * 
+ * + * Protobuf type {@code google.logging.v2.UpdateExclusionRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.UpdateExclusionRequest) + com.google.logging.v2.UpdateExclusionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_UpdateExclusionRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_UpdateExclusionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.UpdateExclusionRequest.class, com.google.logging.v2.UpdateExclusionRequest.Builder.class); + } + + // Construct using com.google.logging.v2.UpdateExclusionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + name_ = ""; + + if (exclusionBuilder_ == null) { + exclusion_ = null; + } else { + exclusion_ = null; + exclusionBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_UpdateExclusionRequest_descriptor; + } + + public com.google.logging.v2.UpdateExclusionRequest getDefaultInstanceForType() { + return com.google.logging.v2.UpdateExclusionRequest.getDefaultInstance(); + } + + public com.google.logging.v2.UpdateExclusionRequest build() { + com.google.logging.v2.UpdateExclusionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.logging.v2.UpdateExclusionRequest buildPartial() { + com.google.logging.v2.UpdateExclusionRequest result = new com.google.logging.v2.UpdateExclusionRequest(this); + result.name_ = name_; + if (exclusionBuilder_ == null) { + result.exclusion_ = exclusion_; + } else { + result.exclusion_ = exclusionBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.logging.v2.UpdateExclusionRequest) { + return mergeFrom((com.google.logging.v2.UpdateExclusionRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.UpdateExclusionRequest other) { + if (other == com.google.logging.v2.UpdateExclusionRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasExclusion()) { + mergeExclusion(other.getExclusion()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.logging.v2.UpdateExclusionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.logging.v2.UpdateExclusionRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * Required. The resource name of the exclusion to update:
+     *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+     * Example: `"projects/my-project-id/exclusions/my-exclusion-id"`.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The resource name of the exclusion to update:
+     *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+     * Example: `"projects/my-project-id/exclusions/my-exclusion-id"`.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The resource name of the exclusion to update:
+     *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+     * Example: `"projects/my-project-id/exclusions/my-exclusion-id"`.
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The resource name of the exclusion to update:
+     *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+     * Example: `"projects/my-project-id/exclusions/my-exclusion-id"`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Required. The resource name of the exclusion to update:
+     *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+     * Example: `"projects/my-project-id/exclusions/my-exclusion-id"`.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.logging.v2.LogExclusion exclusion_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogExclusion, com.google.logging.v2.LogExclusion.Builder, com.google.logging.v2.LogExclusionOrBuilder> exclusionBuilder_; + /** + *
+     * Required. New values for the existing exclusion. Only the fields specified
+     * in `update_mask` are relevant.
+     * 
+ * + * .google.logging.v2.LogExclusion exclusion = 2; + */ + public boolean hasExclusion() { + return exclusionBuilder_ != null || exclusion_ != null; + } + /** + *
+     * Required. New values for the existing exclusion. Only the fields specified
+     * in `update_mask` are relevant.
+     * 
+ * + * .google.logging.v2.LogExclusion exclusion = 2; + */ + public com.google.logging.v2.LogExclusion getExclusion() { + if (exclusionBuilder_ == null) { + return exclusion_ == null ? com.google.logging.v2.LogExclusion.getDefaultInstance() : exclusion_; + } else { + return exclusionBuilder_.getMessage(); + } + } + /** + *
+     * Required. New values for the existing exclusion. Only the fields specified
+     * in `update_mask` are relevant.
+     * 
+ * + * .google.logging.v2.LogExclusion exclusion = 2; + */ + public Builder setExclusion(com.google.logging.v2.LogExclusion value) { + if (exclusionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + exclusion_ = value; + onChanged(); + } else { + exclusionBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Required. New values for the existing exclusion. Only the fields specified
+     * in `update_mask` are relevant.
+     * 
+ * + * .google.logging.v2.LogExclusion exclusion = 2; + */ + public Builder setExclusion( + com.google.logging.v2.LogExclusion.Builder builderForValue) { + if (exclusionBuilder_ == null) { + exclusion_ = builderForValue.build(); + onChanged(); + } else { + exclusionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Required. New values for the existing exclusion. Only the fields specified
+     * in `update_mask` are relevant.
+     * 
+ * + * .google.logging.v2.LogExclusion exclusion = 2; + */ + public Builder mergeExclusion(com.google.logging.v2.LogExclusion value) { + if (exclusionBuilder_ == null) { + if (exclusion_ != null) { + exclusion_ = + com.google.logging.v2.LogExclusion.newBuilder(exclusion_).mergeFrom(value).buildPartial(); + } else { + exclusion_ = value; + } + onChanged(); + } else { + exclusionBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Required. New values for the existing exclusion. Only the fields specified
+     * in `update_mask` are relevant.
+     * 
+ * + * .google.logging.v2.LogExclusion exclusion = 2; + */ + public Builder clearExclusion() { + if (exclusionBuilder_ == null) { + exclusion_ = null; + onChanged(); + } else { + exclusion_ = null; + exclusionBuilder_ = null; + } + + return this; + } + /** + *
+     * Required. New values for the existing exclusion. Only the fields specified
+     * in `update_mask` are relevant.
+     * 
+ * + * .google.logging.v2.LogExclusion exclusion = 2; + */ + public com.google.logging.v2.LogExclusion.Builder getExclusionBuilder() { + + onChanged(); + return getExclusionFieldBuilder().getBuilder(); + } + /** + *
+     * Required. New values for the existing exclusion. Only the fields specified
+     * in `update_mask` are relevant.
+     * 
+ * + * .google.logging.v2.LogExclusion exclusion = 2; + */ + public com.google.logging.v2.LogExclusionOrBuilder getExclusionOrBuilder() { + if (exclusionBuilder_ != null) { + return exclusionBuilder_.getMessageOrBuilder(); + } else { + return exclusion_ == null ? + com.google.logging.v2.LogExclusion.getDefaultInstance() : exclusion_; + } + } + /** + *
+     * Required. New values for the existing exclusion. Only the fields specified
+     * in `update_mask` are relevant.
+     * 
+ * + * .google.logging.v2.LogExclusion exclusion = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogExclusion, com.google.logging.v2.LogExclusion.Builder, com.google.logging.v2.LogExclusionOrBuilder> + getExclusionFieldBuilder() { + if (exclusionBuilder_ == null) { + exclusionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogExclusion, com.google.logging.v2.LogExclusion.Builder, com.google.logging.v2.LogExclusionOrBuilder>( + getExclusion(), + getParentForChildren(), + isClean()); + exclusion_ = null; + } + return exclusionBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> updateMaskBuilder_; + /** + *
+     * Required. A nonempty list of fields to change in the existing exclusion.
+     * New values for the fields are taken from the corresponding fields in the
+     * [LogExclusion][google.logging.v2.LogExclusion] included in this request. Fields not mentioned in
+     * `update_mask` are not changed and are ignored in the request.
+     * For example, to change the filter and description of an exclusion,
+     * specify an `update_mask` of `"filter,description"`.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + *
+     * Required. A nonempty list of fields to change in the existing exclusion.
+     * New values for the fields are taken from the corresponding fields in the
+     * [LogExclusion][google.logging.v2.LogExclusion] included in this request. Fields not mentioned in
+     * `update_mask` are not changed and are ignored in the request.
+     * For example, to change the filter and description of an exclusion,
+     * specify an `update_mask` of `"filter,description"`.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + *
+     * Required. A nonempty list of fields to change in the existing exclusion.
+     * New values for the fields are taken from the corresponding fields in the
+     * [LogExclusion][google.logging.v2.LogExclusion] included in this request. Fields not mentioned in
+     * `update_mask` are not changed and are ignored in the request.
+     * For example, to change the filter and description of an exclusion,
+     * specify an `update_mask` of `"filter,description"`.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Required. A nonempty list of fields to change in the existing exclusion.
+     * New values for the fields are taken from the corresponding fields in the
+     * [LogExclusion][google.logging.v2.LogExclusion] included in this request. Fields not mentioned in
+     * `update_mask` are not changed and are ignored in the request.
+     * For example, to change the filter and description of an exclusion,
+     * specify an `update_mask` of `"filter,description"`.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public Builder setUpdateMask( + com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Required. A nonempty list of fields to change in the existing exclusion.
+     * New values for the fields are taken from the corresponding fields in the
+     * [LogExclusion][google.logging.v2.LogExclusion] included in this request. Fields not mentioned in
+     * `update_mask` are not changed and are ignored in the request.
+     * For example, to change the filter and description of an exclusion,
+     * specify an `update_mask` of `"filter,description"`.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Required. A nonempty list of fields to change in the existing exclusion.
+     * New values for the fields are taken from the corresponding fields in the
+     * [LogExclusion][google.logging.v2.LogExclusion] included in this request. Fields not mentioned in
+     * `update_mask` are not changed and are ignored in the request.
+     * For example, to change the filter and description of an exclusion,
+     * specify an `update_mask` of `"filter,description"`.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + *
+     * Required. A nonempty list of fields to change in the existing exclusion.
+     * New values for the fields are taken from the corresponding fields in the
+     * [LogExclusion][google.logging.v2.LogExclusion] included in this request. Fields not mentioned in
+     * `update_mask` are not changed and are ignored in the request.
+     * For example, to change the filter and description of an exclusion,
+     * specify an `update_mask` of `"filter,description"`.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + *
+     * Required. A nonempty list of fields to change in the existing exclusion.
+     * New values for the fields are taken from the corresponding fields in the
+     * [LogExclusion][google.logging.v2.LogExclusion] included in this request. Fields not mentioned in
+     * `update_mask` are not changed and are ignored in the request.
+     * For example, to change the filter and description of an exclusion,
+     * specify an `update_mask` of `"filter,description"`.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null ? + com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + } + /** + *
+     * Required. A nonempty list of fields to change in the existing exclusion.
+     * New values for the fields are taken from the corresponding fields in the
+     * [LogExclusion][google.logging.v2.LogExclusion] included in this request. Fields not mentioned in
+     * `update_mask` are not changed and are ignored in the request.
+     * For example, to change the filter and description of an exclusion,
+     * specify an `update_mask` of `"filter,description"`.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), + getParentForChildren(), + isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.logging.v2.UpdateExclusionRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.UpdateExclusionRequest) + private static final com.google.logging.v2.UpdateExclusionRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.logging.v2.UpdateExclusionRequest(); + } + + public static com.google.logging.v2.UpdateExclusionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public UpdateExclusionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateExclusionRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.logging.v2.UpdateExclusionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateExclusionRequestOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateExclusionRequestOrBuilder.java new file mode 100644 index 000000000000..77a3d76f1b3f --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateExclusionRequestOrBuilder.java @@ -0,0 +1,105 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_config.proto + +package com.google.logging.v2; + +public interface UpdateExclusionRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.UpdateExclusionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The resource name of the exclusion to update:
+   *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+   * Example: `"projects/my-project-id/exclusions/my-exclusion-id"`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * Required. The resource name of the exclusion to update:
+   *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+   * Example: `"projects/my-project-id/exclusions/my-exclusion-id"`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * Required. New values for the existing exclusion. Only the fields specified
+   * in `update_mask` are relevant.
+   * 
+ * + * .google.logging.v2.LogExclusion exclusion = 2; + */ + boolean hasExclusion(); + /** + *
+   * Required. New values for the existing exclusion. Only the fields specified
+   * in `update_mask` are relevant.
+   * 
+ * + * .google.logging.v2.LogExclusion exclusion = 2; + */ + com.google.logging.v2.LogExclusion getExclusion(); + /** + *
+   * Required. New values for the existing exclusion. Only the fields specified
+   * in `update_mask` are relevant.
+   * 
+ * + * .google.logging.v2.LogExclusion exclusion = 2; + */ + com.google.logging.v2.LogExclusionOrBuilder getExclusionOrBuilder(); + + /** + *
+   * Required. A nonempty list of fields to change in the existing exclusion.
+   * New values for the fields are taken from the corresponding fields in the
+   * [LogExclusion][google.logging.v2.LogExclusion] included in this request. Fields not mentioned in
+   * `update_mask` are not changed and are ignored in the request.
+   * For example, to change the filter and description of an exclusion,
+   * specify an `update_mask` of `"filter,description"`.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + boolean hasUpdateMask(); + /** + *
+   * Required. A nonempty list of fields to change in the existing exclusion.
+   * New values for the fields are taken from the corresponding fields in the
+   * [LogExclusion][google.logging.v2.LogExclusion] included in this request. Fields not mentioned in
+   * `update_mask` are not changed and are ignored in the request.
+   * For example, to change the filter and description of an exclusion,
+   * specify an `update_mask` of `"filter,description"`.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + *
+   * Required. A nonempty list of fields to change in the existing exclusion.
+   * New values for the fields are taken from the corresponding fields in the
+   * [LogExclusion][google.logging.v2.LogExclusion] included in this request. Fields not mentioned in
+   * `update_mask` are not changed and are ignored in the request.
+   * For example, to change the filter and description of an exclusion,
+   * specify an `update_mask` of `"filter,description"`.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateLogMetricRequest.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateLogMetricRequest.java new file mode 100644 index 000000000000..902161933579 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateLogMetricRequest.java @@ -0,0 +1,809 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_metrics.proto + +package com.google.logging.v2; + +/** + *
+ * The parameters to UpdateLogMetric.
+ * 
+ * + * Protobuf type {@code google.logging.v2.UpdateLogMetricRequest} + */ +public final class UpdateLogMetricRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.logging.v2.UpdateLogMetricRequest) + UpdateLogMetricRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use UpdateLogMetricRequest.newBuilder() to construct. + private UpdateLogMetricRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private UpdateLogMetricRequest() { + metricName_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private UpdateLogMetricRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + metricName_ = s; + break; + } + case 18: { + com.google.logging.v2.LogMetric.Builder subBuilder = null; + if (metric_ != null) { + subBuilder = metric_.toBuilder(); + } + metric_ = input.readMessage(com.google.logging.v2.LogMetric.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(metric_); + metric_ = subBuilder.buildPartial(); + } + + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingMetricsProto.internal_static_google_logging_v2_UpdateLogMetricRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingMetricsProto.internal_static_google_logging_v2_UpdateLogMetricRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.UpdateLogMetricRequest.class, com.google.logging.v2.UpdateLogMetricRequest.Builder.class); + } + + public static final int METRIC_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object metricName_; + /** + *
+   * The resource name of the metric to update:
+   *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+   * The updated metric must be provided in the request and it's
+   * `name` field must be the same as `[METRIC_ID]` If the metric
+   * does not exist in `[PROJECT_ID]`, then a new metric is created.
+   * 
+ * + * string metric_name = 1; + */ + public java.lang.String getMetricName() { + java.lang.Object ref = metricName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + metricName_ = s; + return s; + } + } + /** + *
+   * The resource name of the metric to update:
+   *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+   * The updated metric must be provided in the request and it's
+   * `name` field must be the same as `[METRIC_ID]` If the metric
+   * does not exist in `[PROJECT_ID]`, then a new metric is created.
+   * 
+ * + * string metric_name = 1; + */ + public com.google.protobuf.ByteString + getMetricNameBytes() { + java.lang.Object ref = metricName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + metricName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int METRIC_FIELD_NUMBER = 2; + private com.google.logging.v2.LogMetric metric_; + /** + *
+   * The updated metric.
+   * 
+ * + * .google.logging.v2.LogMetric metric = 2; + */ + public boolean hasMetric() { + return metric_ != null; + } + /** + *
+   * The updated metric.
+   * 
+ * + * .google.logging.v2.LogMetric metric = 2; + */ + public com.google.logging.v2.LogMetric getMetric() { + return metric_ == null ? com.google.logging.v2.LogMetric.getDefaultInstance() : metric_; + } + /** + *
+   * The updated metric.
+   * 
+ * + * .google.logging.v2.LogMetric metric = 2; + */ + public com.google.logging.v2.LogMetricOrBuilder getMetricOrBuilder() { + return getMetric(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getMetricNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, metricName_); + } + if (metric_ != null) { + output.writeMessage(2, getMetric()); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getMetricNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, metricName_); + } + if (metric_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getMetric()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.logging.v2.UpdateLogMetricRequest)) { + return super.equals(obj); + } + com.google.logging.v2.UpdateLogMetricRequest other = (com.google.logging.v2.UpdateLogMetricRequest) obj; + + boolean result = true; + result = result && getMetricName() + .equals(other.getMetricName()); + result = result && (hasMetric() == other.hasMetric()); + if (hasMetric()) { + result = result && getMetric() + .equals(other.getMetric()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + METRIC_NAME_FIELD_NUMBER; + hash = (53 * hash) + getMetricName().hashCode(); + if (hasMetric()) { + hash = (37 * hash) + METRIC_FIELD_NUMBER; + hash = (53 * hash) + getMetric().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.UpdateLogMetricRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.UpdateLogMetricRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.UpdateLogMetricRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.UpdateLogMetricRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.UpdateLogMetricRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.UpdateLogMetricRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.UpdateLogMetricRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.UpdateLogMetricRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.UpdateLogMetricRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.logging.v2.UpdateLogMetricRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.UpdateLogMetricRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.UpdateLogMetricRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.logging.v2.UpdateLogMetricRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * The parameters to UpdateLogMetric.
+   * 
+ * + * Protobuf type {@code google.logging.v2.UpdateLogMetricRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.UpdateLogMetricRequest) + com.google.logging.v2.UpdateLogMetricRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingMetricsProto.internal_static_google_logging_v2_UpdateLogMetricRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingMetricsProto.internal_static_google_logging_v2_UpdateLogMetricRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.UpdateLogMetricRequest.class, com.google.logging.v2.UpdateLogMetricRequest.Builder.class); + } + + // Construct using com.google.logging.v2.UpdateLogMetricRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + metricName_ = ""; + + if (metricBuilder_ == null) { + metric_ = null; + } else { + metric_ = null; + metricBuilder_ = null; + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.logging.v2.LoggingMetricsProto.internal_static_google_logging_v2_UpdateLogMetricRequest_descriptor; + } + + public com.google.logging.v2.UpdateLogMetricRequest getDefaultInstanceForType() { + return com.google.logging.v2.UpdateLogMetricRequest.getDefaultInstance(); + } + + public com.google.logging.v2.UpdateLogMetricRequest build() { + com.google.logging.v2.UpdateLogMetricRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.logging.v2.UpdateLogMetricRequest buildPartial() { + com.google.logging.v2.UpdateLogMetricRequest result = new com.google.logging.v2.UpdateLogMetricRequest(this); + result.metricName_ = metricName_; + if (metricBuilder_ == null) { + result.metric_ = metric_; + } else { + result.metric_ = metricBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.logging.v2.UpdateLogMetricRequest) { + return mergeFrom((com.google.logging.v2.UpdateLogMetricRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.UpdateLogMetricRequest other) { + if (other == com.google.logging.v2.UpdateLogMetricRequest.getDefaultInstance()) return this; + if (!other.getMetricName().isEmpty()) { + metricName_ = other.metricName_; + onChanged(); + } + if (other.hasMetric()) { + mergeMetric(other.getMetric()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.logging.v2.UpdateLogMetricRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.logging.v2.UpdateLogMetricRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object metricName_ = ""; + /** + *
+     * The resource name of the metric to update:
+     *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+     * The updated metric must be provided in the request and it's
+     * `name` field must be the same as `[METRIC_ID]` If the metric
+     * does not exist in `[PROJECT_ID]`, then a new metric is created.
+     * 
+ * + * string metric_name = 1; + */ + public java.lang.String getMetricName() { + java.lang.Object ref = metricName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + metricName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The resource name of the metric to update:
+     *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+     * The updated metric must be provided in the request and it's
+     * `name` field must be the same as `[METRIC_ID]` If the metric
+     * does not exist in `[PROJECT_ID]`, then a new metric is created.
+     * 
+ * + * string metric_name = 1; + */ + public com.google.protobuf.ByteString + getMetricNameBytes() { + java.lang.Object ref = metricName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + metricName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The resource name of the metric to update:
+     *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+     * The updated metric must be provided in the request and it's
+     * `name` field must be the same as `[METRIC_ID]` If the metric
+     * does not exist in `[PROJECT_ID]`, then a new metric is created.
+     * 
+ * + * string metric_name = 1; + */ + public Builder setMetricName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + metricName_ = value; + onChanged(); + return this; + } + /** + *
+     * The resource name of the metric to update:
+     *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+     * The updated metric must be provided in the request and it's
+     * `name` field must be the same as `[METRIC_ID]` If the metric
+     * does not exist in `[PROJECT_ID]`, then a new metric is created.
+     * 
+ * + * string metric_name = 1; + */ + public Builder clearMetricName() { + + metricName_ = getDefaultInstance().getMetricName(); + onChanged(); + return this; + } + /** + *
+     * The resource name of the metric to update:
+     *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+     * The updated metric must be provided in the request and it's
+     * `name` field must be the same as `[METRIC_ID]` If the metric
+     * does not exist in `[PROJECT_ID]`, then a new metric is created.
+     * 
+ * + * string metric_name = 1; + */ + public Builder setMetricNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + metricName_ = value; + onChanged(); + return this; + } + + private com.google.logging.v2.LogMetric metric_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogMetric, com.google.logging.v2.LogMetric.Builder, com.google.logging.v2.LogMetricOrBuilder> metricBuilder_; + /** + *
+     * The updated metric.
+     * 
+ * + * .google.logging.v2.LogMetric metric = 2; + */ + public boolean hasMetric() { + return metricBuilder_ != null || metric_ != null; + } + /** + *
+     * The updated metric.
+     * 
+ * + * .google.logging.v2.LogMetric metric = 2; + */ + public com.google.logging.v2.LogMetric getMetric() { + if (metricBuilder_ == null) { + return metric_ == null ? com.google.logging.v2.LogMetric.getDefaultInstance() : metric_; + } else { + return metricBuilder_.getMessage(); + } + } + /** + *
+     * The updated metric.
+     * 
+ * + * .google.logging.v2.LogMetric metric = 2; + */ + public Builder setMetric(com.google.logging.v2.LogMetric value) { + if (metricBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metric_ = value; + onChanged(); + } else { + metricBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The updated metric.
+     * 
+ * + * .google.logging.v2.LogMetric metric = 2; + */ + public Builder setMetric( + com.google.logging.v2.LogMetric.Builder builderForValue) { + if (metricBuilder_ == null) { + metric_ = builderForValue.build(); + onChanged(); + } else { + metricBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The updated metric.
+     * 
+ * + * .google.logging.v2.LogMetric metric = 2; + */ + public Builder mergeMetric(com.google.logging.v2.LogMetric value) { + if (metricBuilder_ == null) { + if (metric_ != null) { + metric_ = + com.google.logging.v2.LogMetric.newBuilder(metric_).mergeFrom(value).buildPartial(); + } else { + metric_ = value; + } + onChanged(); + } else { + metricBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The updated metric.
+     * 
+ * + * .google.logging.v2.LogMetric metric = 2; + */ + public Builder clearMetric() { + if (metricBuilder_ == null) { + metric_ = null; + onChanged(); + } else { + metric_ = null; + metricBuilder_ = null; + } + + return this; + } + /** + *
+     * The updated metric.
+     * 
+ * + * .google.logging.v2.LogMetric metric = 2; + */ + public com.google.logging.v2.LogMetric.Builder getMetricBuilder() { + + onChanged(); + return getMetricFieldBuilder().getBuilder(); + } + /** + *
+     * The updated metric.
+     * 
+ * + * .google.logging.v2.LogMetric metric = 2; + */ + public com.google.logging.v2.LogMetricOrBuilder getMetricOrBuilder() { + if (metricBuilder_ != null) { + return metricBuilder_.getMessageOrBuilder(); + } else { + return metric_ == null ? + com.google.logging.v2.LogMetric.getDefaultInstance() : metric_; + } + } + /** + *
+     * The updated metric.
+     * 
+ * + * .google.logging.v2.LogMetric metric = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogMetric, com.google.logging.v2.LogMetric.Builder, com.google.logging.v2.LogMetricOrBuilder> + getMetricFieldBuilder() { + if (metricBuilder_ == null) { + metricBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogMetric, com.google.logging.v2.LogMetric.Builder, com.google.logging.v2.LogMetricOrBuilder>( + getMetric(), + getParentForChildren(), + isClean()); + metric_ = null; + } + return metricBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.logging.v2.UpdateLogMetricRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.UpdateLogMetricRequest) + private static final com.google.logging.v2.UpdateLogMetricRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.logging.v2.UpdateLogMetricRequest(); + } + + public static com.google.logging.v2.UpdateLogMetricRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public UpdateLogMetricRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateLogMetricRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.logging.v2.UpdateLogMetricRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateLogMetricRequestOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateLogMetricRequestOrBuilder.java new file mode 100644 index 000000000000..900ea4acbd6f --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateLogMetricRequestOrBuilder.java @@ -0,0 +1,60 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_metrics.proto + +package com.google.logging.v2; + +public interface UpdateLogMetricRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.UpdateLogMetricRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The resource name of the metric to update:
+   *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+   * The updated metric must be provided in the request and it's
+   * `name` field must be the same as `[METRIC_ID]` If the metric
+   * does not exist in `[PROJECT_ID]`, then a new metric is created.
+   * 
+ * + * string metric_name = 1; + */ + java.lang.String getMetricName(); + /** + *
+   * The resource name of the metric to update:
+   *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+   * The updated metric must be provided in the request and it's
+   * `name` field must be the same as `[METRIC_ID]` If the metric
+   * does not exist in `[PROJECT_ID]`, then a new metric is created.
+   * 
+ * + * string metric_name = 1; + */ + com.google.protobuf.ByteString + getMetricNameBytes(); + + /** + *
+   * The updated metric.
+   * 
+ * + * .google.logging.v2.LogMetric metric = 2; + */ + boolean hasMetric(); + /** + *
+   * The updated metric.
+   * 
+ * + * .google.logging.v2.LogMetric metric = 2; + */ + com.google.logging.v2.LogMetric getMetric(); + /** + *
+   * The updated metric.
+   * 
+ * + * .google.logging.v2.LogMetric metric = 2; + */ + com.google.logging.v2.LogMetricOrBuilder getMetricOrBuilder(); +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateSinkRequest.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateSinkRequest.java new file mode 100644 index 000000000000..ff0d6aec13b3 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateSinkRequest.java @@ -0,0 +1,1299 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_config.proto + +package com.google.logging.v2; + +/** + *
+ * The parameters to `UpdateSink`.
+ * 
+ * + * Protobuf type {@code google.logging.v2.UpdateSinkRequest} + */ +public final class UpdateSinkRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.logging.v2.UpdateSinkRequest) + UpdateSinkRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use UpdateSinkRequest.newBuilder() to construct. + private UpdateSinkRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private UpdateSinkRequest() { + sinkName_ = ""; + uniqueWriterIdentity_ = false; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private UpdateSinkRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + sinkName_ = s; + break; + } + case 18: { + com.google.logging.v2.LogSink.Builder subBuilder = null; + if (sink_ != null) { + subBuilder = sink_.toBuilder(); + } + sink_ = input.readMessage(com.google.logging.v2.LogSink.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(sink_); + sink_ = subBuilder.buildPartial(); + } + + break; + } + case 24: { + + uniqueWriterIdentity_ = input.readBool(); + break; + } + case 34: { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_UpdateSinkRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_UpdateSinkRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.UpdateSinkRequest.class, com.google.logging.v2.UpdateSinkRequest.Builder.class); + } + + public static final int SINK_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object sinkName_; + /** + *
+   * Required. The full resource name of the sink to update, including the
+   * parent resource and the sink identifier:
+   *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+   *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+   *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+   * Example: `"projects/my-project-id/sinks/my-sink-id"`.
+   * 
+ * + * string sink_name = 1; + */ + public java.lang.String getSinkName() { + java.lang.Object ref = sinkName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sinkName_ = s; + return s; + } + } + /** + *
+   * Required. The full resource name of the sink to update, including the
+   * parent resource and the sink identifier:
+   *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+   *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+   *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+   * Example: `"projects/my-project-id/sinks/my-sink-id"`.
+   * 
+ * + * string sink_name = 1; + */ + public com.google.protobuf.ByteString + getSinkNameBytes() { + java.lang.Object ref = sinkName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + sinkName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SINK_FIELD_NUMBER = 2; + private com.google.logging.v2.LogSink sink_; + /** + *
+   * Required. The updated sink, whose name is the same identifier that appears
+   * as part of `sink_name`.
+   * 
+ * + * .google.logging.v2.LogSink sink = 2; + */ + public boolean hasSink() { + return sink_ != null; + } + /** + *
+   * Required. The updated sink, whose name is the same identifier that appears
+   * as part of `sink_name`.
+   * 
+ * + * .google.logging.v2.LogSink sink = 2; + */ + public com.google.logging.v2.LogSink getSink() { + return sink_ == null ? com.google.logging.v2.LogSink.getDefaultInstance() : sink_; + } + /** + *
+   * Required. The updated sink, whose name is the same identifier that appears
+   * as part of `sink_name`.
+   * 
+ * + * .google.logging.v2.LogSink sink = 2; + */ + public com.google.logging.v2.LogSinkOrBuilder getSinkOrBuilder() { + return getSink(); + } + + public static final int UNIQUE_WRITER_IDENTITY_FIELD_NUMBER = 3; + private boolean uniqueWriterIdentity_; + /** + *
+   * Optional. See
+   * [sinks.create](/logging/docs/api/reference/rest/v2/projects.sinks/create)
+   * for a description of this field.  When updating a sink, the effect of this
+   * field on the value of `writer_identity` in the updated sink depends on both
+   * the old and new values of this field:
+   * +   If the old and new values of this field are both false or both true,
+   *     then there is no change to the sink's `writer_identity`.
+   * +   If the old value is false and the new value is true, then
+   *     `writer_identity` is changed to a unique service account.
+   * +   It is an error if the old value is true and the new value is
+   *     set to false or defaulted to false.
+   * 
+ * + * bool unique_writer_identity = 3; + */ + public boolean getUniqueWriterIdentity() { + return uniqueWriterIdentity_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 4; + private com.google.protobuf.FieldMask updateMask_; + /** + *
+   * Optional. Field mask that specifies the fields in `sink` that need
+   * an update. A sink field will be overwritten if, and only if, it is
+   * in the update mask.  `name` and output only fields cannot be updated.
+   * An empty updateMask is temporarily treated as using the following mask
+   * for backwards compatibility purposes:
+   *   destination,filter,includeChildren
+   * At some point in the future, behavior will be removed and specifying an
+   * empty updateMask will be an error.
+   * For a detailed `FieldMask` definition, see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+   * Example: `updateMask=filter`.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + *
+   * Optional. Field mask that specifies the fields in `sink` that need
+   * an update. A sink field will be overwritten if, and only if, it is
+   * in the update mask.  `name` and output only fields cannot be updated.
+   * An empty updateMask is temporarily treated as using the following mask
+   * for backwards compatibility purposes:
+   *   destination,filter,includeChildren
+   * At some point in the future, behavior will be removed and specifying an
+   * empty updateMask will be an error.
+   * For a detailed `FieldMask` definition, see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+   * Example: `updateMask=filter`.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + *
+   * Optional. Field mask that specifies the fields in `sink` that need
+   * an update. A sink field will be overwritten if, and only if, it is
+   * in the update mask.  `name` and output only fields cannot be updated.
+   * An empty updateMask is temporarily treated as using the following mask
+   * for backwards compatibility purposes:
+   *   destination,filter,includeChildren
+   * At some point in the future, behavior will be removed and specifying an
+   * empty updateMask will be an error.
+   * For a detailed `FieldMask` definition, see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+   * Example: `updateMask=filter`.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getSinkNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, sinkName_); + } + if (sink_ != null) { + output.writeMessage(2, getSink()); + } + if (uniqueWriterIdentity_ != false) { + output.writeBool(3, uniqueWriterIdentity_); + } + if (updateMask_ != null) { + output.writeMessage(4, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getSinkNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, sinkName_); + } + if (sink_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getSink()); + } + if (uniqueWriterIdentity_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, uniqueWriterIdentity_); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getUpdateMask()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.logging.v2.UpdateSinkRequest)) { + return super.equals(obj); + } + com.google.logging.v2.UpdateSinkRequest other = (com.google.logging.v2.UpdateSinkRequest) obj; + + boolean result = true; + result = result && getSinkName() + .equals(other.getSinkName()); + result = result && (hasSink() == other.hasSink()); + if (hasSink()) { + result = result && getSink() + .equals(other.getSink()); + } + result = result && (getUniqueWriterIdentity() + == other.getUniqueWriterIdentity()); + result = result && (hasUpdateMask() == other.hasUpdateMask()); + if (hasUpdateMask()) { + result = result && getUpdateMask() + .equals(other.getUpdateMask()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SINK_NAME_FIELD_NUMBER; + hash = (53 * hash) + getSinkName().hashCode(); + if (hasSink()) { + hash = (37 * hash) + SINK_FIELD_NUMBER; + hash = (53 * hash) + getSink().hashCode(); + } + hash = (37 * hash) + UNIQUE_WRITER_IDENTITY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getUniqueWriterIdentity()); + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.UpdateSinkRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.UpdateSinkRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.UpdateSinkRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.UpdateSinkRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.UpdateSinkRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.UpdateSinkRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.UpdateSinkRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.UpdateSinkRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.UpdateSinkRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.logging.v2.UpdateSinkRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.UpdateSinkRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.UpdateSinkRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.logging.v2.UpdateSinkRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * The parameters to `UpdateSink`.
+   * 
+ * + * Protobuf type {@code google.logging.v2.UpdateSinkRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.UpdateSinkRequest) + com.google.logging.v2.UpdateSinkRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_UpdateSinkRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_UpdateSinkRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.UpdateSinkRequest.class, com.google.logging.v2.UpdateSinkRequest.Builder.class); + } + + // Construct using com.google.logging.v2.UpdateSinkRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + sinkName_ = ""; + + if (sinkBuilder_ == null) { + sink_ = null; + } else { + sink_ = null; + sinkBuilder_ = null; + } + uniqueWriterIdentity_ = false; + + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto.internal_static_google_logging_v2_UpdateSinkRequest_descriptor; + } + + public com.google.logging.v2.UpdateSinkRequest getDefaultInstanceForType() { + return com.google.logging.v2.UpdateSinkRequest.getDefaultInstance(); + } + + public com.google.logging.v2.UpdateSinkRequest build() { + com.google.logging.v2.UpdateSinkRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.logging.v2.UpdateSinkRequest buildPartial() { + com.google.logging.v2.UpdateSinkRequest result = new com.google.logging.v2.UpdateSinkRequest(this); + result.sinkName_ = sinkName_; + if (sinkBuilder_ == null) { + result.sink_ = sink_; + } else { + result.sink_ = sinkBuilder_.build(); + } + result.uniqueWriterIdentity_ = uniqueWriterIdentity_; + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.logging.v2.UpdateSinkRequest) { + return mergeFrom((com.google.logging.v2.UpdateSinkRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.UpdateSinkRequest other) { + if (other == com.google.logging.v2.UpdateSinkRequest.getDefaultInstance()) return this; + if (!other.getSinkName().isEmpty()) { + sinkName_ = other.sinkName_; + onChanged(); + } + if (other.hasSink()) { + mergeSink(other.getSink()); + } + if (other.getUniqueWriterIdentity() != false) { + setUniqueWriterIdentity(other.getUniqueWriterIdentity()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.logging.v2.UpdateSinkRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.logging.v2.UpdateSinkRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object sinkName_ = ""; + /** + *
+     * Required. The full resource name of the sink to update, including the
+     * parent resource and the sink identifier:
+     *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+     *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+     *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+     * Example: `"projects/my-project-id/sinks/my-sink-id"`.
+     * 
+ * + * string sink_name = 1; + */ + public java.lang.String getSinkName() { + java.lang.Object ref = sinkName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sinkName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The full resource name of the sink to update, including the
+     * parent resource and the sink identifier:
+     *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+     *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+     *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+     * Example: `"projects/my-project-id/sinks/my-sink-id"`.
+     * 
+ * + * string sink_name = 1; + */ + public com.google.protobuf.ByteString + getSinkNameBytes() { + java.lang.Object ref = sinkName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + sinkName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The full resource name of the sink to update, including the
+     * parent resource and the sink identifier:
+     *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+     *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+     *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+     * Example: `"projects/my-project-id/sinks/my-sink-id"`.
+     * 
+ * + * string sink_name = 1; + */ + public Builder setSinkName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + sinkName_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The full resource name of the sink to update, including the
+     * parent resource and the sink identifier:
+     *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+     *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+     *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+     * Example: `"projects/my-project-id/sinks/my-sink-id"`.
+     * 
+ * + * string sink_name = 1; + */ + public Builder clearSinkName() { + + sinkName_ = getDefaultInstance().getSinkName(); + onChanged(); + return this; + } + /** + *
+     * Required. The full resource name of the sink to update, including the
+     * parent resource and the sink identifier:
+     *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+     *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+     *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+     * Example: `"projects/my-project-id/sinks/my-sink-id"`.
+     * 
+ * + * string sink_name = 1; + */ + public Builder setSinkNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + sinkName_ = value; + onChanged(); + return this; + } + + private com.google.logging.v2.LogSink sink_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogSink, com.google.logging.v2.LogSink.Builder, com.google.logging.v2.LogSinkOrBuilder> sinkBuilder_; + /** + *
+     * Required. The updated sink, whose name is the same identifier that appears
+     * as part of `sink_name`.
+     * 
+ * + * .google.logging.v2.LogSink sink = 2; + */ + public boolean hasSink() { + return sinkBuilder_ != null || sink_ != null; + } + /** + *
+     * Required. The updated sink, whose name is the same identifier that appears
+     * as part of `sink_name`.
+     * 
+ * + * .google.logging.v2.LogSink sink = 2; + */ + public com.google.logging.v2.LogSink getSink() { + if (sinkBuilder_ == null) { + return sink_ == null ? com.google.logging.v2.LogSink.getDefaultInstance() : sink_; + } else { + return sinkBuilder_.getMessage(); + } + } + /** + *
+     * Required. The updated sink, whose name is the same identifier that appears
+     * as part of `sink_name`.
+     * 
+ * + * .google.logging.v2.LogSink sink = 2; + */ + public Builder setSink(com.google.logging.v2.LogSink value) { + if (sinkBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sink_ = value; + onChanged(); + } else { + sinkBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Required. The updated sink, whose name is the same identifier that appears
+     * as part of `sink_name`.
+     * 
+ * + * .google.logging.v2.LogSink sink = 2; + */ + public Builder setSink( + com.google.logging.v2.LogSink.Builder builderForValue) { + if (sinkBuilder_ == null) { + sink_ = builderForValue.build(); + onChanged(); + } else { + sinkBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Required. The updated sink, whose name is the same identifier that appears
+     * as part of `sink_name`.
+     * 
+ * + * .google.logging.v2.LogSink sink = 2; + */ + public Builder mergeSink(com.google.logging.v2.LogSink value) { + if (sinkBuilder_ == null) { + if (sink_ != null) { + sink_ = + com.google.logging.v2.LogSink.newBuilder(sink_).mergeFrom(value).buildPartial(); + } else { + sink_ = value; + } + onChanged(); + } else { + sinkBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Required. The updated sink, whose name is the same identifier that appears
+     * as part of `sink_name`.
+     * 
+ * + * .google.logging.v2.LogSink sink = 2; + */ + public Builder clearSink() { + if (sinkBuilder_ == null) { + sink_ = null; + onChanged(); + } else { + sink_ = null; + sinkBuilder_ = null; + } + + return this; + } + /** + *
+     * Required. The updated sink, whose name is the same identifier that appears
+     * as part of `sink_name`.
+     * 
+ * + * .google.logging.v2.LogSink sink = 2; + */ + public com.google.logging.v2.LogSink.Builder getSinkBuilder() { + + onChanged(); + return getSinkFieldBuilder().getBuilder(); + } + /** + *
+     * Required. The updated sink, whose name is the same identifier that appears
+     * as part of `sink_name`.
+     * 
+ * + * .google.logging.v2.LogSink sink = 2; + */ + public com.google.logging.v2.LogSinkOrBuilder getSinkOrBuilder() { + if (sinkBuilder_ != null) { + return sinkBuilder_.getMessageOrBuilder(); + } else { + return sink_ == null ? + com.google.logging.v2.LogSink.getDefaultInstance() : sink_; + } + } + /** + *
+     * Required. The updated sink, whose name is the same identifier that appears
+     * as part of `sink_name`.
+     * 
+ * + * .google.logging.v2.LogSink sink = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogSink, com.google.logging.v2.LogSink.Builder, com.google.logging.v2.LogSinkOrBuilder> + getSinkFieldBuilder() { + if (sinkBuilder_ == null) { + sinkBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogSink, com.google.logging.v2.LogSink.Builder, com.google.logging.v2.LogSinkOrBuilder>( + getSink(), + getParentForChildren(), + isClean()); + sink_ = null; + } + return sinkBuilder_; + } + + private boolean uniqueWriterIdentity_ ; + /** + *
+     * Optional. See
+     * [sinks.create](/logging/docs/api/reference/rest/v2/projects.sinks/create)
+     * for a description of this field.  When updating a sink, the effect of this
+     * field on the value of `writer_identity` in the updated sink depends on both
+     * the old and new values of this field:
+     * +   If the old and new values of this field are both false or both true,
+     *     then there is no change to the sink's `writer_identity`.
+     * +   If the old value is false and the new value is true, then
+     *     `writer_identity` is changed to a unique service account.
+     * +   It is an error if the old value is true and the new value is
+     *     set to false or defaulted to false.
+     * 
+ * + * bool unique_writer_identity = 3; + */ + public boolean getUniqueWriterIdentity() { + return uniqueWriterIdentity_; + } + /** + *
+     * Optional. See
+     * [sinks.create](/logging/docs/api/reference/rest/v2/projects.sinks/create)
+     * for a description of this field.  When updating a sink, the effect of this
+     * field on the value of `writer_identity` in the updated sink depends on both
+     * the old and new values of this field:
+     * +   If the old and new values of this field are both false or both true,
+     *     then there is no change to the sink's `writer_identity`.
+     * +   If the old value is false and the new value is true, then
+     *     `writer_identity` is changed to a unique service account.
+     * +   It is an error if the old value is true and the new value is
+     *     set to false or defaulted to false.
+     * 
+ * + * bool unique_writer_identity = 3; + */ + public Builder setUniqueWriterIdentity(boolean value) { + + uniqueWriterIdentity_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. See
+     * [sinks.create](/logging/docs/api/reference/rest/v2/projects.sinks/create)
+     * for a description of this field.  When updating a sink, the effect of this
+     * field on the value of `writer_identity` in the updated sink depends on both
+     * the old and new values of this field:
+     * +   If the old and new values of this field are both false or both true,
+     *     then there is no change to the sink's `writer_identity`.
+     * +   If the old value is false and the new value is true, then
+     *     `writer_identity` is changed to a unique service account.
+     * +   It is an error if the old value is true and the new value is
+     *     set to false or defaulted to false.
+     * 
+ * + * bool unique_writer_identity = 3; + */ + public Builder clearUniqueWriterIdentity() { + + uniqueWriterIdentity_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.FieldMask updateMask_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> updateMaskBuilder_; + /** + *
+     * Optional. Field mask that specifies the fields in `sink` that need
+     * an update. A sink field will be overwritten if, and only if, it is
+     * in the update mask.  `name` and output only fields cannot be updated.
+     * An empty updateMask is temporarily treated as using the following mask
+     * for backwards compatibility purposes:
+     *   destination,filter,includeChildren
+     * At some point in the future, behavior will be removed and specifying an
+     * empty updateMask will be an error.
+     * For a detailed `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * Example: `updateMask=filter`.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + *
+     * Optional. Field mask that specifies the fields in `sink` that need
+     * an update. A sink field will be overwritten if, and only if, it is
+     * in the update mask.  `name` and output only fields cannot be updated.
+     * An empty updateMask is temporarily treated as using the following mask
+     * for backwards compatibility purposes:
+     *   destination,filter,includeChildren
+     * At some point in the future, behavior will be removed and specifying an
+     * empty updateMask will be an error.
+     * For a detailed `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * Example: `updateMask=filter`.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + *
+     * Optional. Field mask that specifies the fields in `sink` that need
+     * an update. A sink field will be overwritten if, and only if, it is
+     * in the update mask.  `name` and output only fields cannot be updated.
+     * An empty updateMask is temporarily treated as using the following mask
+     * for backwards compatibility purposes:
+     *   destination,filter,includeChildren
+     * At some point in the future, behavior will be removed and specifying an
+     * empty updateMask will be an error.
+     * For a detailed `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * Example: `updateMask=filter`.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Optional. Field mask that specifies the fields in `sink` that need
+     * an update. A sink field will be overwritten if, and only if, it is
+     * in the update mask.  `name` and output only fields cannot be updated.
+     * An empty updateMask is temporarily treated as using the following mask
+     * for backwards compatibility purposes:
+     *   destination,filter,includeChildren
+     * At some point in the future, behavior will be removed and specifying an
+     * empty updateMask will be an error.
+     * For a detailed `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * Example: `updateMask=filter`.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + */ + public Builder setUpdateMask( + com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Optional. Field mask that specifies the fields in `sink` that need
+     * an update. A sink field will be overwritten if, and only if, it is
+     * in the update mask.  `name` and output only fields cannot be updated.
+     * An empty updateMask is temporarily treated as using the following mask
+     * for backwards compatibility purposes:
+     *   destination,filter,includeChildren
+     * At some point in the future, behavior will be removed and specifying an
+     * empty updateMask will be an error.
+     * For a detailed `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * Example: `updateMask=filter`.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Optional. Field mask that specifies the fields in `sink` that need
+     * an update. A sink field will be overwritten if, and only if, it is
+     * in the update mask.  `name` and output only fields cannot be updated.
+     * An empty updateMask is temporarily treated as using the following mask
+     * for backwards compatibility purposes:
+     *   destination,filter,includeChildren
+     * At some point in the future, behavior will be removed and specifying an
+     * empty updateMask will be an error.
+     * For a detailed `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * Example: `updateMask=filter`.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + *
+     * Optional. Field mask that specifies the fields in `sink` that need
+     * an update. A sink field will be overwritten if, and only if, it is
+     * in the update mask.  `name` and output only fields cannot be updated.
+     * An empty updateMask is temporarily treated as using the following mask
+     * for backwards compatibility purposes:
+     *   destination,filter,includeChildren
+     * At some point in the future, behavior will be removed and specifying an
+     * empty updateMask will be an error.
+     * For a detailed `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * Example: `updateMask=filter`.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + *
+     * Optional. Field mask that specifies the fields in `sink` that need
+     * an update. A sink field will be overwritten if, and only if, it is
+     * in the update mask.  `name` and output only fields cannot be updated.
+     * An empty updateMask is temporarily treated as using the following mask
+     * for backwards compatibility purposes:
+     *   destination,filter,includeChildren
+     * At some point in the future, behavior will be removed and specifying an
+     * empty updateMask will be an error.
+     * For a detailed `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * Example: `updateMask=filter`.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null ? + com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + } + /** + *
+     * Optional. Field mask that specifies the fields in `sink` that need
+     * an update. A sink field will be overwritten if, and only if, it is
+     * in the update mask.  `name` and output only fields cannot be updated.
+     * An empty updateMask is temporarily treated as using the following mask
+     * for backwards compatibility purposes:
+     *   destination,filter,includeChildren
+     * At some point in the future, behavior will be removed and specifying an
+     * empty updateMask will be an error.
+     * For a detailed `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * Example: `updateMask=filter`.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), + getParentForChildren(), + isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.logging.v2.UpdateSinkRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.UpdateSinkRequest) + private static final com.google.logging.v2.UpdateSinkRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.logging.v2.UpdateSinkRequest(); + } + + public static com.google.logging.v2.UpdateSinkRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public UpdateSinkRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateSinkRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.logging.v2.UpdateSinkRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateSinkRequestOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateSinkRequestOrBuilder.java new file mode 100644 index 000000000000..2af06fb06739 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateSinkRequestOrBuilder.java @@ -0,0 +1,141 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_config.proto + +package com.google.logging.v2; + +public interface UpdateSinkRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.UpdateSinkRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The full resource name of the sink to update, including the
+   * parent resource and the sink identifier:
+   *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+   *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+   *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+   * Example: `"projects/my-project-id/sinks/my-sink-id"`.
+   * 
+ * + * string sink_name = 1; + */ + java.lang.String getSinkName(); + /** + *
+   * Required. The full resource name of the sink to update, including the
+   * parent resource and the sink identifier:
+   *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+   *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+   *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+   * Example: `"projects/my-project-id/sinks/my-sink-id"`.
+   * 
+ * + * string sink_name = 1; + */ + com.google.protobuf.ByteString + getSinkNameBytes(); + + /** + *
+   * Required. The updated sink, whose name is the same identifier that appears
+   * as part of `sink_name`.
+   * 
+ * + * .google.logging.v2.LogSink sink = 2; + */ + boolean hasSink(); + /** + *
+   * Required. The updated sink, whose name is the same identifier that appears
+   * as part of `sink_name`.
+   * 
+ * + * .google.logging.v2.LogSink sink = 2; + */ + com.google.logging.v2.LogSink getSink(); + /** + *
+   * Required. The updated sink, whose name is the same identifier that appears
+   * as part of `sink_name`.
+   * 
+ * + * .google.logging.v2.LogSink sink = 2; + */ + com.google.logging.v2.LogSinkOrBuilder getSinkOrBuilder(); + + /** + *
+   * Optional. See
+   * [sinks.create](/logging/docs/api/reference/rest/v2/projects.sinks/create)
+   * for a description of this field.  When updating a sink, the effect of this
+   * field on the value of `writer_identity` in the updated sink depends on both
+   * the old and new values of this field:
+   * +   If the old and new values of this field are both false or both true,
+   *     then there is no change to the sink's `writer_identity`.
+   * +   If the old value is false and the new value is true, then
+   *     `writer_identity` is changed to a unique service account.
+   * +   It is an error if the old value is true and the new value is
+   *     set to false or defaulted to false.
+   * 
+ * + * bool unique_writer_identity = 3; + */ + boolean getUniqueWriterIdentity(); + + /** + *
+   * Optional. Field mask that specifies the fields in `sink` that need
+   * an update. A sink field will be overwritten if, and only if, it is
+   * in the update mask.  `name` and output only fields cannot be updated.
+   * An empty updateMask is temporarily treated as using the following mask
+   * for backwards compatibility purposes:
+   *   destination,filter,includeChildren
+   * At some point in the future, behavior will be removed and specifying an
+   * empty updateMask will be an error.
+   * For a detailed `FieldMask` definition, see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+   * Example: `updateMask=filter`.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + */ + boolean hasUpdateMask(); + /** + *
+   * Optional. Field mask that specifies the fields in `sink` that need
+   * an update. A sink field will be overwritten if, and only if, it is
+   * in the update mask.  `name` and output only fields cannot be updated.
+   * An empty updateMask is temporarily treated as using the following mask
+   * for backwards compatibility purposes:
+   *   destination,filter,includeChildren
+   * At some point in the future, behavior will be removed and specifying an
+   * empty updateMask will be an error.
+   * For a detailed `FieldMask` definition, see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+   * Example: `updateMask=filter`.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + *
+   * Optional. Field mask that specifies the fields in `sink` that need
+   * an update. A sink field will be overwritten if, and only if, it is
+   * in the update mask.  `name` and output only fields cannot be updated.
+   * An empty updateMask is temporarily treated as using the following mask
+   * for backwards compatibility purposes:
+   *   destination,filter,includeChildren
+   * At some point in the future, behavior will be removed and specifying an
+   * empty updateMask will be an error.
+   * For a detailed `FieldMask` definition, see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+   * Example: `updateMask=filter`.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesPartialErrors.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesPartialErrors.java new file mode 100644 index 000000000000..69fa2da11347 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesPartialErrors.java @@ -0,0 +1,759 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging.proto + +package com.google.logging.v2; + +/** + *
+ * Error details for WriteLogEntries with partial success.
+ * 
+ * + * Protobuf type {@code google.logging.v2.WriteLogEntriesPartialErrors} + */ +public final class WriteLogEntriesPartialErrors extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.logging.v2.WriteLogEntriesPartialErrors) + WriteLogEntriesPartialErrorsOrBuilder { +private static final long serialVersionUID = 0L; + // Use WriteLogEntriesPartialErrors.newBuilder() to construct. + private WriteLogEntriesPartialErrors(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private WriteLogEntriesPartialErrors() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private WriteLogEntriesPartialErrors( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + logEntryErrors_ = com.google.protobuf.MapField.newMapField( + LogEntryErrorsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry + logEntryErrors__ = input.readMessage( + LogEntryErrorsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + logEntryErrors_.getMutableMap().put( + logEntryErrors__.getKey(), logEntryErrors__.getValue()); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_WriteLogEntriesPartialErrors_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetLogEntryErrors(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_WriteLogEntriesPartialErrors_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.WriteLogEntriesPartialErrors.class, com.google.logging.v2.WriteLogEntriesPartialErrors.Builder.class); + } + + public static final int LOG_ENTRY_ERRORS_FIELD_NUMBER = 1; + private static final class LogEntryErrorsDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.Integer, com.google.rpc.Status> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_WriteLogEntriesPartialErrors_LogEntryErrorsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.INT32, + 0, + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.rpc.Status.getDefaultInstance()); + } + private com.google.protobuf.MapField< + java.lang.Integer, com.google.rpc.Status> logEntryErrors_; + private com.google.protobuf.MapField + internalGetLogEntryErrors() { + if (logEntryErrors_ == null) { + return com.google.protobuf.MapField.emptyMapField( + LogEntryErrorsDefaultEntryHolder.defaultEntry); + } + return logEntryErrors_; + } + + public int getLogEntryErrorsCount() { + return internalGetLogEntryErrors().getMap().size(); + } + /** + *
+   * When `WriteLogEntriesRequest.partial_success` is true, records the error
+   * status for entries that were not written due to a permanent error, keyed
+   * by the entry's zero-based index in `WriteLogEntriesRequest.entries`.
+   * Failed requests for which no entries are written will not include
+   * per-entry errors.
+   * 
+ * + * map<int32, .google.rpc.Status> log_entry_errors = 1; + */ + + public boolean containsLogEntryErrors( + int key) { + + return internalGetLogEntryErrors().getMap().containsKey(key); + } + /** + * Use {@link #getLogEntryErrorsMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getLogEntryErrors() { + return getLogEntryErrorsMap(); + } + /** + *
+   * When `WriteLogEntriesRequest.partial_success` is true, records the error
+   * status for entries that were not written due to a permanent error, keyed
+   * by the entry's zero-based index in `WriteLogEntriesRequest.entries`.
+   * Failed requests for which no entries are written will not include
+   * per-entry errors.
+   * 
+ * + * map<int32, .google.rpc.Status> log_entry_errors = 1; + */ + + public java.util.Map getLogEntryErrorsMap() { + return internalGetLogEntryErrors().getMap(); + } + /** + *
+   * When `WriteLogEntriesRequest.partial_success` is true, records the error
+   * status for entries that were not written due to a permanent error, keyed
+   * by the entry's zero-based index in `WriteLogEntriesRequest.entries`.
+   * Failed requests for which no entries are written will not include
+   * per-entry errors.
+   * 
+ * + * map<int32, .google.rpc.Status> log_entry_errors = 1; + */ + + public com.google.rpc.Status getLogEntryErrorsOrDefault( + int key, + com.google.rpc.Status defaultValue) { + + java.util.Map map = + internalGetLogEntryErrors().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+   * When `WriteLogEntriesRequest.partial_success` is true, records the error
+   * status for entries that were not written due to a permanent error, keyed
+   * by the entry's zero-based index in `WriteLogEntriesRequest.entries`.
+   * Failed requests for which no entries are written will not include
+   * per-entry errors.
+   * 
+ * + * map<int32, .google.rpc.Status> log_entry_errors = 1; + */ + + public com.google.rpc.Status getLogEntryErrorsOrThrow( + int key) { + + java.util.Map map = + internalGetLogEntryErrors().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + com.google.protobuf.GeneratedMessageV3 + .serializeIntegerMapTo( + output, + internalGetLogEntryErrors(), + LogEntryErrorsDefaultEntryHolder.defaultEntry, + 1); + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry + : internalGetLogEntryErrors().getMap().entrySet()) { + com.google.protobuf.MapEntry + logEntryErrors__ = LogEntryErrorsDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, logEntryErrors__); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.logging.v2.WriteLogEntriesPartialErrors)) { + return super.equals(obj); + } + com.google.logging.v2.WriteLogEntriesPartialErrors other = (com.google.logging.v2.WriteLogEntriesPartialErrors) obj; + + boolean result = true; + result = result && internalGetLogEntryErrors().equals( + other.internalGetLogEntryErrors()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetLogEntryErrors().getMap().isEmpty()) { + hash = (37 * hash) + LOG_ENTRY_ERRORS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLogEntryErrors().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.WriteLogEntriesPartialErrors parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.WriteLogEntriesPartialErrors parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.WriteLogEntriesPartialErrors parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.WriteLogEntriesPartialErrors parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.WriteLogEntriesPartialErrors parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.WriteLogEntriesPartialErrors parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.WriteLogEntriesPartialErrors parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.WriteLogEntriesPartialErrors parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.WriteLogEntriesPartialErrors parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.logging.v2.WriteLogEntriesPartialErrors parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.WriteLogEntriesPartialErrors parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.WriteLogEntriesPartialErrors parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.logging.v2.WriteLogEntriesPartialErrors prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Error details for WriteLogEntries with partial success.
+   * 
+ * + * Protobuf type {@code google.logging.v2.WriteLogEntriesPartialErrors} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.WriteLogEntriesPartialErrors) + com.google.logging.v2.WriteLogEntriesPartialErrorsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_WriteLogEntriesPartialErrors_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetLogEntryErrors(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 1: + return internalGetMutableLogEntryErrors(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_WriteLogEntriesPartialErrors_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.WriteLogEntriesPartialErrors.class, com.google.logging.v2.WriteLogEntriesPartialErrors.Builder.class); + } + + // Construct using com.google.logging.v2.WriteLogEntriesPartialErrors.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + internalGetMutableLogEntryErrors().clear(); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_WriteLogEntriesPartialErrors_descriptor; + } + + public com.google.logging.v2.WriteLogEntriesPartialErrors getDefaultInstanceForType() { + return com.google.logging.v2.WriteLogEntriesPartialErrors.getDefaultInstance(); + } + + public com.google.logging.v2.WriteLogEntriesPartialErrors build() { + com.google.logging.v2.WriteLogEntriesPartialErrors result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.logging.v2.WriteLogEntriesPartialErrors buildPartial() { + com.google.logging.v2.WriteLogEntriesPartialErrors result = new com.google.logging.v2.WriteLogEntriesPartialErrors(this); + int from_bitField0_ = bitField0_; + result.logEntryErrors_ = internalGetLogEntryErrors(); + result.logEntryErrors_.makeImmutable(); + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.logging.v2.WriteLogEntriesPartialErrors) { + return mergeFrom((com.google.logging.v2.WriteLogEntriesPartialErrors)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.WriteLogEntriesPartialErrors other) { + if (other == com.google.logging.v2.WriteLogEntriesPartialErrors.getDefaultInstance()) return this; + internalGetMutableLogEntryErrors().mergeFrom( + other.internalGetLogEntryErrors()); + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.logging.v2.WriteLogEntriesPartialErrors parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.logging.v2.WriteLogEntriesPartialErrors) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.MapField< + java.lang.Integer, com.google.rpc.Status> logEntryErrors_; + private com.google.protobuf.MapField + internalGetLogEntryErrors() { + if (logEntryErrors_ == null) { + return com.google.protobuf.MapField.emptyMapField( + LogEntryErrorsDefaultEntryHolder.defaultEntry); + } + return logEntryErrors_; + } + private com.google.protobuf.MapField + internalGetMutableLogEntryErrors() { + onChanged();; + if (logEntryErrors_ == null) { + logEntryErrors_ = com.google.protobuf.MapField.newMapField( + LogEntryErrorsDefaultEntryHolder.defaultEntry); + } + if (!logEntryErrors_.isMutable()) { + logEntryErrors_ = logEntryErrors_.copy(); + } + return logEntryErrors_; + } + + public int getLogEntryErrorsCount() { + return internalGetLogEntryErrors().getMap().size(); + } + /** + *
+     * When `WriteLogEntriesRequest.partial_success` is true, records the error
+     * status for entries that were not written due to a permanent error, keyed
+     * by the entry's zero-based index in `WriteLogEntriesRequest.entries`.
+     * Failed requests for which no entries are written will not include
+     * per-entry errors.
+     * 
+ * + * map<int32, .google.rpc.Status> log_entry_errors = 1; + */ + + public boolean containsLogEntryErrors( + int key) { + + return internalGetLogEntryErrors().getMap().containsKey(key); + } + /** + * Use {@link #getLogEntryErrorsMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getLogEntryErrors() { + return getLogEntryErrorsMap(); + } + /** + *
+     * When `WriteLogEntriesRequest.partial_success` is true, records the error
+     * status for entries that were not written due to a permanent error, keyed
+     * by the entry's zero-based index in `WriteLogEntriesRequest.entries`.
+     * Failed requests for which no entries are written will not include
+     * per-entry errors.
+     * 
+ * + * map<int32, .google.rpc.Status> log_entry_errors = 1; + */ + + public java.util.Map getLogEntryErrorsMap() { + return internalGetLogEntryErrors().getMap(); + } + /** + *
+     * When `WriteLogEntriesRequest.partial_success` is true, records the error
+     * status for entries that were not written due to a permanent error, keyed
+     * by the entry's zero-based index in `WriteLogEntriesRequest.entries`.
+     * Failed requests for which no entries are written will not include
+     * per-entry errors.
+     * 
+ * + * map<int32, .google.rpc.Status> log_entry_errors = 1; + */ + + public com.google.rpc.Status getLogEntryErrorsOrDefault( + int key, + com.google.rpc.Status defaultValue) { + + java.util.Map map = + internalGetLogEntryErrors().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * When `WriteLogEntriesRequest.partial_success` is true, records the error
+     * status for entries that were not written due to a permanent error, keyed
+     * by the entry's zero-based index in `WriteLogEntriesRequest.entries`.
+     * Failed requests for which no entries are written will not include
+     * per-entry errors.
+     * 
+ * + * map<int32, .google.rpc.Status> log_entry_errors = 1; + */ + + public com.google.rpc.Status getLogEntryErrorsOrThrow( + int key) { + + java.util.Map map = + internalGetLogEntryErrors().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLogEntryErrors() { + internalGetMutableLogEntryErrors().getMutableMap() + .clear(); + return this; + } + /** + *
+     * When `WriteLogEntriesRequest.partial_success` is true, records the error
+     * status for entries that were not written due to a permanent error, keyed
+     * by the entry's zero-based index in `WriteLogEntriesRequest.entries`.
+     * Failed requests for which no entries are written will not include
+     * per-entry errors.
+     * 
+ * + * map<int32, .google.rpc.Status> log_entry_errors = 1; + */ + + public Builder removeLogEntryErrors( + int key) { + + internalGetMutableLogEntryErrors().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableLogEntryErrors() { + return internalGetMutableLogEntryErrors().getMutableMap(); + } + /** + *
+     * When `WriteLogEntriesRequest.partial_success` is true, records the error
+     * status for entries that were not written due to a permanent error, keyed
+     * by the entry's zero-based index in `WriteLogEntriesRequest.entries`.
+     * Failed requests for which no entries are written will not include
+     * per-entry errors.
+     * 
+ * + * map<int32, .google.rpc.Status> log_entry_errors = 1; + */ + public Builder putLogEntryErrors( + int key, + com.google.rpc.Status value) { + + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableLogEntryErrors().getMutableMap() + .put(key, value); + return this; + } + /** + *
+     * When `WriteLogEntriesRequest.partial_success` is true, records the error
+     * status for entries that were not written due to a permanent error, keyed
+     * by the entry's zero-based index in `WriteLogEntriesRequest.entries`.
+     * Failed requests for which no entries are written will not include
+     * per-entry errors.
+     * 
+ * + * map<int32, .google.rpc.Status> log_entry_errors = 1; + */ + + public Builder putAllLogEntryErrors( + java.util.Map values) { + internalGetMutableLogEntryErrors().getMutableMap() + .putAll(values); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.logging.v2.WriteLogEntriesPartialErrors) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.WriteLogEntriesPartialErrors) + private static final com.google.logging.v2.WriteLogEntriesPartialErrors DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.logging.v2.WriteLogEntriesPartialErrors(); + } + + public static com.google.logging.v2.WriteLogEntriesPartialErrors getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public WriteLogEntriesPartialErrors parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new WriteLogEntriesPartialErrors(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.logging.v2.WriteLogEntriesPartialErrors getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesPartialErrorsOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesPartialErrorsOrBuilder.java new file mode 100644 index 000000000000..3c82c127e439 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesPartialErrorsOrBuilder.java @@ -0,0 +1,83 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging.proto + +package com.google.logging.v2; + +public interface WriteLogEntriesPartialErrorsOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.WriteLogEntriesPartialErrors) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * When `WriteLogEntriesRequest.partial_success` is true, records the error
+   * status for entries that were not written due to a permanent error, keyed
+   * by the entry's zero-based index in `WriteLogEntriesRequest.entries`.
+   * Failed requests for which no entries are written will not include
+   * per-entry errors.
+   * 
+ * + * map<int32, .google.rpc.Status> log_entry_errors = 1; + */ + int getLogEntryErrorsCount(); + /** + *
+   * When `WriteLogEntriesRequest.partial_success` is true, records the error
+   * status for entries that were not written due to a permanent error, keyed
+   * by the entry's zero-based index in `WriteLogEntriesRequest.entries`.
+   * Failed requests for which no entries are written will not include
+   * per-entry errors.
+   * 
+ * + * map<int32, .google.rpc.Status> log_entry_errors = 1; + */ + boolean containsLogEntryErrors( + int key); + /** + * Use {@link #getLogEntryErrorsMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getLogEntryErrors(); + /** + *
+   * When `WriteLogEntriesRequest.partial_success` is true, records the error
+   * status for entries that were not written due to a permanent error, keyed
+   * by the entry's zero-based index in `WriteLogEntriesRequest.entries`.
+   * Failed requests for which no entries are written will not include
+   * per-entry errors.
+   * 
+ * + * map<int32, .google.rpc.Status> log_entry_errors = 1; + */ + java.util.Map + getLogEntryErrorsMap(); + /** + *
+   * When `WriteLogEntriesRequest.partial_success` is true, records the error
+   * status for entries that were not written due to a permanent error, keyed
+   * by the entry's zero-based index in `WriteLogEntriesRequest.entries`.
+   * Failed requests for which no entries are written will not include
+   * per-entry errors.
+   * 
+ * + * map<int32, .google.rpc.Status> log_entry_errors = 1; + */ + + com.google.rpc.Status getLogEntryErrorsOrDefault( + int key, + com.google.rpc.Status defaultValue); + /** + *
+   * When `WriteLogEntriesRequest.partial_success` is true, records the error
+   * status for entries that were not written due to a permanent error, keyed
+   * by the entry's zero-based index in `WriteLogEntriesRequest.entries`.
+   * Failed requests for which no entries are written will not include
+   * per-entry errors.
+   * 
+ * + * map<int32, .google.rpc.Status> log_entry_errors = 1; + */ + + com.google.rpc.Status getLogEntryErrorsOrThrow( + int key); +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesRequest.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesRequest.java new file mode 100644 index 000000000000..cfa124e3ac7b --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesRequest.java @@ -0,0 +1,2182 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging.proto + +package com.google.logging.v2; + +/** + *
+ * The parameters to WriteLogEntries.
+ * 
+ * + * Protobuf type {@code google.logging.v2.WriteLogEntriesRequest} + */ +public final class WriteLogEntriesRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.logging.v2.WriteLogEntriesRequest) + WriteLogEntriesRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use WriteLogEntriesRequest.newBuilder() to construct. + private WriteLogEntriesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private WriteLogEntriesRequest() { + logName_ = ""; + entries_ = java.util.Collections.emptyList(); + partialSuccess_ = false; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private WriteLogEntriesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + logName_ = s; + break; + } + case 18: { + com.google.api.MonitoredResource.Builder subBuilder = null; + if (resource_ != null) { + subBuilder = resource_.toBuilder(); + } + resource_ = input.readMessage(com.google.api.MonitoredResource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(resource_); + resource_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + labels_ = com.google.protobuf.MapField.newMapField( + LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000004; + } + com.google.protobuf.MapEntry + labels__ = input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put( + labels__.getKey(), labels__.getValue()); + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + entries_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000008; + } + entries_.add( + input.readMessage(com.google.logging.v2.LogEntry.parser(), extensionRegistry)); + break; + } + case 40: { + + partialSuccess_ = input.readBool(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + entries_ = java.util.Collections.unmodifiableList(entries_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_WriteLogEntriesRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 3: + return internalGetLabels(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_WriteLogEntriesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.WriteLogEntriesRequest.class, com.google.logging.v2.WriteLogEntriesRequest.Builder.class); + } + + private int bitField0_; + public static final int LOG_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object logName_; + /** + *
+   * Optional. A default log resource name that is assigned to all log entries
+   * in `entries` that do not specify a value for `log_name`:
+   *     "projects/[PROJECT_ID]/logs/[LOG_ID]"
+   *     "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
+   *     "folders/[FOLDER_ID]/logs/[LOG_ID]"
+   * `[LOG_ID]` must be URL-encoded. For example,
+   * `"projects/my-project-id/logs/syslog"` or
+   * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+   * For more information about log names, see
+   * [LogEntry][google.logging.v2.LogEntry].
+   * 
+ * + * string log_name = 1; + */ + public java.lang.String getLogName() { + java.lang.Object ref = logName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + logName_ = s; + return s; + } + } + /** + *
+   * Optional. A default log resource name that is assigned to all log entries
+   * in `entries` that do not specify a value for `log_name`:
+   *     "projects/[PROJECT_ID]/logs/[LOG_ID]"
+   *     "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
+   *     "folders/[FOLDER_ID]/logs/[LOG_ID]"
+   * `[LOG_ID]` must be URL-encoded. For example,
+   * `"projects/my-project-id/logs/syslog"` or
+   * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+   * For more information about log names, see
+   * [LogEntry][google.logging.v2.LogEntry].
+   * 
+ * + * string log_name = 1; + */ + public com.google.protobuf.ByteString + getLogNameBytes() { + java.lang.Object ref = logName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + logName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCE_FIELD_NUMBER = 2; + private com.google.api.MonitoredResource resource_; + /** + *
+   * Optional. A default monitored resource object that is assigned to all log
+   * entries in `entries` that do not specify a value for `resource`. Example:
+   *     { "type": "gce_instance",
+   *       "labels": {
+   *         "zone": "us-central1-a", "instance_id": "00000000000000000000" }}
+   * See [LogEntry][google.logging.v2.LogEntry].
+   * 
+ * + * .google.api.MonitoredResource resource = 2; + */ + public boolean hasResource() { + return resource_ != null; + } + /** + *
+   * Optional. A default monitored resource object that is assigned to all log
+   * entries in `entries` that do not specify a value for `resource`. Example:
+   *     { "type": "gce_instance",
+   *       "labels": {
+   *         "zone": "us-central1-a", "instance_id": "00000000000000000000" }}
+   * See [LogEntry][google.logging.v2.LogEntry].
+   * 
+ * + * .google.api.MonitoredResource resource = 2; + */ + public com.google.api.MonitoredResource getResource() { + return resource_ == null ? com.google.api.MonitoredResource.getDefaultInstance() : resource_; + } + /** + *
+   * Optional. A default monitored resource object that is assigned to all log
+   * entries in `entries` that do not specify a value for `resource`. Example:
+   *     { "type": "gce_instance",
+   *       "labels": {
+   *         "zone": "us-central1-a", "instance_id": "00000000000000000000" }}
+   * See [LogEntry][google.logging.v2.LogEntry].
+   * 
+ * + * .google.api.MonitoredResource resource = 2; + */ + public com.google.api.MonitoredResourceOrBuilder getResourceOrBuilder() { + return getResource(); + } + + public static final int LABELS_FIELD_NUMBER = 3; + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_WriteLogEntriesRequest_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> labels_; + private com.google.protobuf.MapField + internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField( + LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + *
+   * Optional. Default labels that are added to the `labels` field of all log
+   * entries in `entries`. If a log entry already has a label with the same key
+   * as a label in this parameter, then the log entry's label is not changed.
+   * See [LogEntry][google.logging.v2.LogEntry].
+   * 
+ * + * map<string, string> labels = 3; + */ + + public boolean containsLabels( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetLabels().getMap().containsKey(key); + } + /** + * Use {@link #getLabelsMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + *
+   * Optional. Default labels that are added to the `labels` field of all log
+   * entries in `entries`. If a log entry already has a label with the same key
+   * as a label in this parameter, then the log entry's label is not changed.
+   * See [LogEntry][google.logging.v2.LogEntry].
+   * 
+ * + * map<string, string> labels = 3; + */ + + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + *
+   * Optional. Default labels that are added to the `labels` field of all log
+   * entries in `entries`. If a log entry already has a label with the same key
+   * as a label in this parameter, then the log entry's label is not changed.
+   * See [LogEntry][google.logging.v2.LogEntry].
+   * 
+ * + * map<string, string> labels = 3; + */ + + public java.lang.String getLabelsOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+   * Optional. Default labels that are added to the `labels` field of all log
+   * entries in `entries`. If a log entry already has a label with the same key
+   * as a label in this parameter, then the log entry's label is not changed.
+   * See [LogEntry][google.logging.v2.LogEntry].
+   * 
+ * + * map<string, string> labels = 3; + */ + + public java.lang.String getLabelsOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int ENTRIES_FIELD_NUMBER = 4; + private java.util.List entries_; + /** + *
+   * Required. The log entries to send to Stackdriver Logging. The order of log
+   * entries in this list does not matter. Values supplied in this method's
+   * `log_name`, `resource`, and `labels` fields are copied into those log
+   * entries in this list that do not include values for their corresponding
+   * fields. For more information, see the [LogEntry][google.logging.v2.LogEntry] type.
+   * If the `timestamp` or `insert_id` fields are missing in log entries, then
+   * this method supplies the current time or a unique identifier, respectively.
+   * The supplied values are chosen so that, among the log entries that did not
+   * supply their own values, the entries earlier in the list will sort before
+   * the entries later in the list. See the `entries.list` method.
+   * Log entries with timestamps that are more than the
+   * [logs retention period](/logging/quota-policy) in the past or more than
+   * 24 hours in the future might be discarded. Discarding does not return
+   * an error.
+   * To improve throughput and to avoid exceeding the
+   * [quota limit](/logging/quota-policy) for calls to `entries.write`,
+   * you should try to include several log entries in this list,
+   * rather than calling this method for each individual log entry.
+   * 
+ * + * repeated .google.logging.v2.LogEntry entries = 4; + */ + public java.util.List getEntriesList() { + return entries_; + } + /** + *
+   * Required. The log entries to send to Stackdriver Logging. The order of log
+   * entries in this list does not matter. Values supplied in this method's
+   * `log_name`, `resource`, and `labels` fields are copied into those log
+   * entries in this list that do not include values for their corresponding
+   * fields. For more information, see the [LogEntry][google.logging.v2.LogEntry] type.
+   * If the `timestamp` or `insert_id` fields are missing in log entries, then
+   * this method supplies the current time or a unique identifier, respectively.
+   * The supplied values are chosen so that, among the log entries that did not
+   * supply their own values, the entries earlier in the list will sort before
+   * the entries later in the list. See the `entries.list` method.
+   * Log entries with timestamps that are more than the
+   * [logs retention period](/logging/quota-policy) in the past or more than
+   * 24 hours in the future might be discarded. Discarding does not return
+   * an error.
+   * To improve throughput and to avoid exceeding the
+   * [quota limit](/logging/quota-policy) for calls to `entries.write`,
+   * you should try to include several log entries in this list,
+   * rather than calling this method for each individual log entry.
+   * 
+ * + * repeated .google.logging.v2.LogEntry entries = 4; + */ + public java.util.List + getEntriesOrBuilderList() { + return entries_; + } + /** + *
+   * Required. The log entries to send to Stackdriver Logging. The order of log
+   * entries in this list does not matter. Values supplied in this method's
+   * `log_name`, `resource`, and `labels` fields are copied into those log
+   * entries in this list that do not include values for their corresponding
+   * fields. For more information, see the [LogEntry][google.logging.v2.LogEntry] type.
+   * If the `timestamp` or `insert_id` fields are missing in log entries, then
+   * this method supplies the current time or a unique identifier, respectively.
+   * The supplied values are chosen so that, among the log entries that did not
+   * supply their own values, the entries earlier in the list will sort before
+   * the entries later in the list. See the `entries.list` method.
+   * Log entries with timestamps that are more than the
+   * [logs retention period](/logging/quota-policy) in the past or more than
+   * 24 hours in the future might be discarded. Discarding does not return
+   * an error.
+   * To improve throughput and to avoid exceeding the
+   * [quota limit](/logging/quota-policy) for calls to `entries.write`,
+   * you should try to include several log entries in this list,
+   * rather than calling this method for each individual log entry.
+   * 
+ * + * repeated .google.logging.v2.LogEntry entries = 4; + */ + public int getEntriesCount() { + return entries_.size(); + } + /** + *
+   * Required. The log entries to send to Stackdriver Logging. The order of log
+   * entries in this list does not matter. Values supplied in this method's
+   * `log_name`, `resource`, and `labels` fields are copied into those log
+   * entries in this list that do not include values for their corresponding
+   * fields. For more information, see the [LogEntry][google.logging.v2.LogEntry] type.
+   * If the `timestamp` or `insert_id` fields are missing in log entries, then
+   * this method supplies the current time or a unique identifier, respectively.
+   * The supplied values are chosen so that, among the log entries that did not
+   * supply their own values, the entries earlier in the list will sort before
+   * the entries later in the list. See the `entries.list` method.
+   * Log entries with timestamps that are more than the
+   * [logs retention period](/logging/quota-policy) in the past or more than
+   * 24 hours in the future might be discarded. Discarding does not return
+   * an error.
+   * To improve throughput and to avoid exceeding the
+   * [quota limit](/logging/quota-policy) for calls to `entries.write`,
+   * you should try to include several log entries in this list,
+   * rather than calling this method for each individual log entry.
+   * 
+ * + * repeated .google.logging.v2.LogEntry entries = 4; + */ + public com.google.logging.v2.LogEntry getEntries(int index) { + return entries_.get(index); + } + /** + *
+   * Required. The log entries to send to Stackdriver Logging. The order of log
+   * entries in this list does not matter. Values supplied in this method's
+   * `log_name`, `resource`, and `labels` fields are copied into those log
+   * entries in this list that do not include values for their corresponding
+   * fields. For more information, see the [LogEntry][google.logging.v2.LogEntry] type.
+   * If the `timestamp` or `insert_id` fields are missing in log entries, then
+   * this method supplies the current time or a unique identifier, respectively.
+   * The supplied values are chosen so that, among the log entries that did not
+   * supply their own values, the entries earlier in the list will sort before
+   * the entries later in the list. See the `entries.list` method.
+   * Log entries with timestamps that are more than the
+   * [logs retention period](/logging/quota-policy) in the past or more than
+   * 24 hours in the future might be discarded. Discarding does not return
+   * an error.
+   * To improve throughput and to avoid exceeding the
+   * [quota limit](/logging/quota-policy) for calls to `entries.write`,
+   * you should try to include several log entries in this list,
+   * rather than calling this method for each individual log entry.
+   * 
+ * + * repeated .google.logging.v2.LogEntry entries = 4; + */ + public com.google.logging.v2.LogEntryOrBuilder getEntriesOrBuilder( + int index) { + return entries_.get(index); + } + + public static final int PARTIAL_SUCCESS_FIELD_NUMBER = 5; + private boolean partialSuccess_; + /** + *
+   * Optional. Whether valid entries should be written even if some other
+   * entries fail due to INVALID_ARGUMENT or PERMISSION_DENIED errors. If any
+   * entry is not written, then the response status is the error associated
+   * with one of the failed entries and the response includes error details
+   * keyed by the entries' zero-based index in the `entries.write` method.
+   * 
+ * + * bool partial_success = 5; + */ + public boolean getPartialSuccess() { + return partialSuccess_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getLogNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, logName_); + } + if (resource_ != null) { + output.writeMessage(2, getResource()); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetLabels(), + LabelsDefaultEntryHolder.defaultEntry, + 3); + for (int i = 0; i < entries_.size(); i++) { + output.writeMessage(4, entries_.get(i)); + } + if (partialSuccess_ != false) { + output.writeBool(5, partialSuccess_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getLogNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, logName_); + } + if (resource_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getResource()); + } + for (java.util.Map.Entry entry + : internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry + labels__ = LabelsDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, labels__); + } + for (int i = 0; i < entries_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, entries_.get(i)); + } + if (partialSuccess_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(5, partialSuccess_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.logging.v2.WriteLogEntriesRequest)) { + return super.equals(obj); + } + com.google.logging.v2.WriteLogEntriesRequest other = (com.google.logging.v2.WriteLogEntriesRequest) obj; + + boolean result = true; + result = result && getLogName() + .equals(other.getLogName()); + result = result && (hasResource() == other.hasResource()); + if (hasResource()) { + result = result && getResource() + .equals(other.getResource()); + } + result = result && internalGetLabels().equals( + other.internalGetLabels()); + result = result && getEntriesList() + .equals(other.getEntriesList()); + result = result && (getPartialSuccess() + == other.getPartialSuccess()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + LOG_NAME_FIELD_NUMBER; + hash = (53 * hash) + getLogName().hashCode(); + if (hasResource()) { + hash = (37 * hash) + RESOURCE_FIELD_NUMBER; + hash = (53 * hash) + getResource().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + if (getEntriesCount() > 0) { + hash = (37 * hash) + ENTRIES_FIELD_NUMBER; + hash = (53 * hash) + getEntriesList().hashCode(); + } + hash = (37 * hash) + PARTIAL_SUCCESS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getPartialSuccess()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.WriteLogEntriesRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.WriteLogEntriesRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.WriteLogEntriesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.WriteLogEntriesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.WriteLogEntriesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.WriteLogEntriesRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.WriteLogEntriesRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.WriteLogEntriesRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.WriteLogEntriesRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.logging.v2.WriteLogEntriesRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.WriteLogEntriesRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.WriteLogEntriesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.logging.v2.WriteLogEntriesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * The parameters to WriteLogEntries.
+   * 
+ * + * Protobuf type {@code google.logging.v2.WriteLogEntriesRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.WriteLogEntriesRequest) + com.google.logging.v2.WriteLogEntriesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_WriteLogEntriesRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 3: + return internalGetLabels(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 3: + return internalGetMutableLabels(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_WriteLogEntriesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.WriteLogEntriesRequest.class, com.google.logging.v2.WriteLogEntriesRequest.Builder.class); + } + + // Construct using com.google.logging.v2.WriteLogEntriesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getEntriesFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + logName_ = ""; + + if (resourceBuilder_ == null) { + resource_ = null; + } else { + resource_ = null; + resourceBuilder_ = null; + } + internalGetMutableLabels().clear(); + if (entriesBuilder_ == null) { + entries_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + } else { + entriesBuilder_.clear(); + } + partialSuccess_ = false; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_WriteLogEntriesRequest_descriptor; + } + + public com.google.logging.v2.WriteLogEntriesRequest getDefaultInstanceForType() { + return com.google.logging.v2.WriteLogEntriesRequest.getDefaultInstance(); + } + + public com.google.logging.v2.WriteLogEntriesRequest build() { + com.google.logging.v2.WriteLogEntriesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.logging.v2.WriteLogEntriesRequest buildPartial() { + com.google.logging.v2.WriteLogEntriesRequest result = new com.google.logging.v2.WriteLogEntriesRequest(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.logName_ = logName_; + if (resourceBuilder_ == null) { + result.resource_ = resource_; + } else { + result.resource_ = resourceBuilder_.build(); + } + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + if (entriesBuilder_ == null) { + if (((bitField0_ & 0x00000008) == 0x00000008)) { + entries_ = java.util.Collections.unmodifiableList(entries_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.entries_ = entries_; + } else { + result.entries_ = entriesBuilder_.build(); + } + result.partialSuccess_ = partialSuccess_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.logging.v2.WriteLogEntriesRequest) { + return mergeFrom((com.google.logging.v2.WriteLogEntriesRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.WriteLogEntriesRequest other) { + if (other == com.google.logging.v2.WriteLogEntriesRequest.getDefaultInstance()) return this; + if (!other.getLogName().isEmpty()) { + logName_ = other.logName_; + onChanged(); + } + if (other.hasResource()) { + mergeResource(other.getResource()); + } + internalGetMutableLabels().mergeFrom( + other.internalGetLabels()); + if (entriesBuilder_ == null) { + if (!other.entries_.isEmpty()) { + if (entries_.isEmpty()) { + entries_ = other.entries_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureEntriesIsMutable(); + entries_.addAll(other.entries_); + } + onChanged(); + } + } else { + if (!other.entries_.isEmpty()) { + if (entriesBuilder_.isEmpty()) { + entriesBuilder_.dispose(); + entriesBuilder_ = null; + entries_ = other.entries_; + bitField0_ = (bitField0_ & ~0x00000008); + entriesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getEntriesFieldBuilder() : null; + } else { + entriesBuilder_.addAllMessages(other.entries_); + } + } + } + if (other.getPartialSuccess() != false) { + setPartialSuccess(other.getPartialSuccess()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.logging.v2.WriteLogEntriesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.logging.v2.WriteLogEntriesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object logName_ = ""; + /** + *
+     * Optional. A default log resource name that is assigned to all log entries
+     * in `entries` that do not specify a value for `log_name`:
+     *     "projects/[PROJECT_ID]/logs/[LOG_ID]"
+     *     "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
+     *     "folders/[FOLDER_ID]/logs/[LOG_ID]"
+     * `[LOG_ID]` must be URL-encoded. For example,
+     * `"projects/my-project-id/logs/syslog"` or
+     * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+     * For more information about log names, see
+     * [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * string log_name = 1; + */ + public java.lang.String getLogName() { + java.lang.Object ref = logName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + logName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Optional. A default log resource name that is assigned to all log entries
+     * in `entries` that do not specify a value for `log_name`:
+     *     "projects/[PROJECT_ID]/logs/[LOG_ID]"
+     *     "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
+     *     "folders/[FOLDER_ID]/logs/[LOG_ID]"
+     * `[LOG_ID]` must be URL-encoded. For example,
+     * `"projects/my-project-id/logs/syslog"` or
+     * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+     * For more information about log names, see
+     * [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * string log_name = 1; + */ + public com.google.protobuf.ByteString + getLogNameBytes() { + java.lang.Object ref = logName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + logName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Optional. A default log resource name that is assigned to all log entries
+     * in `entries` that do not specify a value for `log_name`:
+     *     "projects/[PROJECT_ID]/logs/[LOG_ID]"
+     *     "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
+     *     "folders/[FOLDER_ID]/logs/[LOG_ID]"
+     * `[LOG_ID]` must be URL-encoded. For example,
+     * `"projects/my-project-id/logs/syslog"` or
+     * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+     * For more information about log names, see
+     * [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * string log_name = 1; + */ + public Builder setLogName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + logName_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. A default log resource name that is assigned to all log entries
+     * in `entries` that do not specify a value for `log_name`:
+     *     "projects/[PROJECT_ID]/logs/[LOG_ID]"
+     *     "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
+     *     "folders/[FOLDER_ID]/logs/[LOG_ID]"
+     * `[LOG_ID]` must be URL-encoded. For example,
+     * `"projects/my-project-id/logs/syslog"` or
+     * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+     * For more information about log names, see
+     * [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * string log_name = 1; + */ + public Builder clearLogName() { + + logName_ = getDefaultInstance().getLogName(); + onChanged(); + return this; + } + /** + *
+     * Optional. A default log resource name that is assigned to all log entries
+     * in `entries` that do not specify a value for `log_name`:
+     *     "projects/[PROJECT_ID]/logs/[LOG_ID]"
+     *     "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
+     *     "folders/[FOLDER_ID]/logs/[LOG_ID]"
+     * `[LOG_ID]` must be URL-encoded. For example,
+     * `"projects/my-project-id/logs/syslog"` or
+     * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+     * For more information about log names, see
+     * [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * string log_name = 1; + */ + public Builder setLogNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + logName_ = value; + onChanged(); + return this; + } + + private com.google.api.MonitoredResource resource_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.MonitoredResource, com.google.api.MonitoredResource.Builder, com.google.api.MonitoredResourceOrBuilder> resourceBuilder_; + /** + *
+     * Optional. A default monitored resource object that is assigned to all log
+     * entries in `entries` that do not specify a value for `resource`. Example:
+     *     { "type": "gce_instance",
+     *       "labels": {
+     *         "zone": "us-central1-a", "instance_id": "00000000000000000000" }}
+     * See [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * .google.api.MonitoredResource resource = 2; + */ + public boolean hasResource() { + return resourceBuilder_ != null || resource_ != null; + } + /** + *
+     * Optional. A default monitored resource object that is assigned to all log
+     * entries in `entries` that do not specify a value for `resource`. Example:
+     *     { "type": "gce_instance",
+     *       "labels": {
+     *         "zone": "us-central1-a", "instance_id": "00000000000000000000" }}
+     * See [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * .google.api.MonitoredResource resource = 2; + */ + public com.google.api.MonitoredResource getResource() { + if (resourceBuilder_ == null) { + return resource_ == null ? com.google.api.MonitoredResource.getDefaultInstance() : resource_; + } else { + return resourceBuilder_.getMessage(); + } + } + /** + *
+     * Optional. A default monitored resource object that is assigned to all log
+     * entries in `entries` that do not specify a value for `resource`. Example:
+     *     { "type": "gce_instance",
+     *       "labels": {
+     *         "zone": "us-central1-a", "instance_id": "00000000000000000000" }}
+     * See [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * .google.api.MonitoredResource resource = 2; + */ + public Builder setResource(com.google.api.MonitoredResource value) { + if (resourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resource_ = value; + onChanged(); + } else { + resourceBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Optional. A default monitored resource object that is assigned to all log
+     * entries in `entries` that do not specify a value for `resource`. Example:
+     *     { "type": "gce_instance",
+     *       "labels": {
+     *         "zone": "us-central1-a", "instance_id": "00000000000000000000" }}
+     * See [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * .google.api.MonitoredResource resource = 2; + */ + public Builder setResource( + com.google.api.MonitoredResource.Builder builderForValue) { + if (resourceBuilder_ == null) { + resource_ = builderForValue.build(); + onChanged(); + } else { + resourceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Optional. A default monitored resource object that is assigned to all log
+     * entries in `entries` that do not specify a value for `resource`. Example:
+     *     { "type": "gce_instance",
+     *       "labels": {
+     *         "zone": "us-central1-a", "instance_id": "00000000000000000000" }}
+     * See [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * .google.api.MonitoredResource resource = 2; + */ + public Builder mergeResource(com.google.api.MonitoredResource value) { + if (resourceBuilder_ == null) { + if (resource_ != null) { + resource_ = + com.google.api.MonitoredResource.newBuilder(resource_).mergeFrom(value).buildPartial(); + } else { + resource_ = value; + } + onChanged(); + } else { + resourceBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Optional. A default monitored resource object that is assigned to all log
+     * entries in `entries` that do not specify a value for `resource`. Example:
+     *     { "type": "gce_instance",
+     *       "labels": {
+     *         "zone": "us-central1-a", "instance_id": "00000000000000000000" }}
+     * See [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * .google.api.MonitoredResource resource = 2; + */ + public Builder clearResource() { + if (resourceBuilder_ == null) { + resource_ = null; + onChanged(); + } else { + resource_ = null; + resourceBuilder_ = null; + } + + return this; + } + /** + *
+     * Optional. A default monitored resource object that is assigned to all log
+     * entries in `entries` that do not specify a value for `resource`. Example:
+     *     { "type": "gce_instance",
+     *       "labels": {
+     *         "zone": "us-central1-a", "instance_id": "00000000000000000000" }}
+     * See [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * .google.api.MonitoredResource resource = 2; + */ + public com.google.api.MonitoredResource.Builder getResourceBuilder() { + + onChanged(); + return getResourceFieldBuilder().getBuilder(); + } + /** + *
+     * Optional. A default monitored resource object that is assigned to all log
+     * entries in `entries` that do not specify a value for `resource`. Example:
+     *     { "type": "gce_instance",
+     *       "labels": {
+     *         "zone": "us-central1-a", "instance_id": "00000000000000000000" }}
+     * See [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * .google.api.MonitoredResource resource = 2; + */ + public com.google.api.MonitoredResourceOrBuilder getResourceOrBuilder() { + if (resourceBuilder_ != null) { + return resourceBuilder_.getMessageOrBuilder(); + } else { + return resource_ == null ? + com.google.api.MonitoredResource.getDefaultInstance() : resource_; + } + } + /** + *
+     * Optional. A default monitored resource object that is assigned to all log
+     * entries in `entries` that do not specify a value for `resource`. Example:
+     *     { "type": "gce_instance",
+     *       "labels": {
+     *         "zone": "us-central1-a", "instance_id": "00000000000000000000" }}
+     * See [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * .google.api.MonitoredResource resource = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.MonitoredResource, com.google.api.MonitoredResource.Builder, com.google.api.MonitoredResourceOrBuilder> + getResourceFieldBuilder() { + if (resourceBuilder_ == null) { + resourceBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.api.MonitoredResource, com.google.api.MonitoredResource.Builder, com.google.api.MonitoredResourceOrBuilder>( + getResource(), + getParentForChildren(), + isClean()); + resource_ = null; + } + return resourceBuilder_; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> labels_; + private com.google.protobuf.MapField + internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField( + LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged();; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField( + LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + *
+     * Optional. Default labels that are added to the `labels` field of all log
+     * entries in `entries`. If a log entry already has a label with the same key
+     * as a label in this parameter, then the log entry's label is not changed.
+     * See [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * map<string, string> labels = 3; + */ + + public boolean containsLabels( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetLabels().getMap().containsKey(key); + } + /** + * Use {@link #getLabelsMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + *
+     * Optional. Default labels that are added to the `labels` field of all log
+     * entries in `entries`. If a log entry already has a label with the same key
+     * as a label in this parameter, then the log entry's label is not changed.
+     * See [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * map<string, string> labels = 3; + */ + + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + *
+     * Optional. Default labels that are added to the `labels` field of all log
+     * entries in `entries`. If a log entry already has a label with the same key
+     * as a label in this parameter, then the log entry's label is not changed.
+     * See [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * map<string, string> labels = 3; + */ + + public java.lang.String getLabelsOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * Optional. Default labels that are added to the `labels` field of all log
+     * entries in `entries`. If a log entry already has a label with the same key
+     * as a label in this parameter, then the log entry's label is not changed.
+     * See [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * map<string, string> labels = 3; + */ + + public java.lang.String getLabelsOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap() + .clear(); + return this; + } + /** + *
+     * Optional. Default labels that are added to the `labels` field of all log
+     * entries in `entries`. If a log entry already has a label with the same key
+     * as a label in this parameter, then the log entry's label is not changed.
+     * See [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * map<string, string> labels = 3; + */ + + public Builder removeLabels( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableLabels().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + *
+     * Optional. Default labels that are added to the `labels` field of all log
+     * entries in `entries`. If a log entry already has a label with the same key
+     * as a label in this parameter, then the log entry's label is not changed.
+     * See [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * map<string, string> labels = 3; + */ + public Builder putLabels( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableLabels().getMutableMap() + .put(key, value); + return this; + } + /** + *
+     * Optional. Default labels that are added to the `labels` field of all log
+     * entries in `entries`. If a log entry already has a label with the same key
+     * as a label in this parameter, then the log entry's label is not changed.
+     * See [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * map<string, string> labels = 3; + */ + + public Builder putAllLabels( + java.util.Map values) { + internalGetMutableLabels().getMutableMap() + .putAll(values); + return this; + } + + private java.util.List entries_ = + java.util.Collections.emptyList(); + private void ensureEntriesIsMutable() { + if (!((bitField0_ & 0x00000008) == 0x00000008)) { + entries_ = new java.util.ArrayList(entries_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogEntry, com.google.logging.v2.LogEntry.Builder, com.google.logging.v2.LogEntryOrBuilder> entriesBuilder_; + + /** + *
+     * Required. The log entries to send to Stackdriver Logging. The order of log
+     * entries in this list does not matter. Values supplied in this method's
+     * `log_name`, `resource`, and `labels` fields are copied into those log
+     * entries in this list that do not include values for their corresponding
+     * fields. For more information, see the [LogEntry][google.logging.v2.LogEntry] type.
+     * If the `timestamp` or `insert_id` fields are missing in log entries, then
+     * this method supplies the current time or a unique identifier, respectively.
+     * The supplied values are chosen so that, among the log entries that did not
+     * supply their own values, the entries earlier in the list will sort before
+     * the entries later in the list. See the `entries.list` method.
+     * Log entries with timestamps that are more than the
+     * [logs retention period](/logging/quota-policy) in the past or more than
+     * 24 hours in the future might be discarded. Discarding does not return
+     * an error.
+     * To improve throughput and to avoid exceeding the
+     * [quota limit](/logging/quota-policy) for calls to `entries.write`,
+     * you should try to include several log entries in this list,
+     * rather than calling this method for each individual log entry.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 4; + */ + public java.util.List getEntriesList() { + if (entriesBuilder_ == null) { + return java.util.Collections.unmodifiableList(entries_); + } else { + return entriesBuilder_.getMessageList(); + } + } + /** + *
+     * Required. The log entries to send to Stackdriver Logging. The order of log
+     * entries in this list does not matter. Values supplied in this method's
+     * `log_name`, `resource`, and `labels` fields are copied into those log
+     * entries in this list that do not include values for their corresponding
+     * fields. For more information, see the [LogEntry][google.logging.v2.LogEntry] type.
+     * If the `timestamp` or `insert_id` fields are missing in log entries, then
+     * this method supplies the current time or a unique identifier, respectively.
+     * The supplied values are chosen so that, among the log entries that did not
+     * supply their own values, the entries earlier in the list will sort before
+     * the entries later in the list. See the `entries.list` method.
+     * Log entries with timestamps that are more than the
+     * [logs retention period](/logging/quota-policy) in the past or more than
+     * 24 hours in the future might be discarded. Discarding does not return
+     * an error.
+     * To improve throughput and to avoid exceeding the
+     * [quota limit](/logging/quota-policy) for calls to `entries.write`,
+     * you should try to include several log entries in this list,
+     * rather than calling this method for each individual log entry.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 4; + */ + public int getEntriesCount() { + if (entriesBuilder_ == null) { + return entries_.size(); + } else { + return entriesBuilder_.getCount(); + } + } + /** + *
+     * Required. The log entries to send to Stackdriver Logging. The order of log
+     * entries in this list does not matter. Values supplied in this method's
+     * `log_name`, `resource`, and `labels` fields are copied into those log
+     * entries in this list that do not include values for their corresponding
+     * fields. For more information, see the [LogEntry][google.logging.v2.LogEntry] type.
+     * If the `timestamp` or `insert_id` fields are missing in log entries, then
+     * this method supplies the current time or a unique identifier, respectively.
+     * The supplied values are chosen so that, among the log entries that did not
+     * supply their own values, the entries earlier in the list will sort before
+     * the entries later in the list. See the `entries.list` method.
+     * Log entries with timestamps that are more than the
+     * [logs retention period](/logging/quota-policy) in the past or more than
+     * 24 hours in the future might be discarded. Discarding does not return
+     * an error.
+     * To improve throughput and to avoid exceeding the
+     * [quota limit](/logging/quota-policy) for calls to `entries.write`,
+     * you should try to include several log entries in this list,
+     * rather than calling this method for each individual log entry.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 4; + */ + public com.google.logging.v2.LogEntry getEntries(int index) { + if (entriesBuilder_ == null) { + return entries_.get(index); + } else { + return entriesBuilder_.getMessage(index); + } + } + /** + *
+     * Required. The log entries to send to Stackdriver Logging. The order of log
+     * entries in this list does not matter. Values supplied in this method's
+     * `log_name`, `resource`, and `labels` fields are copied into those log
+     * entries in this list that do not include values for their corresponding
+     * fields. For more information, see the [LogEntry][google.logging.v2.LogEntry] type.
+     * If the `timestamp` or `insert_id` fields are missing in log entries, then
+     * this method supplies the current time or a unique identifier, respectively.
+     * The supplied values are chosen so that, among the log entries that did not
+     * supply their own values, the entries earlier in the list will sort before
+     * the entries later in the list. See the `entries.list` method.
+     * Log entries with timestamps that are more than the
+     * [logs retention period](/logging/quota-policy) in the past or more than
+     * 24 hours in the future might be discarded. Discarding does not return
+     * an error.
+     * To improve throughput and to avoid exceeding the
+     * [quota limit](/logging/quota-policy) for calls to `entries.write`,
+     * you should try to include several log entries in this list,
+     * rather than calling this method for each individual log entry.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 4; + */ + public Builder setEntries( + int index, com.google.logging.v2.LogEntry value) { + if (entriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntriesIsMutable(); + entries_.set(index, value); + onChanged(); + } else { + entriesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Required. The log entries to send to Stackdriver Logging. The order of log
+     * entries in this list does not matter. Values supplied in this method's
+     * `log_name`, `resource`, and `labels` fields are copied into those log
+     * entries in this list that do not include values for their corresponding
+     * fields. For more information, see the [LogEntry][google.logging.v2.LogEntry] type.
+     * If the `timestamp` or `insert_id` fields are missing in log entries, then
+     * this method supplies the current time or a unique identifier, respectively.
+     * The supplied values are chosen so that, among the log entries that did not
+     * supply their own values, the entries earlier in the list will sort before
+     * the entries later in the list. See the `entries.list` method.
+     * Log entries with timestamps that are more than the
+     * [logs retention period](/logging/quota-policy) in the past or more than
+     * 24 hours in the future might be discarded. Discarding does not return
+     * an error.
+     * To improve throughput and to avoid exceeding the
+     * [quota limit](/logging/quota-policy) for calls to `entries.write`,
+     * you should try to include several log entries in this list,
+     * rather than calling this method for each individual log entry.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 4; + */ + public Builder setEntries( + int index, com.google.logging.v2.LogEntry.Builder builderForValue) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.set(index, builderForValue.build()); + onChanged(); + } else { + entriesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Required. The log entries to send to Stackdriver Logging. The order of log
+     * entries in this list does not matter. Values supplied in this method's
+     * `log_name`, `resource`, and `labels` fields are copied into those log
+     * entries in this list that do not include values for their corresponding
+     * fields. For more information, see the [LogEntry][google.logging.v2.LogEntry] type.
+     * If the `timestamp` or `insert_id` fields are missing in log entries, then
+     * this method supplies the current time or a unique identifier, respectively.
+     * The supplied values are chosen so that, among the log entries that did not
+     * supply their own values, the entries earlier in the list will sort before
+     * the entries later in the list. See the `entries.list` method.
+     * Log entries with timestamps that are more than the
+     * [logs retention period](/logging/quota-policy) in the past or more than
+     * 24 hours in the future might be discarded. Discarding does not return
+     * an error.
+     * To improve throughput and to avoid exceeding the
+     * [quota limit](/logging/quota-policy) for calls to `entries.write`,
+     * you should try to include several log entries in this list,
+     * rather than calling this method for each individual log entry.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 4; + */ + public Builder addEntries(com.google.logging.v2.LogEntry value) { + if (entriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntriesIsMutable(); + entries_.add(value); + onChanged(); + } else { + entriesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Required. The log entries to send to Stackdriver Logging. The order of log
+     * entries in this list does not matter. Values supplied in this method's
+     * `log_name`, `resource`, and `labels` fields are copied into those log
+     * entries in this list that do not include values for their corresponding
+     * fields. For more information, see the [LogEntry][google.logging.v2.LogEntry] type.
+     * If the `timestamp` or `insert_id` fields are missing in log entries, then
+     * this method supplies the current time or a unique identifier, respectively.
+     * The supplied values are chosen so that, among the log entries that did not
+     * supply their own values, the entries earlier in the list will sort before
+     * the entries later in the list. See the `entries.list` method.
+     * Log entries with timestamps that are more than the
+     * [logs retention period](/logging/quota-policy) in the past or more than
+     * 24 hours in the future might be discarded. Discarding does not return
+     * an error.
+     * To improve throughput and to avoid exceeding the
+     * [quota limit](/logging/quota-policy) for calls to `entries.write`,
+     * you should try to include several log entries in this list,
+     * rather than calling this method for each individual log entry.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 4; + */ + public Builder addEntries( + int index, com.google.logging.v2.LogEntry value) { + if (entriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntriesIsMutable(); + entries_.add(index, value); + onChanged(); + } else { + entriesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Required. The log entries to send to Stackdriver Logging. The order of log
+     * entries in this list does not matter. Values supplied in this method's
+     * `log_name`, `resource`, and `labels` fields are copied into those log
+     * entries in this list that do not include values for their corresponding
+     * fields. For more information, see the [LogEntry][google.logging.v2.LogEntry] type.
+     * If the `timestamp` or `insert_id` fields are missing in log entries, then
+     * this method supplies the current time or a unique identifier, respectively.
+     * The supplied values are chosen so that, among the log entries that did not
+     * supply their own values, the entries earlier in the list will sort before
+     * the entries later in the list. See the `entries.list` method.
+     * Log entries with timestamps that are more than the
+     * [logs retention period](/logging/quota-policy) in the past or more than
+     * 24 hours in the future might be discarded. Discarding does not return
+     * an error.
+     * To improve throughput and to avoid exceeding the
+     * [quota limit](/logging/quota-policy) for calls to `entries.write`,
+     * you should try to include several log entries in this list,
+     * rather than calling this method for each individual log entry.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 4; + */ + public Builder addEntries( + com.google.logging.v2.LogEntry.Builder builderForValue) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.add(builderForValue.build()); + onChanged(); + } else { + entriesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Required. The log entries to send to Stackdriver Logging. The order of log
+     * entries in this list does not matter. Values supplied in this method's
+     * `log_name`, `resource`, and `labels` fields are copied into those log
+     * entries in this list that do not include values for their corresponding
+     * fields. For more information, see the [LogEntry][google.logging.v2.LogEntry] type.
+     * If the `timestamp` or `insert_id` fields are missing in log entries, then
+     * this method supplies the current time or a unique identifier, respectively.
+     * The supplied values are chosen so that, among the log entries that did not
+     * supply their own values, the entries earlier in the list will sort before
+     * the entries later in the list. See the `entries.list` method.
+     * Log entries with timestamps that are more than the
+     * [logs retention period](/logging/quota-policy) in the past or more than
+     * 24 hours in the future might be discarded. Discarding does not return
+     * an error.
+     * To improve throughput and to avoid exceeding the
+     * [quota limit](/logging/quota-policy) for calls to `entries.write`,
+     * you should try to include several log entries in this list,
+     * rather than calling this method for each individual log entry.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 4; + */ + public Builder addEntries( + int index, com.google.logging.v2.LogEntry.Builder builderForValue) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.add(index, builderForValue.build()); + onChanged(); + } else { + entriesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Required. The log entries to send to Stackdriver Logging. The order of log
+     * entries in this list does not matter. Values supplied in this method's
+     * `log_name`, `resource`, and `labels` fields are copied into those log
+     * entries in this list that do not include values for their corresponding
+     * fields. For more information, see the [LogEntry][google.logging.v2.LogEntry] type.
+     * If the `timestamp` or `insert_id` fields are missing in log entries, then
+     * this method supplies the current time or a unique identifier, respectively.
+     * The supplied values are chosen so that, among the log entries that did not
+     * supply their own values, the entries earlier in the list will sort before
+     * the entries later in the list. See the `entries.list` method.
+     * Log entries with timestamps that are more than the
+     * [logs retention period](/logging/quota-policy) in the past or more than
+     * 24 hours in the future might be discarded. Discarding does not return
+     * an error.
+     * To improve throughput and to avoid exceeding the
+     * [quota limit](/logging/quota-policy) for calls to `entries.write`,
+     * you should try to include several log entries in this list,
+     * rather than calling this method for each individual log entry.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 4; + */ + public Builder addAllEntries( + java.lang.Iterable values) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, entries_); + onChanged(); + } else { + entriesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Required. The log entries to send to Stackdriver Logging. The order of log
+     * entries in this list does not matter. Values supplied in this method's
+     * `log_name`, `resource`, and `labels` fields are copied into those log
+     * entries in this list that do not include values for their corresponding
+     * fields. For more information, see the [LogEntry][google.logging.v2.LogEntry] type.
+     * If the `timestamp` or `insert_id` fields are missing in log entries, then
+     * this method supplies the current time or a unique identifier, respectively.
+     * The supplied values are chosen so that, among the log entries that did not
+     * supply their own values, the entries earlier in the list will sort before
+     * the entries later in the list. See the `entries.list` method.
+     * Log entries with timestamps that are more than the
+     * [logs retention period](/logging/quota-policy) in the past or more than
+     * 24 hours in the future might be discarded. Discarding does not return
+     * an error.
+     * To improve throughput and to avoid exceeding the
+     * [quota limit](/logging/quota-policy) for calls to `entries.write`,
+     * you should try to include several log entries in this list,
+     * rather than calling this method for each individual log entry.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 4; + */ + public Builder clearEntries() { + if (entriesBuilder_ == null) { + entries_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + entriesBuilder_.clear(); + } + return this; + } + /** + *
+     * Required. The log entries to send to Stackdriver Logging. The order of log
+     * entries in this list does not matter. Values supplied in this method's
+     * `log_name`, `resource`, and `labels` fields are copied into those log
+     * entries in this list that do not include values for their corresponding
+     * fields. For more information, see the [LogEntry][google.logging.v2.LogEntry] type.
+     * If the `timestamp` or `insert_id` fields are missing in log entries, then
+     * this method supplies the current time or a unique identifier, respectively.
+     * The supplied values are chosen so that, among the log entries that did not
+     * supply their own values, the entries earlier in the list will sort before
+     * the entries later in the list. See the `entries.list` method.
+     * Log entries with timestamps that are more than the
+     * [logs retention period](/logging/quota-policy) in the past or more than
+     * 24 hours in the future might be discarded. Discarding does not return
+     * an error.
+     * To improve throughput and to avoid exceeding the
+     * [quota limit](/logging/quota-policy) for calls to `entries.write`,
+     * you should try to include several log entries in this list,
+     * rather than calling this method for each individual log entry.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 4; + */ + public Builder removeEntries(int index) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.remove(index); + onChanged(); + } else { + entriesBuilder_.remove(index); + } + return this; + } + /** + *
+     * Required. The log entries to send to Stackdriver Logging. The order of log
+     * entries in this list does not matter. Values supplied in this method's
+     * `log_name`, `resource`, and `labels` fields are copied into those log
+     * entries in this list that do not include values for their corresponding
+     * fields. For more information, see the [LogEntry][google.logging.v2.LogEntry] type.
+     * If the `timestamp` or `insert_id` fields are missing in log entries, then
+     * this method supplies the current time or a unique identifier, respectively.
+     * The supplied values are chosen so that, among the log entries that did not
+     * supply their own values, the entries earlier in the list will sort before
+     * the entries later in the list. See the `entries.list` method.
+     * Log entries with timestamps that are more than the
+     * [logs retention period](/logging/quota-policy) in the past or more than
+     * 24 hours in the future might be discarded. Discarding does not return
+     * an error.
+     * To improve throughput and to avoid exceeding the
+     * [quota limit](/logging/quota-policy) for calls to `entries.write`,
+     * you should try to include several log entries in this list,
+     * rather than calling this method for each individual log entry.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 4; + */ + public com.google.logging.v2.LogEntry.Builder getEntriesBuilder( + int index) { + return getEntriesFieldBuilder().getBuilder(index); + } + /** + *
+     * Required. The log entries to send to Stackdriver Logging. The order of log
+     * entries in this list does not matter. Values supplied in this method's
+     * `log_name`, `resource`, and `labels` fields are copied into those log
+     * entries in this list that do not include values for their corresponding
+     * fields. For more information, see the [LogEntry][google.logging.v2.LogEntry] type.
+     * If the `timestamp` or `insert_id` fields are missing in log entries, then
+     * this method supplies the current time or a unique identifier, respectively.
+     * The supplied values are chosen so that, among the log entries that did not
+     * supply their own values, the entries earlier in the list will sort before
+     * the entries later in the list. See the `entries.list` method.
+     * Log entries with timestamps that are more than the
+     * [logs retention period](/logging/quota-policy) in the past or more than
+     * 24 hours in the future might be discarded. Discarding does not return
+     * an error.
+     * To improve throughput and to avoid exceeding the
+     * [quota limit](/logging/quota-policy) for calls to `entries.write`,
+     * you should try to include several log entries in this list,
+     * rather than calling this method for each individual log entry.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 4; + */ + public com.google.logging.v2.LogEntryOrBuilder getEntriesOrBuilder( + int index) { + if (entriesBuilder_ == null) { + return entries_.get(index); } else { + return entriesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Required. The log entries to send to Stackdriver Logging. The order of log
+     * entries in this list does not matter. Values supplied in this method's
+     * `log_name`, `resource`, and `labels` fields are copied into those log
+     * entries in this list that do not include values for their corresponding
+     * fields. For more information, see the [LogEntry][google.logging.v2.LogEntry] type.
+     * If the `timestamp` or `insert_id` fields are missing in log entries, then
+     * this method supplies the current time or a unique identifier, respectively.
+     * The supplied values are chosen so that, among the log entries that did not
+     * supply their own values, the entries earlier in the list will sort before
+     * the entries later in the list. See the `entries.list` method.
+     * Log entries with timestamps that are more than the
+     * [logs retention period](/logging/quota-policy) in the past or more than
+     * 24 hours in the future might be discarded. Discarding does not return
+     * an error.
+     * To improve throughput and to avoid exceeding the
+     * [quota limit](/logging/quota-policy) for calls to `entries.write`,
+     * you should try to include several log entries in this list,
+     * rather than calling this method for each individual log entry.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 4; + */ + public java.util.List + getEntriesOrBuilderList() { + if (entriesBuilder_ != null) { + return entriesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(entries_); + } + } + /** + *
+     * Required. The log entries to send to Stackdriver Logging. The order of log
+     * entries in this list does not matter. Values supplied in this method's
+     * `log_name`, `resource`, and `labels` fields are copied into those log
+     * entries in this list that do not include values for their corresponding
+     * fields. For more information, see the [LogEntry][google.logging.v2.LogEntry] type.
+     * If the `timestamp` or `insert_id` fields are missing in log entries, then
+     * this method supplies the current time or a unique identifier, respectively.
+     * The supplied values are chosen so that, among the log entries that did not
+     * supply their own values, the entries earlier in the list will sort before
+     * the entries later in the list. See the `entries.list` method.
+     * Log entries with timestamps that are more than the
+     * [logs retention period](/logging/quota-policy) in the past or more than
+     * 24 hours in the future might be discarded. Discarding does not return
+     * an error.
+     * To improve throughput and to avoid exceeding the
+     * [quota limit](/logging/quota-policy) for calls to `entries.write`,
+     * you should try to include several log entries in this list,
+     * rather than calling this method for each individual log entry.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 4; + */ + public com.google.logging.v2.LogEntry.Builder addEntriesBuilder() { + return getEntriesFieldBuilder().addBuilder( + com.google.logging.v2.LogEntry.getDefaultInstance()); + } + /** + *
+     * Required. The log entries to send to Stackdriver Logging. The order of log
+     * entries in this list does not matter. Values supplied in this method's
+     * `log_name`, `resource`, and `labels` fields are copied into those log
+     * entries in this list that do not include values for their corresponding
+     * fields. For more information, see the [LogEntry][google.logging.v2.LogEntry] type.
+     * If the `timestamp` or `insert_id` fields are missing in log entries, then
+     * this method supplies the current time or a unique identifier, respectively.
+     * The supplied values are chosen so that, among the log entries that did not
+     * supply their own values, the entries earlier in the list will sort before
+     * the entries later in the list. See the `entries.list` method.
+     * Log entries with timestamps that are more than the
+     * [logs retention period](/logging/quota-policy) in the past or more than
+     * 24 hours in the future might be discarded. Discarding does not return
+     * an error.
+     * To improve throughput and to avoid exceeding the
+     * [quota limit](/logging/quota-policy) for calls to `entries.write`,
+     * you should try to include several log entries in this list,
+     * rather than calling this method for each individual log entry.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 4; + */ + public com.google.logging.v2.LogEntry.Builder addEntriesBuilder( + int index) { + return getEntriesFieldBuilder().addBuilder( + index, com.google.logging.v2.LogEntry.getDefaultInstance()); + } + /** + *
+     * Required. The log entries to send to Stackdriver Logging. The order of log
+     * entries in this list does not matter. Values supplied in this method's
+     * `log_name`, `resource`, and `labels` fields are copied into those log
+     * entries in this list that do not include values for their corresponding
+     * fields. For more information, see the [LogEntry][google.logging.v2.LogEntry] type.
+     * If the `timestamp` or `insert_id` fields are missing in log entries, then
+     * this method supplies the current time or a unique identifier, respectively.
+     * The supplied values are chosen so that, among the log entries that did not
+     * supply their own values, the entries earlier in the list will sort before
+     * the entries later in the list. See the `entries.list` method.
+     * Log entries with timestamps that are more than the
+     * [logs retention period](/logging/quota-policy) in the past or more than
+     * 24 hours in the future might be discarded. Discarding does not return
+     * an error.
+     * To improve throughput and to avoid exceeding the
+     * [quota limit](/logging/quota-policy) for calls to `entries.write`,
+     * you should try to include several log entries in this list,
+     * rather than calling this method for each individual log entry.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 4; + */ + public java.util.List + getEntriesBuilderList() { + return getEntriesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogEntry, com.google.logging.v2.LogEntry.Builder, com.google.logging.v2.LogEntryOrBuilder> + getEntriesFieldBuilder() { + if (entriesBuilder_ == null) { + entriesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogEntry, com.google.logging.v2.LogEntry.Builder, com.google.logging.v2.LogEntryOrBuilder>( + entries_, + ((bitField0_ & 0x00000008) == 0x00000008), + getParentForChildren(), + isClean()); + entries_ = null; + } + return entriesBuilder_; + } + + private boolean partialSuccess_ ; + /** + *
+     * Optional. Whether valid entries should be written even if some other
+     * entries fail due to INVALID_ARGUMENT or PERMISSION_DENIED errors. If any
+     * entry is not written, then the response status is the error associated
+     * with one of the failed entries and the response includes error details
+     * keyed by the entries' zero-based index in the `entries.write` method.
+     * 
+ * + * bool partial_success = 5; + */ + public boolean getPartialSuccess() { + return partialSuccess_; + } + /** + *
+     * Optional. Whether valid entries should be written even if some other
+     * entries fail due to INVALID_ARGUMENT or PERMISSION_DENIED errors. If any
+     * entry is not written, then the response status is the error associated
+     * with one of the failed entries and the response includes error details
+     * keyed by the entries' zero-based index in the `entries.write` method.
+     * 
+ * + * bool partial_success = 5; + */ + public Builder setPartialSuccess(boolean value) { + + partialSuccess_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. Whether valid entries should be written even if some other
+     * entries fail due to INVALID_ARGUMENT or PERMISSION_DENIED errors. If any
+     * entry is not written, then the response status is the error associated
+     * with one of the failed entries and the response includes error details
+     * keyed by the entries' zero-based index in the `entries.write` method.
+     * 
+ * + * bool partial_success = 5; + */ + public Builder clearPartialSuccess() { + + partialSuccess_ = false; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.logging.v2.WriteLogEntriesRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.WriteLogEntriesRequest) + private static final com.google.logging.v2.WriteLogEntriesRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.logging.v2.WriteLogEntriesRequest(); + } + + public static com.google.logging.v2.WriteLogEntriesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public WriteLogEntriesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new WriteLogEntriesRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.logging.v2.WriteLogEntriesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesRequestOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesRequestOrBuilder.java new file mode 100644 index 000000000000..d2b0aa6a6718 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesRequestOrBuilder.java @@ -0,0 +1,298 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging.proto + +package com.google.logging.v2; + +public interface WriteLogEntriesRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.WriteLogEntriesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Optional. A default log resource name that is assigned to all log entries
+   * in `entries` that do not specify a value for `log_name`:
+   *     "projects/[PROJECT_ID]/logs/[LOG_ID]"
+   *     "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
+   *     "folders/[FOLDER_ID]/logs/[LOG_ID]"
+   * `[LOG_ID]` must be URL-encoded. For example,
+   * `"projects/my-project-id/logs/syslog"` or
+   * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+   * For more information about log names, see
+   * [LogEntry][google.logging.v2.LogEntry].
+   * 
+ * + * string log_name = 1; + */ + java.lang.String getLogName(); + /** + *
+   * Optional. A default log resource name that is assigned to all log entries
+   * in `entries` that do not specify a value for `log_name`:
+   *     "projects/[PROJECT_ID]/logs/[LOG_ID]"
+   *     "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
+   *     "folders/[FOLDER_ID]/logs/[LOG_ID]"
+   * `[LOG_ID]` must be URL-encoded. For example,
+   * `"projects/my-project-id/logs/syslog"` or
+   * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+   * For more information about log names, see
+   * [LogEntry][google.logging.v2.LogEntry].
+   * 
+ * + * string log_name = 1; + */ + com.google.protobuf.ByteString + getLogNameBytes(); + + /** + *
+   * Optional. A default monitored resource object that is assigned to all log
+   * entries in `entries` that do not specify a value for `resource`. Example:
+   *     { "type": "gce_instance",
+   *       "labels": {
+   *         "zone": "us-central1-a", "instance_id": "00000000000000000000" }}
+   * See [LogEntry][google.logging.v2.LogEntry].
+   * 
+ * + * .google.api.MonitoredResource resource = 2; + */ + boolean hasResource(); + /** + *
+   * Optional. A default monitored resource object that is assigned to all log
+   * entries in `entries` that do not specify a value for `resource`. Example:
+   *     { "type": "gce_instance",
+   *       "labels": {
+   *         "zone": "us-central1-a", "instance_id": "00000000000000000000" }}
+   * See [LogEntry][google.logging.v2.LogEntry].
+   * 
+ * + * .google.api.MonitoredResource resource = 2; + */ + com.google.api.MonitoredResource getResource(); + /** + *
+   * Optional. A default monitored resource object that is assigned to all log
+   * entries in `entries` that do not specify a value for `resource`. Example:
+   *     { "type": "gce_instance",
+   *       "labels": {
+   *         "zone": "us-central1-a", "instance_id": "00000000000000000000" }}
+   * See [LogEntry][google.logging.v2.LogEntry].
+   * 
+ * + * .google.api.MonitoredResource resource = 2; + */ + com.google.api.MonitoredResourceOrBuilder getResourceOrBuilder(); + + /** + *
+   * Optional. Default labels that are added to the `labels` field of all log
+   * entries in `entries`. If a log entry already has a label with the same key
+   * as a label in this parameter, then the log entry's label is not changed.
+   * See [LogEntry][google.logging.v2.LogEntry].
+   * 
+ * + * map<string, string> labels = 3; + */ + int getLabelsCount(); + /** + *
+   * Optional. Default labels that are added to the `labels` field of all log
+   * entries in `entries`. If a log entry already has a label with the same key
+   * as a label in this parameter, then the log entry's label is not changed.
+   * See [LogEntry][google.logging.v2.LogEntry].
+   * 
+ * + * map<string, string> labels = 3; + */ + boolean containsLabels( + java.lang.String key); + /** + * Use {@link #getLabelsMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getLabels(); + /** + *
+   * Optional. Default labels that are added to the `labels` field of all log
+   * entries in `entries`. If a log entry already has a label with the same key
+   * as a label in this parameter, then the log entry's label is not changed.
+   * See [LogEntry][google.logging.v2.LogEntry].
+   * 
+ * + * map<string, string> labels = 3; + */ + java.util.Map + getLabelsMap(); + /** + *
+   * Optional. Default labels that are added to the `labels` field of all log
+   * entries in `entries`. If a log entry already has a label with the same key
+   * as a label in this parameter, then the log entry's label is not changed.
+   * See [LogEntry][google.logging.v2.LogEntry].
+   * 
+ * + * map<string, string> labels = 3; + */ + + java.lang.String getLabelsOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + *
+   * Optional. Default labels that are added to the `labels` field of all log
+   * entries in `entries`. If a log entry already has a label with the same key
+   * as a label in this parameter, then the log entry's label is not changed.
+   * See [LogEntry][google.logging.v2.LogEntry].
+   * 
+ * + * map<string, string> labels = 3; + */ + + java.lang.String getLabelsOrThrow( + java.lang.String key); + + /** + *
+   * Required. The log entries to send to Stackdriver Logging. The order of log
+   * entries in this list does not matter. Values supplied in this method's
+   * `log_name`, `resource`, and `labels` fields are copied into those log
+   * entries in this list that do not include values for their corresponding
+   * fields. For more information, see the [LogEntry][google.logging.v2.LogEntry] type.
+   * If the `timestamp` or `insert_id` fields are missing in log entries, then
+   * this method supplies the current time or a unique identifier, respectively.
+   * The supplied values are chosen so that, among the log entries that did not
+   * supply their own values, the entries earlier in the list will sort before
+   * the entries later in the list. See the `entries.list` method.
+   * Log entries with timestamps that are more than the
+   * [logs retention period](/logging/quota-policy) in the past or more than
+   * 24 hours in the future might be discarded. Discarding does not return
+   * an error.
+   * To improve throughput and to avoid exceeding the
+   * [quota limit](/logging/quota-policy) for calls to `entries.write`,
+   * you should try to include several log entries in this list,
+   * rather than calling this method for each individual log entry.
+   * 
+ * + * repeated .google.logging.v2.LogEntry entries = 4; + */ + java.util.List + getEntriesList(); + /** + *
+   * Required. The log entries to send to Stackdriver Logging. The order of log
+   * entries in this list does not matter. Values supplied in this method's
+   * `log_name`, `resource`, and `labels` fields are copied into those log
+   * entries in this list that do not include values for their corresponding
+   * fields. For more information, see the [LogEntry][google.logging.v2.LogEntry] type.
+   * If the `timestamp` or `insert_id` fields are missing in log entries, then
+   * this method supplies the current time or a unique identifier, respectively.
+   * The supplied values are chosen so that, among the log entries that did not
+   * supply their own values, the entries earlier in the list will sort before
+   * the entries later in the list. See the `entries.list` method.
+   * Log entries with timestamps that are more than the
+   * [logs retention period](/logging/quota-policy) in the past or more than
+   * 24 hours in the future might be discarded. Discarding does not return
+   * an error.
+   * To improve throughput and to avoid exceeding the
+   * [quota limit](/logging/quota-policy) for calls to `entries.write`,
+   * you should try to include several log entries in this list,
+   * rather than calling this method for each individual log entry.
+   * 
+ * + * repeated .google.logging.v2.LogEntry entries = 4; + */ + com.google.logging.v2.LogEntry getEntries(int index); + /** + *
+   * Required. The log entries to send to Stackdriver Logging. The order of log
+   * entries in this list does not matter. Values supplied in this method's
+   * `log_name`, `resource`, and `labels` fields are copied into those log
+   * entries in this list that do not include values for their corresponding
+   * fields. For more information, see the [LogEntry][google.logging.v2.LogEntry] type.
+   * If the `timestamp` or `insert_id` fields are missing in log entries, then
+   * this method supplies the current time or a unique identifier, respectively.
+   * The supplied values are chosen so that, among the log entries that did not
+   * supply their own values, the entries earlier in the list will sort before
+   * the entries later in the list. See the `entries.list` method.
+   * Log entries with timestamps that are more than the
+   * [logs retention period](/logging/quota-policy) in the past or more than
+   * 24 hours in the future might be discarded. Discarding does not return
+   * an error.
+   * To improve throughput and to avoid exceeding the
+   * [quota limit](/logging/quota-policy) for calls to `entries.write`,
+   * you should try to include several log entries in this list,
+   * rather than calling this method for each individual log entry.
+   * 
+ * + * repeated .google.logging.v2.LogEntry entries = 4; + */ + int getEntriesCount(); + /** + *
+   * Required. The log entries to send to Stackdriver Logging. The order of log
+   * entries in this list does not matter. Values supplied in this method's
+   * `log_name`, `resource`, and `labels` fields are copied into those log
+   * entries in this list that do not include values for their corresponding
+   * fields. For more information, see the [LogEntry][google.logging.v2.LogEntry] type.
+   * If the `timestamp` or `insert_id` fields are missing in log entries, then
+   * this method supplies the current time or a unique identifier, respectively.
+   * The supplied values are chosen so that, among the log entries that did not
+   * supply their own values, the entries earlier in the list will sort before
+   * the entries later in the list. See the `entries.list` method.
+   * Log entries with timestamps that are more than the
+   * [logs retention period](/logging/quota-policy) in the past or more than
+   * 24 hours in the future might be discarded. Discarding does not return
+   * an error.
+   * To improve throughput and to avoid exceeding the
+   * [quota limit](/logging/quota-policy) for calls to `entries.write`,
+   * you should try to include several log entries in this list,
+   * rather than calling this method for each individual log entry.
+   * 
+ * + * repeated .google.logging.v2.LogEntry entries = 4; + */ + java.util.List + getEntriesOrBuilderList(); + /** + *
+   * Required. The log entries to send to Stackdriver Logging. The order of log
+   * entries in this list does not matter. Values supplied in this method's
+   * `log_name`, `resource`, and `labels` fields are copied into those log
+   * entries in this list that do not include values for their corresponding
+   * fields. For more information, see the [LogEntry][google.logging.v2.LogEntry] type.
+   * If the `timestamp` or `insert_id` fields are missing in log entries, then
+   * this method supplies the current time or a unique identifier, respectively.
+   * The supplied values are chosen so that, among the log entries that did not
+   * supply their own values, the entries earlier in the list will sort before
+   * the entries later in the list. See the `entries.list` method.
+   * Log entries with timestamps that are more than the
+   * [logs retention period](/logging/quota-policy) in the past or more than
+   * 24 hours in the future might be discarded. Discarding does not return
+   * an error.
+   * To improve throughput and to avoid exceeding the
+   * [quota limit](/logging/quota-policy) for calls to `entries.write`,
+   * you should try to include several log entries in this list,
+   * rather than calling this method for each individual log entry.
+   * 
+ * + * repeated .google.logging.v2.LogEntry entries = 4; + */ + com.google.logging.v2.LogEntryOrBuilder getEntriesOrBuilder( + int index); + + /** + *
+   * Optional. Whether valid entries should be written even if some other
+   * entries fail due to INVALID_ARGUMENT or PERMISSION_DENIED errors. If any
+   * entry is not written, then the response status is the error associated
+   * with one of the failed entries and the response includes error details
+   * keyed by the entries' zero-based index in the `entries.write` method.
+   * 
+ * + * bool partial_success = 5; + */ + boolean getPartialSuccess(); +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesResponse.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesResponse.java new file mode 100644 index 000000000000..194929fd923c --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesResponse.java @@ -0,0 +1,398 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging.proto + +package com.google.logging.v2; + +/** + *
+ * Result returned from WriteLogEntries.
+ * empty
+ * 
+ * + * Protobuf type {@code google.logging.v2.WriteLogEntriesResponse} + */ +public final class WriteLogEntriesResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.logging.v2.WriteLogEntriesResponse) + WriteLogEntriesResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use WriteLogEntriesResponse.newBuilder() to construct. + private WriteLogEntriesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private WriteLogEntriesResponse() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private WriteLogEntriesResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_WriteLogEntriesResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_WriteLogEntriesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.WriteLogEntriesResponse.class, com.google.logging.v2.WriteLogEntriesResponse.Builder.class); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.logging.v2.WriteLogEntriesResponse)) { + return super.equals(obj); + } + com.google.logging.v2.WriteLogEntriesResponse other = (com.google.logging.v2.WriteLogEntriesResponse) obj; + + boolean result = true; + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.WriteLogEntriesResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.WriteLogEntriesResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.WriteLogEntriesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.WriteLogEntriesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.WriteLogEntriesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.logging.v2.WriteLogEntriesResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.logging.v2.WriteLogEntriesResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.WriteLogEntriesResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.WriteLogEntriesResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.logging.v2.WriteLogEntriesResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.logging.v2.WriteLogEntriesResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.logging.v2.WriteLogEntriesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.logging.v2.WriteLogEntriesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Result returned from WriteLogEntries.
+   * empty
+   * 
+ * + * Protobuf type {@code google.logging.v2.WriteLogEntriesResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.WriteLogEntriesResponse) + com.google.logging.v2.WriteLogEntriesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_WriteLogEntriesResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_WriteLogEntriesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.WriteLogEntriesResponse.class, com.google.logging.v2.WriteLogEntriesResponse.Builder.class); + } + + // Construct using com.google.logging.v2.WriteLogEntriesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_WriteLogEntriesResponse_descriptor; + } + + public com.google.logging.v2.WriteLogEntriesResponse getDefaultInstanceForType() { + return com.google.logging.v2.WriteLogEntriesResponse.getDefaultInstance(); + } + + public com.google.logging.v2.WriteLogEntriesResponse build() { + com.google.logging.v2.WriteLogEntriesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.logging.v2.WriteLogEntriesResponse buildPartial() { + com.google.logging.v2.WriteLogEntriesResponse result = new com.google.logging.v2.WriteLogEntriesResponse(this); + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.logging.v2.WriteLogEntriesResponse) { + return mergeFrom((com.google.logging.v2.WriteLogEntriesResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.WriteLogEntriesResponse other) { + if (other == com.google.logging.v2.WriteLogEntriesResponse.getDefaultInstance()) return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.logging.v2.WriteLogEntriesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.logging.v2.WriteLogEntriesResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.logging.v2.WriteLogEntriesResponse) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.WriteLogEntriesResponse) + private static final com.google.logging.v2.WriteLogEntriesResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.logging.v2.WriteLogEntriesResponse(); + } + + public static com.google.logging.v2.WriteLogEntriesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public WriteLogEntriesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new WriteLogEntriesResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.logging.v2.WriteLogEntriesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesResponseOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesResponseOrBuilder.java new file mode 100644 index 000000000000..f034c806d8a3 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesResponseOrBuilder.java @@ -0,0 +1,9 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging.proto + +package com.google.logging.v2; + +public interface WriteLogEntriesResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.WriteLogEntriesResponse) + com.google.protobuf.MessageOrBuilder { +} diff --git a/proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/log_entry.proto b/proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/log_entry.proto new file mode 100644 index 000000000000..4a52bbc83691 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/log_entry.proto @@ -0,0 +1,176 @@ +// Copyright 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.logging.v2; + +import "google/api/annotations.proto"; +import "google/api/monitored_resource.proto"; +import "google/logging/type/http_request.proto"; +import "google/logging/type/log_severity.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Logging.V2"; +option go_package = "google.golang.org/genproto/googleapis/logging/v2;logging"; +option java_multiple_files = true; +option java_outer_classname = "LogEntryProto"; +option java_package = "com.google.logging.v2"; +option php_namespace = "Google\\Cloud\\Logging\\V2"; + + +// An individual entry in a log. +message LogEntry { + // Required. The resource name of the log to which this log entry belongs: + // + // "projects/[PROJECT_ID]/logs/[LOG_ID]" + // "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" + // "folders/[FOLDER_ID]/logs/[LOG_ID]" + // + // A project number may optionally be used in place of PROJECT_ID. The + // project number is translated to its corresponding PROJECT_ID internally + // and the `log_name` field will contain PROJECT_ID in queries and exports. + // + // `[LOG_ID]` must be URL-encoded within `log_name`. Example: + // `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`. + // `[LOG_ID]` must be less than 512 characters long and can only include the + // following characters: upper and lower case alphanumeric characters, + // forward-slash, underscore, hyphen, and period. + // + // For backward compatibility, if `log_name` begins with a forward-slash, such + // as `/projects/...`, then the log entry is ingested as usual but the + // forward-slash is removed. Listing the log entry will not show the leading + // slash and filtering for a log name with a leading slash will never return + // any results. + string log_name = 12; + + // Required. The monitored resource associated with this log entry. + // Example: a log entry that reports a database error would be + // associated with the monitored resource designating the particular + // database that reported the error. + google.api.MonitoredResource resource = 8; + + // Optional. The log entry payload, which can be one of multiple types. + oneof payload { + // The log entry payload, represented as a protocol buffer. Some + // Google Cloud Platform services use this field for their log + // entry payloads. + google.protobuf.Any proto_payload = 2; + + // The log entry payload, represented as a Unicode string (UTF-8). + string text_payload = 3; + + // The log entry payload, represented as a structure that is + // expressed as a JSON object. + google.protobuf.Struct json_payload = 6; + } + + // Optional. The time the event described by the log entry occurred. + // This time is used to compute the log entry's age and to enforce + // the logs retention period. If this field is omitted in a new log + // entry, then Stackdriver Logging assigns it the current time. + // + // Incoming log entries should have timestamps that are no more than + // the [logs retention period](/logging/quota-policy) in the past, + // and no more than 24 hours in the future. + // See the `entries.write` API method for more information. + google.protobuf.Timestamp timestamp = 9; + + // Output only. The time the log entry was received by Stackdriver Logging. + google.protobuf.Timestamp receive_timestamp = 24; + + // Optional. The severity of the log entry. The default value is + // `LogSeverity.DEFAULT`. + google.logging.type.LogSeverity severity = 10; + + // Optional. A unique identifier for the log entry. If you provide a value, + // then Stackdriver Logging considers other log entries in the same project, + // with the same `timestamp`, and with the same `insert_id` to be duplicates + // which can be removed. If omitted in new log entries, then Stackdriver + // Logging assigns its own unique identifier. The `insert_id` is also used + // to order log entries that have the same `timestamp` value. + string insert_id = 4; + + // Optional. Information about the HTTP request associated with this + // log entry, if applicable. + google.logging.type.HttpRequest http_request = 7; + + // Optional. A set of user-defined (key, value) data that provides additional + // information about the log entry. + map labels = 11; + + // Optional. Information about an operation associated with the log entry, if + // applicable. + LogEntryOperation operation = 15; + + // Optional. Resource name of the trace associated with the log entry, if any. + // If it contains a relative resource name, the name is assumed to be relative + // to `//tracing.googleapis.com`. Example: + // `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824` + string trace = 22; + + // Optional. Id of the span within the trace associated with the log entry. + // e.g. "0000000000000042" + // For Stackdriver trace spans, this is the same format that the Stackdriver + // trace API uses. + // The ID is a 16-character hexadecimal encoding of an 8-byte array. + string span_id = 27; + + // Optional. Source code location information associated with the log entry, + // if any. + LogEntrySourceLocation source_location = 23; +} + +// Additional information about a potentially long-running operation with which +// a log entry is associated. +message LogEntryOperation { + // Optional. An arbitrary operation identifier. Log entries with the + // same identifier are assumed to be part of the same operation. + string id = 1; + + // Optional. An arbitrary producer identifier. The combination of + // `id` and `producer` must be globally unique. Examples for `producer`: + // `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`. + string producer = 2; + + // Optional. Set this to True if this is the first log entry in the operation. + bool first = 3; + + // Optional. Set this to True if this is the last log entry in the operation. + bool last = 4; +} + +// Additional information about the source code location that produced the log +// entry. +message LogEntrySourceLocation { + // Optional. Source file name. Depending on the runtime environment, this + // might be a simple name or a fully-qualified name. + string file = 1; + + // Optional. Line within the source file. 1-based; 0 indicates no line number + // available. + int64 line = 2; + + // Optional. Human-readable name of the function or method being invoked, with + // optional context such as the class or package name. This information may be + // used in contexts such as the logs viewer, where a file and line number are + // less meaningful. The format can vary by language. For example: + // `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function` + // (Python). + string function = 3; +} 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 new file mode 100644 index 000000000000..a9b4e9306f3f --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/logging.proto @@ -0,0 +1,302 @@ +// Copyright 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.logging.v2; + +import "google/api/annotations.proto"; +import "google/api/monitored_resource.proto"; +import "google/logging/v2/log_entry.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Logging.V2"; +option go_package = "google.golang.org/genproto/googleapis/logging/v2;logging"; +option java_multiple_files = true; +option java_outer_classname = "LoggingProto"; +option java_package = "com.google.logging.v2"; +option php_namespace = "Google\\Cloud\\Logging\\V2"; + + +// Service for ingesting and querying logs. +service LoggingServiceV2 { + // Deletes all the log entries in a log. + // The log reappears if it receives new entries. + // Log entries written shortly before the delete operation might not be + // deleted. + rpc DeleteLog(DeleteLogRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { delete: "/v2beta1/{log_name=projects/*/logs/*}" }; + } + + // ## Log entry resources + // + // Writes log entries to Stackdriver Logging. This API method is the + // only way to send log entries to Stackdriver Logging. This method + // is used, directly or indirectly, by the Stackdriver Logging agent + // (fluentd) and all logging libraries configured to use Stackdriver + // Logging. + rpc WriteLogEntries(WriteLogEntriesRequest) returns (WriteLogEntriesResponse) { + option (google.api.http) = { post: "/v2/entries:write" body: "*" }; + } + + // Lists log entries. Use this method to retrieve log entries from + // Stackdriver Logging. For ways to export log entries, see + // [Exporting Logs](/logging/docs/export). + rpc ListLogEntries(ListLogEntriesRequest) returns (ListLogEntriesResponse) { + option (google.api.http) = { post: "/v2/entries:list" body: "*" }; + } + + // Lists the descriptors for monitored resource types used by Stackdriver + // Logging. + rpc ListMonitoredResourceDescriptors(ListMonitoredResourceDescriptorsRequest) returns (ListMonitoredResourceDescriptorsResponse) { + option (google.api.http) = { get: "/v2/monitoredResourceDescriptors" }; + } + + // Lists the logs in projects, organizations, folders, or billing accounts. + // Only logs that have entries are listed. + rpc ListLogs(ListLogsRequest) returns (ListLogsResponse) { + option (google.api.http) = { get: "/v2/{parent=*/*}/logs" }; + } +} + +// The parameters to DeleteLog. +message DeleteLogRequest { + // Required. The resource name of the log to delete: + // + // "projects/[PROJECT_ID]/logs/[LOG_ID]" + // "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" + // "folders/[FOLDER_ID]/logs/[LOG_ID]" + // + // `[LOG_ID]` must be URL-encoded. For example, + // `"projects/my-project-id/logs/syslog"`, + // `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`. + // For more information about log names, see + // [LogEntry][google.logging.v2.LogEntry]. + string log_name = 1; +} + +// The parameters to WriteLogEntries. +message WriteLogEntriesRequest { + // Optional. A default log resource name that is assigned to all log entries + // in `entries` that do not specify a value for `log_name`: + // + // "projects/[PROJECT_ID]/logs/[LOG_ID]" + // "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" + // "folders/[FOLDER_ID]/logs/[LOG_ID]" + // + // `[LOG_ID]` must be URL-encoded. For example, + // `"projects/my-project-id/logs/syslog"` or + // `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`. + // For more information about log names, see + // [LogEntry][google.logging.v2.LogEntry]. + string log_name = 1; + + // Optional. A default monitored resource object that is assigned to all log + // entries in `entries` that do not specify a value for `resource`. Example: + // + // { "type": "gce_instance", + // "labels": { + // "zone": "us-central1-a", "instance_id": "00000000000000000000" }} + // + // See [LogEntry][google.logging.v2.LogEntry]. + google.api.MonitoredResource resource = 2; + + // Optional. Default labels that are added to the `labels` field of all log + // entries in `entries`. If a log entry already has a label with the same key + // as a label in this parameter, then the log entry's label is not changed. + // See [LogEntry][google.logging.v2.LogEntry]. + map labels = 3; + + // Required. The log entries to send to Stackdriver Logging. The order of log + // entries in this list does not matter. Values supplied in this method's + // `log_name`, `resource`, and `labels` fields are copied into those log + // entries in this list that do not include values for their corresponding + // fields. For more information, see the [LogEntry][google.logging.v2.LogEntry] type. + // + // If the `timestamp` or `insert_id` fields are missing in log entries, then + // this method supplies the current time or a unique identifier, respectively. + // The supplied values are chosen so that, among the log entries that did not + // supply their own values, the entries earlier in the list will sort before + // the entries later in the list. See the `entries.list` method. + // + // Log entries with timestamps that are more than the + // [logs retention period](/logging/quota-policy) in the past or more than + // 24 hours in the future might be discarded. Discarding does not return + // an error. + // + // To improve throughput and to avoid exceeding the + // [quota limit](/logging/quota-policy) for calls to `entries.write`, + // you should try to include several log entries in this list, + // rather than calling this method for each individual log entry. + repeated LogEntry entries = 4; + + // Optional. Whether valid entries should be written even if some other + // entries fail due to INVALID_ARGUMENT or PERMISSION_DENIED errors. If any + // entry is not written, then the response status is the error associated + // with one of the failed entries and the response includes error details + // keyed by the entries' zero-based index in the `entries.write` method. + bool partial_success = 5; +} + +// Result returned from WriteLogEntries. +// empty +message WriteLogEntriesResponse { + +} + +// Error details for WriteLogEntries with partial success. +message WriteLogEntriesPartialErrors { + // When `WriteLogEntriesRequest.partial_success` is true, records the error + // status for entries that were not written due to a permanent error, keyed + // by the entry's zero-based index in `WriteLogEntriesRequest.entries`. + // + // Failed requests for which no entries are written will not include + // per-entry errors. + map log_entry_errors = 1; +} + +// The parameters to `ListLogEntries`. +message ListLogEntriesRequest { + // Deprecated. Use `resource_names` instead. One or more project identifiers + // or project numbers from which to retrieve log entries. Example: + // `"my-project-1A"`. If present, these project identifiers are converted to + // resource name format and added to the list of resources in + // `resource_names`. + repeated string project_ids = 1; + + // Required. Names of one or more parent resources from which to + // retrieve log entries: + // + // "projects/[PROJECT_ID]" + // "organizations/[ORGANIZATION_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]" + // "folders/[FOLDER_ID]" + // + // Projects listed in the `project_ids` field are added to this list. + repeated string resource_names = 8; + + // Optional. A filter that chooses which log entries to return. See [Advanced + // Logs Filters](/logging/docs/view/advanced_filters). Only log entries that + // match the filter are returned. An empty filter matches all log entries in + // the resources listed in `resource_names`. Referencing a parent resource + // that is not listed in `resource_names` will cause the filter to return no + // results. + // The maximum length of the filter is 20000 characters. + string filter = 2; + + // Optional. How the results should be sorted. Presently, the only permitted + // values are `"timestamp asc"` (default) and `"timestamp desc"`. The first + // option returns entries in order of increasing values of + // `LogEntry.timestamp` (oldest first), and the second option returns entries + // in order of decreasing timestamps (newest first). Entries with equal + // timestamps are returned in order of their `insert_id` values. + string order_by = 3; + + // Optional. The maximum number of results to return from this request. + // Non-positive values are ignored. The presence of `next_page_token` in the + // response indicates that more results might be available. + int32 page_size = 4; + + // Optional. If present, then retrieve the next batch of results from the + // preceding call to this method. `page_token` must be the value of + // `next_page_token` from the previous response. The values of other method + // parameters should be identical to those in the previous call. + string page_token = 5; +} + +// Result returned from `ListLogEntries`. +message ListLogEntriesResponse { + // A list of log entries. If `entries` is empty, `nextPageToken` may still be + // returned, indicating that more entries may exist. See `nextPageToken` for + // more information. + repeated LogEntry entries = 1; + + // If there might be more results than those appearing in this response, then + // `nextPageToken` is included. To get the next set of results, call this + // method again using the value of `nextPageToken` as `pageToken`. + // + // If a value for `next_page_token` appears and the `entries` field is empty, + // it means that the search found no log entries so far but it did not have + // time to search all the possible log entries. Retry the method with this + // value for `page_token` to continue the search. Alternatively, consider + // speeding up the search by changing your filter to specify a single log name + // or resource type, or to narrow the time range of the search. + string next_page_token = 2; +} + +// The parameters to ListMonitoredResourceDescriptors +message ListMonitoredResourceDescriptorsRequest { + // Optional. The maximum number of results to return from this request. + // Non-positive values are ignored. The presence of `nextPageToken` in the + // response indicates that more results might be available. + int32 page_size = 1; + + // Optional. If present, then retrieve the next batch of results from the + // preceding call to this method. `pageToken` must be the value of + // `nextPageToken` from the previous response. The values of other method + // parameters should be identical to those in the previous call. + string page_token = 2; +} + +// Result returned from ListMonitoredResourceDescriptors. +message ListMonitoredResourceDescriptorsResponse { + // A list of resource descriptors. + repeated google.api.MonitoredResourceDescriptor resource_descriptors = 1; + + // If there might be more results than those appearing in this response, then + // `nextPageToken` is included. To get the next set of results, call this + // method again using the value of `nextPageToken` as `pageToken`. + string next_page_token = 2; +} + +// The parameters to ListLogs. +message ListLogsRequest { + // Required. The resource name that owns the logs: + // + // "projects/[PROJECT_ID]" + // "organizations/[ORGANIZATION_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]" + // "folders/[FOLDER_ID]" + string parent = 1; + + // Optional. The maximum number of results to return from this request. + // Non-positive values are ignored. The presence of `nextPageToken` in the + // response indicates that more results might be available. + int32 page_size = 2; + + // Optional. If present, then retrieve the next batch of results from the + // preceding call to this method. `pageToken` must be the value of + // `nextPageToken` from the previous response. The values of other method + // parameters should be identical to those in the previous call. + string page_token = 3; +} + +// Result returned from ListLogs. +message ListLogsResponse { + // A list of log names. For example, + // `"projects/my-project/syslog"` or + // `"organizations/123/cloudresourcemanager.googleapis.com%2Factivity"`. + repeated string log_names = 3; + + // If there might be more results than those appearing in this response, then + // `nextPageToken` is included. To get the next set of results, call this + // method again using the value of `nextPageToken` as `pageToken`. + string next_page_token = 2; +} diff --git a/proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/logging_config.proto b/proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/logging_config.proto new file mode 100644 index 000000000000..10095ef096df --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/logging_config.proto @@ -0,0 +1,456 @@ +// Copyright 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.logging.v2; + +import "google/api/annotations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Logging.V2"; +option go_package = "google.golang.org/genproto/googleapis/logging/v2;logging"; +option java_multiple_files = true; +option java_outer_classname = "LoggingConfigProto"; +option java_package = "com.google.logging.v2"; +option php_namespace = "Google\\Cloud\\Logging\\V2"; + + +// Service for configuring sinks used to export log entries outside of +// Stackdriver Logging. +service ConfigServiceV2 { + // Lists sinks. + rpc ListSinks(ListSinksRequest) returns (ListSinksResponse) { + option (google.api.http) = { get: "/v2/{parent=*/*}/sinks" }; + } + + // Gets a sink. + rpc GetSink(GetSinkRequest) returns (LogSink) { + option (google.api.http) = { get: "/v2/{sink_name=*/*/sinks/*}" }; + } + + // Creates a sink that exports specified log entries to a destination. The + // export of newly-ingested log entries begins immediately, unless the sink's + // `writer_identity` is not permitted to write to the destination. A sink can + // export log entries only from the resource owning the sink. + rpc CreateSink(CreateSinkRequest) returns (LogSink) { + option (google.api.http) = { post: "/v2/{parent=*/*}/sinks" body: "sink" }; + } + + // Updates a sink. This method replaces the following fields in the existing + // sink with values from the new sink: `destination`, and `filter`. + // The updated sink might also have a new `writer_identity`; see the + // `unique_writer_identity` field. + rpc UpdateSink(UpdateSinkRequest) returns (LogSink) { + option (google.api.http) = { put: "/v2/{sink_name=*/*/sinks/*}" body: "sink" }; + } + + // Deletes a sink. If the sink has a unique `writer_identity`, then that + // service account is also deleted. + rpc DeleteSink(DeleteSinkRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { delete: "/v2/{sink_name=*/*/sinks/*}" }; + } + + // Lists all the exclusions in a parent resource. + rpc ListExclusions(ListExclusionsRequest) returns (ListExclusionsResponse) { + option (google.api.http) = { get: "/v2/{parent=*/*}/exclusions" }; + } + + // Gets the description of an exclusion. + rpc GetExclusion(GetExclusionRequest) returns (LogExclusion) { + option (google.api.http) = { get: "/v2/{name=*/*/exclusions/*}" }; + } + + // Creates a new exclusion in a specified parent resource. + // Only log entries belonging to that resource can be excluded. + // You can have up to 10 exclusions in a resource. + rpc CreateExclusion(CreateExclusionRequest) returns (LogExclusion) { + option (google.api.http) = { post: "/v2/{parent=*/*}/exclusions" body: "exclusion" }; + } + + // Changes one or more properties of an existing exclusion. + rpc UpdateExclusion(UpdateExclusionRequest) returns (LogExclusion) { + option (google.api.http) = { patch: "/v2/{name=*/*/exclusions/*}" body: "exclusion" }; + } + + // Deletes an exclusion. + rpc DeleteExclusion(DeleteExclusionRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { delete: "/v2/{name=*/*/exclusions/*}" }; + } +} + +// Describes a sink used to export log entries to one of the following +// destinations in any project: a Cloud Storage bucket, a BigQuery dataset, or a +// Cloud Pub/Sub topic. A logs filter controls which log entries are +// exported. The sink must be created within a project, organization, billing +// account, or folder. +message LogSink { + // Available log entry formats. Log entries can be written to Stackdriver + // Logging in either format and can be exported in either format. + // Version 2 is the preferred format. + enum VersionFormat { + // An unspecified format version that will default to V2. + VERSION_FORMAT_UNSPECIFIED = 0; + + // `LogEntry` version 2 format. + V2 = 1; + + // `LogEntry` version 1 format. + V1 = 2; + } + + // Required. The client-assigned sink identifier, unique within the + // project. Example: `"my-syslog-errors-to-pubsub"`. Sink identifiers are + // limited to 100 characters and can include only the following characters: + // upper and lower-case alphanumeric characters, underscores, hyphens, and + // periods. + string name = 1; + + // Required. The export destination: + // + // "storage.googleapis.com/[GCS_BUCKET]" + // "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]" + // "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]" + // + // The sink's `writer_identity`, set when the sink is created, must + // have permission to write to the destination or else the log + // entries are not exported. For more information, see + // [Exporting Logs With Sinks](/logging/docs/api/tasks/exporting-logs). + string destination = 3; + + // Optional. + // An [advanced logs filter](/logging/docs/view/advanced_filters). The only + // exported log entries are those that are in the resource owning the sink and + // that match the filter. For example: + // + // logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR + string filter = 5; + + // Deprecated. The log entry format to use for this sink's exported log + // entries. The v2 format is used by default and cannot be changed. + VersionFormat output_version_format = 6; + + // Output only. An IAM identity—a service account or group—under + // which Stackdriver Logging writes the exported log entries to the sink's + // destination. This field is set by + // [sinks.create](/logging/docs/api/reference/rest/v2/projects.sinks/create) + // and + // [sinks.update](/logging/docs/api/reference/rest/v2/projects.sinks/update), + // based on the setting of `unique_writer_identity` in those methods. + // + // Until you grant this identity write-access to the destination, log entry + // exports from this sink will fail. For more information, + // see [Granting access for a + // resource](/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource). + // Consult the destination service's documentation to determine the + // appropriate IAM roles to assign to the identity. + string writer_identity = 8; + + // Optional. This field applies only to sinks owned by organizations and + // folders. If the field is false, the default, only the logs owned by the + // sink's parent resource are available for export. If the field is true, then + // logs from all the projects, folders, and billing accounts contained in the + // sink's parent resource are also available for export. Whether a particular + // log entry from the children is exported depends on the sink's filter + // expression. For example, if this field is true, then the filter + // `resource.type=gce_instance` would export all Compute Engine VM instance + // log entries from all projects in the sink's parent. To only export entries + // from certain child projects, filter on the project part of the log name: + // + // logName:("projects/test-project1/" OR "projects/test-project2/") AND + // resource.type=gce_instance + bool include_children = 9; + + // Deprecated. This field is ignored when creating or updating sinks. + google.protobuf.Timestamp start_time = 10; + + // Deprecated. This field is ignored when creating or updating sinks. + google.protobuf.Timestamp end_time = 11; +} + +// The parameters to `ListSinks`. +message ListSinksRequest { + // Required. The parent resource whose sinks are to be listed: + // + // "projects/[PROJECT_ID]" + // "organizations/[ORGANIZATION_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]" + // "folders/[FOLDER_ID]" + string parent = 1; + + // Optional. If present, then retrieve the next batch of results from the + // preceding call to this method. `pageToken` must be the value of + // `nextPageToken` from the previous response. The values of other method + // parameters should be identical to those in the previous call. + string page_token = 2; + + // Optional. The maximum number of results to return from this request. + // Non-positive values are ignored. The presence of `nextPageToken` in the + // response indicates that more results might be available. + int32 page_size = 3; +} + +// Result returned from `ListSinks`. +message ListSinksResponse { + // A list of sinks. + repeated LogSink sinks = 1; + + // If there might be more results than appear in this response, then + // `nextPageToken` is included. To get the next set of results, call the same + // method again using the value of `nextPageToken` as `pageToken`. + string next_page_token = 2; +} + +// The parameters to `GetSink`. +message GetSinkRequest { + // Required. The resource name of the sink: + // + // "projects/[PROJECT_ID]/sinks/[SINK_ID]" + // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + // "folders/[FOLDER_ID]/sinks/[SINK_ID]" + // + // Example: `"projects/my-project-id/sinks/my-sink-id"`. + string sink_name = 1; +} + +// The parameters to `CreateSink`. +message CreateSinkRequest { + // Required. The resource in which to create the sink: + // + // "projects/[PROJECT_ID]" + // "organizations/[ORGANIZATION_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]" + // "folders/[FOLDER_ID]" + // + // Examples: `"projects/my-logging-project"`, `"organizations/123456789"`. + string parent = 1; + + // Required. The new sink, whose `name` parameter is a sink identifier that + // is not already in use. + LogSink sink = 2; + + // Optional. Determines the kind of IAM identity returned as `writer_identity` + // in the new sink. If this value is omitted or set to false, and if the + // sink's parent is a project, then the value returned as `writer_identity` is + // the same group or service account used by Stackdriver Logging before the + // addition of writer identities to this API. The sink's destination must be + // in the same project as the sink itself. + // + // If this field is set to true, or if the sink is owned by a non-project + // resource such as an organization, then the value of `writer_identity` will + // be a unique service account used only for exports from the new sink. For + // more information, see `writer_identity` in [LogSink][google.logging.v2.LogSink]. + bool unique_writer_identity = 3; +} + +// The parameters to `UpdateSink`. +message UpdateSinkRequest { + // Required. The full resource name of the sink to update, including the + // parent resource and the sink identifier: + // + // "projects/[PROJECT_ID]/sinks/[SINK_ID]" + // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + // "folders/[FOLDER_ID]/sinks/[SINK_ID]" + // + // Example: `"projects/my-project-id/sinks/my-sink-id"`. + string sink_name = 1; + + // Required. The updated sink, whose name is the same identifier that appears + // as part of `sink_name`. + LogSink sink = 2; + + // Optional. See + // [sinks.create](/logging/docs/api/reference/rest/v2/projects.sinks/create) + // for a description of this field. When updating a sink, the effect of this + // field on the value of `writer_identity` in the updated sink depends on both + // the old and new values of this field: + // + // + If the old and new values of this field are both false or both true, + // then there is no change to the sink's `writer_identity`. + // + If the old value is false and the new value is true, then + // `writer_identity` is changed to a unique service account. + // + It is an error if the old value is true and the new value is + // set to false or defaulted to false. + bool unique_writer_identity = 3; + + // Optional. Field mask that specifies the fields in `sink` that need + // an update. A sink field will be overwritten if, and only if, it is + // in the update mask. `name` and output only fields cannot be updated. + // + // An empty updateMask is temporarily treated as using the following mask + // for backwards compatibility purposes: + // destination,filter,includeChildren + // At some point in the future, behavior will be removed and specifying an + // empty updateMask will be an error. + // + // For a detailed `FieldMask` definition, see + // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + // + // Example: `updateMask=filter`. + google.protobuf.FieldMask update_mask = 4; +} + +// The parameters to `DeleteSink`. +message DeleteSinkRequest { + // Required. The full resource name of the sink to delete, including the + // parent resource and the sink identifier: + // + // "projects/[PROJECT_ID]/sinks/[SINK_ID]" + // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + // "folders/[FOLDER_ID]/sinks/[SINK_ID]" + // + // Example: `"projects/my-project-id/sinks/my-sink-id"`. + string sink_name = 1; +} + +// Specifies a set of log entries that are not to be stored in Stackdriver +// Logging. If your project receives a large volume of logs, you might be able +// to use exclusions to reduce your chargeable logs. Exclusions are processed +// after log sinks, so you can export log entries before they are excluded. +// Audit log entries and log entries from Amazon Web Services are never +// excluded. +message LogExclusion { + // Required. A client-assigned identifier, such as + // `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and + // can include only letters, digits, underscores, hyphens, and periods. + string name = 1; + + // Optional. A description of this exclusion. + string description = 2; + + // Required. + // An [advanced logs filter](/logging/docs/view/advanced_filters) + // that matches the log entries to be excluded. By using the + // [sample function](/logging/docs/view/advanced_filters#sample), + // you can exclude less than 100% of the matching log entries. + // For example, the following filter matches 99% of low-severity log + // entries from load balancers: + // + // "resource.type=http_load_balancer severity=ERROR" + // + // The maximum length of the filter is 20000 characters. + string filter = 3; + + // Optional. The metric descriptor associated with the logs-based metric. + // If unspecified, it uses a default metric descriptor with a DELTA metric + // kind, INT64 value type, with no labels and a unit of "1". Such a metric + // counts the number of log entries matching the `filter` expression. + // + // The `name`, `type`, and `description` fields in the `metric_descriptor` + // are output only, and is constructed using the `name` and `description` + // field in the LogMetric. + // + // To create a logs-based metric that records a distribution of log values, a + // DELTA metric kind with a DISTRIBUTION value type must be used along with + // a `value_extractor` expression in the LogMetric. + // + // Each label in the metric descriptor must have a matching label + // name as the key and an extractor expression as the value in the + // `label_extractors` map. + // + // The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot + // be updated once initially configured. New labels can be added in the + // `metric_descriptor`, but existing labels cannot be modified except for + // their description. + google.api.MetricDescriptor metric_descriptor = 5; + + // Optional. A `value_extractor` is required when using a distribution + // logs-based metric to extract the values to record from a log entry. + // Two functions are supported for value extraction: `EXTRACT(field)` or + // `REGEXP_EXTRACT(field, regex)`. The argument are: + // 1. field: The name of the log entry field from which the value is to be + // extracted. + // 2. regex: A regular expression using the Google RE2 syntax + // (https://github.com/google/re2/wiki/Syntax) with a single capture + // group to extract data from the specified log entry field. The value + // of the field is converted to a string before applying the regex. + // It is an error to specify a regex that does not include exactly one + // capture group. + // + // The result of the extraction must be convertible to a double type, as the + // distribution always records double values. If either the extraction or + // the conversion to double fails, then those values are not recorded in the + // distribution. + // + // Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")` + string value_extractor = 6; + + // Optional. A map from a label key string to an extractor expression which is + // used to extract data from a log entry field and assign as the label value. + // Each label key specified in the LabelDescriptor must have an associated + // extractor expression in this map. The syntax of the extractor expression + // is the same as for the `value_extractor` field. + // + // The extracted value is converted to the type defined in the label + // descriptor. If the either the extraction or the type conversion fails, + // the label will have a default value. The default value for a string + // label is an empty string, for an integer label its 0, and for a boolean + // label its `false`. + // + // Note that there are upper bounds on the maximum number of labels and the + // number of active time series that are allowed in a project. + map label_extractors = 7; + + // Optional. The `bucket_options` are required when the logs-based metric is + // using a DISTRIBUTION value type and it describes the bucket boundaries + // used to create a histogram of the extracted values. + google.api.Distribution.BucketOptions bucket_options = 8; + + // Deprecated. The API version that created or updated this metric. + // The v2 format is used by default and cannot be changed. + ApiVersion version = 4; +} + +// The parameters to ListLogMetrics. +message ListLogMetricsRequest { + // Required. The name of the project containing the metrics: + // + // "projects/[PROJECT_ID]" + string parent = 1; + + // Optional. If present, then retrieve the next batch of results from the + // preceding call to this method. `pageToken` must be the value of + // `nextPageToken` from the previous response. The values of other method + // parameters should be identical to those in the previous call. + string page_token = 2; + + // Optional. The maximum number of results to return from this request. + // Non-positive values are ignored. The presence of `nextPageToken` in the + // response indicates that more results might be available. + int32 page_size = 3; +} + +// Result returned from ListLogMetrics. +message ListLogMetricsResponse { + // A list of logs-based metrics. + repeated LogMetric metrics = 1; + + // If there might be more results than appear in this response, then + // `nextPageToken` is included. To get the next set of results, call this + // method again using the value of `nextPageToken` as `pageToken`. + string next_page_token = 2; +} + +// The parameters to GetLogMetric. +message GetLogMetricRequest { + // The resource name of the desired metric: + // + // "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + string metric_name = 1; +} + +// The parameters to CreateLogMetric. +message CreateLogMetricRequest { + // The resource name of the project in which to create the metric: + // + // "projects/[PROJECT_ID]" + // + // The new metric must be provided in the request. + string parent = 1; + + // The new logs-based metric, which must not have an identifier that + // already exists. + LogMetric metric = 2; +} + +// The parameters to UpdateLogMetric. +message UpdateLogMetricRequest { + // The resource name of the metric to update: + // + // "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + // + // The updated metric must be provided in the request and it's + // `name` field must be the same as `[METRIC_ID]` If the metric + // does not exist in `[PROJECT_ID]`, then a new metric is created. + string metric_name = 1; + + // The updated metric. + LogMetric metric = 2; +} + +// The parameters to DeleteLogMetric. +message DeleteLogMetricRequest { + // The resource name of the metric to delete: + // + // "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + string metric_name = 1; +} From 276a58a23e8e7582f08dcbac18be180b65be0733 Mon Sep 17 00:00:00 2001 From: Michael Darakananda Date: Mon, 7 May 2018 17:06:46 -0700 Subject: [PATCH 0076/1629] Release 0.47.0/1.29.0 (#3239) Also fix javadoc --- google-cloud-contrib/google-cloud-logging-logback/README.md | 6 +++--- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/README.md b/google-cloud-contrib/google-cloud-logging-logback/README.md index 9152cf54b435..08d19e8885fe 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/README.md +++ b/google-cloud-contrib/google-cloud-logging-logback/README.md @@ -21,16 +21,16 @@ If you are using Maven, add this to your pom.xml file com.google.cloud google-cloud-logging-logback - 0.46.0-alpha + 0.47.0-alpha ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-logging-logback:0.46.0-alpha' +compile 'com.google.cloud:google-cloud-logging-logback:0.47.0-alpha' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.46.0-alpha" +libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.47.0-alpha" ``` [//]: # ({x-version-update-end}) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 888344f1e7bb..294fa8612d67 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.46.1-alpha-SNAPSHOT + 0.47.0-alpha jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.46.1-alpha-SNAPSHOT + 0.47.0-alpha From 86ebdf32308d3c015a982699b90e124d748644b7 Mon Sep 17 00:00:00 2001 From: Michael Darakananda Date: Tue, 8 May 2018 11:41:55 -0700 Subject: [PATCH 0077/1629] bump to snapshot version (#3245) --- google-cloud-contrib/google-cloud-logging-logback/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-contrib/google-cloud-logging-logback/pom.xml b/google-cloud-contrib/google-cloud-logging-logback/pom.xml index 294fa8612d67..aedd1459a507 100644 --- a/google-cloud-contrib/google-cloud-logging-logback/pom.xml +++ b/google-cloud-contrib/google-cloud-logging-logback/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-logging-logback - 0.47.0-alpha + 0.47.1-alpha-SNAPSHOT jar Google Cloud Logging Logback Appender https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-contrib/google-cloud-logging-logback @@ -20,7 +20,7 @@ com.google.cloud google-cloud-contrib - 0.47.0-alpha + 0.47.1-alpha-SNAPSHOT From cac4e25f2535443d77f179d7d2d81250df915c83 Mon Sep 17 00:00:00 2001 From: Vadym Matsishevskyi <25311427+vam-google@users.noreply.github.com> Date: Thu, 10 May 2018 10:54:50 -0700 Subject: [PATCH 0078/1629] Move grpc and proto artifacts to google-cloud-java from api-client-staging (second part) (#3251) 1) Radically change the structure of the repo. Now the root `pom.xml` file is not deployed to maven and is not a parent pom for any of the other modules, but is simply an aggregator pom, which aggregates other mostly independent of each other modules. 2) Update proto and grpc artifact to the latest generated versions as of time of this PR. 3) Add `cloudiot-v1` and `websecurityscanner-v1alpha` proto and grp artifacts (not released yet even in api-client-staging). Note, gapic clients for this apis are not added yet. 4) Rename `google-cloud-pom` parent artifact (for manual and gapic clients) to `google-cloud-clients`. 5) Move all manual and gapic clients from root directory to `google-cloud-clients` sub directory. 6) Make `google-cloud-bom` not a child of `google-cloud-clients` (former `google-cloud-pom`) anymore, keep it on root level so it becomes a sibling of `google-cloud-clients` (module which used to be its parent). 7) Similarly make `google-cloud-examples`, `google-cloud-testing` and `google-cloud-util` not children of `google-cloud-clients` and keep them on root level. Make these three modules also excluded from maven deployment (they will not be published to maven anymore). After this PR is done, additional work is required to fix circleci individual IT tests runs (should be trivial). Also deployment and documentation scripts must be modified accordingly (will be done right after pushing this PR). --- google-cloud-logging/README.md | 232 +++ google-cloud-logging/pom.xml | 87 + .../com/google/cloud/logging/HttpRequest.java | 604 +++++++ .../com/google/cloud/logging/LogEntry.java | 560 ++++++ .../com/google/cloud/logging/Logging.java | 748 ++++++++ .../google/cloud/logging/LoggingConfig.java | 148 ++ .../google/cloud/logging/LoggingEnhancer.java | 25 + .../cloud/logging/LoggingException.java | 39 + .../google/cloud/logging/LoggingFactory.java | 25 + .../google/cloud/logging/LoggingHandler.java | 366 ++++ .../com/google/cloud/logging/LoggingImpl.java | 666 +++++++ .../google/cloud/logging/LoggingLevel.java | 96 ++ .../google/cloud/logging/LoggingOptions.java | 157 ++ .../java/com/google/cloud/logging/Metric.java | 262 +++ .../com/google/cloud/logging/MetricInfo.java | 234 +++ .../cloud/logging/MonitoredResourceUtil.java | 243 +++ .../com/google/cloud/logging/Operation.java | 227 +++ .../java/com/google/cloud/logging/Option.java | 76 + .../com/google/cloud/logging/Payload.java | 241 +++ .../com/google/cloud/logging/Severity.java | 108 ++ .../java/com/google/cloud/logging/Sink.java | 275 +++ .../com/google/cloud/logging/SinkInfo.java | 654 +++++++ .../google/cloud/logging/SourceLocation.java | 163 ++ .../com/google/cloud/logging/Structs.java | 168 ++ .../google/cloud/logging/Synchronicity.java | 27 + .../cloud/logging/TraceLoggingEnhancer.java | 64 + .../google/cloud/logging/package-info.java | 62 + .../cloud/logging/spi/LoggingRpcFactory.java | 27 + .../cloud/logging/spi/v2/GrpcLoggingRpc.java | 292 ++++ .../cloud/logging/spi/v2/LoggingRpc.java | 168 ++ .../logging/testing/RemoteLoggingHelper.java | 129 ++ .../cloud/logging/testing/package-info.java | 36 + .../google/cloud/logging/v2/ConfigClient.java | 1524 +++++++++++++++++ .../cloud/logging/v2/ConfigSettings.java | 290 ++++ .../cloud/logging/v2/LoggingClient.java | 1080 ++++++++++++ .../cloud/logging/v2/LoggingSettings.java | 244 +++ .../cloud/logging/v2/MetricsClient.java | 805 +++++++++ .../cloud/logging/v2/MetricsSettings.java | 228 +++ .../google/cloud/logging/v2/package-info.java | 68 + .../logging/v2/stub/ConfigServiceV2Stub.java | 102 ++ .../v2/stub/ConfigServiceV2StubSettings.java | 636 +++++++ .../GrpcConfigServiceV2CallableFactory.java | 114 ++ .../v2/stub/GrpcConfigServiceV2Stub.java | 358 ++++ .../GrpcLoggingServiceV2CallableFactory.java | 114 ++ .../v2/stub/GrpcLoggingServiceV2Stub.java | 290 ++++ .../GrpcMetricsServiceV2CallableFactory.java | 114 ++ .../v2/stub/GrpcMetricsServiceV2Stub.java | 246 +++ .../logging/v2/stub/LoggingServiceV2Stub.java | 88 + .../v2/stub/LoggingServiceV2StubSettings.java | 693 ++++++++ .../logging/v2/stub/MetricsServiceV2Stub.java | 70 + .../v2/stub/MetricsServiceV2StubSettings.java | 443 +++++ .../google/cloud/logging/BaseSystemTest.java | 369 ++++ .../google/cloud/logging/HttpRequestTest.java | 189 ++ .../google/cloud/logging/LogEntryTest.java | 281 +++ .../cloud/logging/LoggingHandlerTest.java | 498 ++++++ .../google/cloud/logging/LoggingImplTest.java | 1491 ++++++++++++++++ .../cloud/logging/LoggingLevelTest.java | 81 + .../cloud/logging/LoggingOptionsTest.java | 36 + .../com/google/cloud/logging/LoggingTest.java | 97 ++ .../google/cloud/logging/MetricInfoTest.java | 86 + .../com/google/cloud/logging/MetricTest.java | 215 +++ .../google/cloud/logging/OperationTest.java | 92 + .../com/google/cloud/logging/OptionTest.java | 76 + .../com/google/cloud/logging/PayloadTest.java | 132 ++ .../cloud/logging/SerializationTest.java | 100 ++ .../google/cloud/logging/SinkInfoTest.java | 219 +++ .../com/google/cloud/logging/SinkTest.java | 224 +++ .../cloud/logging/SourceLocationTest.java | 73 + .../com/google/cloud/logging/StructsTest.java | 197 +++ .../cloud/logging/it/ITLoggingTest.java | 55 + .../cloud/logging/v2/ConfigClientTest.java | 587 +++++++ .../cloud/logging/v2/LoggingClientTest.java | 292 ++++ .../cloud/logging/v2/LoggingSmokeTest.java | 74 + .../cloud/logging/v2/MetricsClientTest.java | 333 ++++ .../cloud/logging/v2/MockConfigServiceV2.java | 57 + .../logging/v2/MockConfigServiceV2Impl.java | 219 +++ .../logging/v2/MockLoggingServiceV2.java | 57 + .../logging/v2/MockLoggingServiceV2Impl.java | 142 ++ .../logging/v2/MockMetricsServiceV2.java | 57 + .../logging/v2/MockMetricsServiceV2Impl.java | 141 ++ .../v2/testing/LocalLoggingHelper.java | 72 + .../logging/v2/testing/LocalLoggingImpl.java | 88 + grpc-google-cloud-logging-v2/pom.xml | 6 +- proto-google-cloud-logging-v2/pom.xml | 6 +- 84 files changed, 21352 insertions(+), 6 deletions(-) create mode 100644 google-cloud-logging/README.md create mode 100644 google-cloud-logging/pom.xml create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/HttpRequest.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/LogEntry.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/Logging.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingConfig.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingEnhancer.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingException.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingFactory.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingHandler.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingImpl.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingLevel.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingOptions.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/Metric.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/MetricInfo.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/MonitoredResourceUtil.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/Operation.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/Option.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/Payload.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/Severity.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/Sink.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/SinkInfo.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/SourceLocation.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/Structs.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/Synchronicity.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/TraceLoggingEnhancer.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/package-info.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/spi/LoggingRpcFactory.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/GrpcLoggingRpc.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/LoggingRpc.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/testing/RemoteLoggingHelper.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/testing/package-info.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/v2/ConfigClient.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/v2/ConfigSettings.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/v2/LoggingClient.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/v2/LoggingSettings.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/v2/MetricsClient.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/v2/MetricsSettings.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/v2/package-info.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/ConfigServiceV2Stub.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcConfigServiceV2CallableFactory.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcConfigServiceV2Stub.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcLoggingServiceV2CallableFactory.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcLoggingServiceV2Stub.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcMetricsServiceV2CallableFactory.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcMetricsServiceV2Stub.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/LoggingServiceV2Stub.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/MetricsServiceV2Stub.java create mode 100644 google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java create mode 100644 google-cloud-logging/src/test/java/com/google/cloud/logging/BaseSystemTest.java create mode 100644 google-cloud-logging/src/test/java/com/google/cloud/logging/HttpRequestTest.java create mode 100644 google-cloud-logging/src/test/java/com/google/cloud/logging/LogEntryTest.java create mode 100644 google-cloud-logging/src/test/java/com/google/cloud/logging/LoggingHandlerTest.java create mode 100644 google-cloud-logging/src/test/java/com/google/cloud/logging/LoggingImplTest.java create mode 100644 google-cloud-logging/src/test/java/com/google/cloud/logging/LoggingLevelTest.java create mode 100644 google-cloud-logging/src/test/java/com/google/cloud/logging/LoggingOptionsTest.java create mode 100644 google-cloud-logging/src/test/java/com/google/cloud/logging/LoggingTest.java create mode 100644 google-cloud-logging/src/test/java/com/google/cloud/logging/MetricInfoTest.java create mode 100644 google-cloud-logging/src/test/java/com/google/cloud/logging/MetricTest.java create mode 100644 google-cloud-logging/src/test/java/com/google/cloud/logging/OperationTest.java create mode 100644 google-cloud-logging/src/test/java/com/google/cloud/logging/OptionTest.java create mode 100644 google-cloud-logging/src/test/java/com/google/cloud/logging/PayloadTest.java create mode 100644 google-cloud-logging/src/test/java/com/google/cloud/logging/SerializationTest.java create mode 100644 google-cloud-logging/src/test/java/com/google/cloud/logging/SinkInfoTest.java create mode 100644 google-cloud-logging/src/test/java/com/google/cloud/logging/SinkTest.java create mode 100644 google-cloud-logging/src/test/java/com/google/cloud/logging/SourceLocationTest.java create mode 100644 google-cloud-logging/src/test/java/com/google/cloud/logging/StructsTest.java create mode 100644 google-cloud-logging/src/test/java/com/google/cloud/logging/it/ITLoggingTest.java create mode 100644 google-cloud-logging/src/test/java/com/google/cloud/logging/v2/ConfigClientTest.java create mode 100644 google-cloud-logging/src/test/java/com/google/cloud/logging/v2/LoggingClientTest.java create mode 100644 google-cloud-logging/src/test/java/com/google/cloud/logging/v2/LoggingSmokeTest.java create mode 100644 google-cloud-logging/src/test/java/com/google/cloud/logging/v2/MetricsClientTest.java create mode 100644 google-cloud-logging/src/test/java/com/google/cloud/logging/v2/MockConfigServiceV2.java create mode 100644 google-cloud-logging/src/test/java/com/google/cloud/logging/v2/MockConfigServiceV2Impl.java create mode 100644 google-cloud-logging/src/test/java/com/google/cloud/logging/v2/MockLoggingServiceV2.java create mode 100644 google-cloud-logging/src/test/java/com/google/cloud/logging/v2/MockLoggingServiceV2Impl.java create mode 100644 google-cloud-logging/src/test/java/com/google/cloud/logging/v2/MockMetricsServiceV2.java create mode 100644 google-cloud-logging/src/test/java/com/google/cloud/logging/v2/MockMetricsServiceV2Impl.java create mode 100644 google-cloud-logging/src/test/java/com/google/cloud/logging/v2/testing/LocalLoggingHelper.java create mode 100644 google-cloud-logging/src/test/java/com/google/cloud/logging/v2/testing/LocalLoggingImpl.java diff --git a/google-cloud-logging/README.md b/google-cloud-logging/README.md new file mode 100644 index 000000000000..7de8bf97c1c4 --- /dev/null +++ b/google-cloud-logging/README.md @@ -0,0 +1,232 @@ +Google Cloud Java Client for Logging +==================================== + +Java idiomatic client for [Stackdriver Logging][stackdriver-logging]. + +[![CircleCI](https://circleci.com/gh/GoogleCloudPlatform/google-cloud-java/tree/master.svg?style=shield)](https://circleci.com/gh/GoogleCloudPlatform/google-cloud-java/tree/master) +[![Coverage Status](https://coveralls.io/repos/GoogleCloudPlatform/google-cloud-java/badge.svg?branch=master)](https://coveralls.io/r/GoogleCloudPlatform/google-cloud-java?branch=master) +[![Maven](https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-logging.svg)]( https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-logging.svg) +[![Codacy Badge](https://api.codacy.com/project/badge/grade/9da006ad7c3a4fe1abd142e77c003917)](https://www.codacy.com/app/mziccard/google-cloud-java) +[![Dependency Status](https://www.versioneye.com/user/projects/58fe4c8d6ac171426c414772/badge.svg?style=flat)](https://www.versioneye.com/user/projects/58fe4c8d6ac171426c414772) + +- [Product Documentation][logging-product-docs] +- [Client Library Documentation][logging-client-lib-docs] + +Quickstart +---------- + +[//]: # ({x-version-update-start:google-cloud-logging:released}) +Add this to your pom.xml file +```xml + + com.google.cloud + google-cloud-logging + 1.29.0 + +``` +If you are using Gradle, add this to your dependencies +```Groovy +compile 'com.google.cloud:google-cloud-logging:1.29.0' +``` +If you are using SBT, add this to your dependencies +```Scala +libraryDependencies += "com.google.cloud" % "google-cloud-logging" % "1.29.0" +``` +[//]: # ({x-version-update-end}) + +Example Application +------------------- +[`LoggingExample`](../google-cloud-examples/src/main/java/com/google/cloud/examples/logging/LoggingExample.java) +is a simple command line interface that provides some of Stackdriver Logging's functionality. Read +more about using the application on the +[`LoggingExample` docs page](https://googlecloudplatform.github.io/google-cloud-java/apidocs/?com/google/cloud/examples/logging/LoggingExample.html). + +Authentication +-------------- + +See the [Authentication](https://github.com/GoogleCloudPlatform/google-cloud-java#authentication) section in the base directory's README. + +About Stackdriver Logging +-------------------------- + +[Stackdriver Logging][stackdriver-logging] allows you to store, search, analyze, monitor, and alert +on log data and events from Google Cloud Platform and Amazon Web Services (AWS). Logging is a +fully-managed service that performs at scale and can ingest application and system log data from +thousands of VMs. Even better, you can analyze all that log data in real-time. + +See the [Stackdriver Logging docs][stackdriver-logging-quickstart] for more details on how to +activate Logging for your project. + +See the [Logging client library docs][logging-client-lib-docs] to learn how to interact with the +Stackdriver Logging using this Client Library. + +Getting Started +--------------- +#### Prerequisites +For this tutorial, you will need a +[Google Developers Console](https://console.developers.google.com/) project with the Logging API +enabled. You will need to [enable billing](https://support.google.com/cloud/answer/6158867?hl=en) to +use Stackdriver Logging. +[Follow these instructions](https://cloud.google.com/docs/authentication#preparation) to get your +project set up. You will also need to set up the local development environment by [installing the +Google Cloud SDK](https://cloud.google.com/sdk/) and running the following commands in command line: +`gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. + +#### Installation and setup +You'll need to obtain the `google-cloud-logging` library. See the [Quickstart](#quickstart) section +to add `google-cloud-logging` as a dependency in your code. + +#### Creating an authorized service object +To make authenticated requests to Stackdriver Logging, you must create a service object with +credentials. You can then make API calls by calling methods on the Logging service object. The +simplest way to authenticate is to use +[Application Default Credentials](https://developers.google.com/identity/protocols/application-default-credentials). +These credentials are automatically inferred from your environment, so you only need the following +code to create your service object: + +```java +import com.google.cloud.logging.Logging; +import com.google.cloud.logging.LoggingOptions; + +LoggingOptions options = LoggingOptions.getDefaultInstance(); +try(Logging logging = options.getService()) { + // use logging here +} +``` + +For other authentication options, see the +[Authentication](https://github.com/GoogleCloudPlatform/google-cloud-java#authentication) page. + +#### Creating a metric +With Logging you can create logs-based metrics. Logs-based metrics allow to keep track of the number +of log messages associated to specific events. Add the following imports at the top of your file: + +```java +import com.google.cloud.logging.Metric; +import com.google.cloud.logging.MetricInfo; +``` +Then, to create the metric, use the following code: + +```java +MetricInfo metricInfo = MetricInfo.newBuilder("test-metric", "severity >= ERROR") + .setDescription("Log entries with severity higher or equal to ERROR") + .build(); +logging.create(metricInfo); +``` + +#### Writing log entries +With Logging you can also write custom log entries. Add the following imports at the top of your +file: +```java +import com.google.cloud.MonitoredResource; +import com.google.cloud.logging.LogEntry; +import com.google.cloud.logging.Logging; +import com.google.cloud.logging.Payload.StringPayload; + +import java.util.Collections; +``` +Then, to write the log entries, use the following code: +```java +LogEntry firstEntry = LogEntry.newBuilder(StringPayload.of("message")) + .setLogName("test-log") + .setResource(MonitoredResource.newBuilder("global") + .addLabel("project_id", options.getProjectId()) + .build()) + .build(); +logging.write(Collections.singleton(firstEntry)); +``` + +#### Listing log entries +With Logging you can also list log entries that have been previously written. Add the following +imports at the top of your file: +```java +import com.google.cloud.Page; +import com.google.cloud.logging.LogEntry; +import com.google.cloud.logging.Logging.EntryListOption; +``` +Then, to list the log entries, use the following code: + +``` java +Page entries = logging.listLogEntries( + EntryListOption.filter("logName=projects/" + options.getProjectId() + "/logs/test-log")); +Iterator entryIterator = entries.iterateAll(); +while (entryIterator.hasNext()) { + System.out.println(entryIterator.next()); +} +``` + +#### Add a Stackdriver Logging handler to a logger +You can also register a `LoggingHandler` to a `java.util.logging.Logger` that publishes log entries +to Stackdriver Logging. Given the following logger: +```java +private final static Logger LOGGER = Logger.getLogger(MyClass.class.getName()); +``` +You can register a `LoggingHandler` with the code: +```java +LoggingHandler.addHandler(LOGGER, new LoggingHandler()); +``` +After that, logs generated using `LOGGER` will be also directed to Stackdriver Logging. + +Notice that you can also register a `LoggingHandler` via the `logging.properties` configuration +file. Adding, for instance, the following line: +``` +com.google.cloud.examples.logging.snippets.AddLoggingHandler.handlers=com.google.cloud.logging.LoggingHandler +``` +#### Complete source code + +In +[CreateAndListMetrics.java](../google-cloud-examples/src/main/java/com/google/cloud/examples/logging/snippets/CreateAndListMetrics.java), +[WriteAndListLogEntries.java](../google-cloud-examples/src/main/java/com/google/cloud/examples/logging/snippets/WriteAndListLogEntries.java) +and +[AddLoggingHandler.java](../google-cloud-examples/src/main/java/com/google/cloud/examples/logging/snippets/AddLoggingHandler.java) +we put together all the code shown above into three programs. The programs assume that you are +running on Compute Engine or from your own desktop. + +Transport +--------- +Logging uses gRPC for the transport layer. + +Java Versions +------------- + +Java 7 or above is required for using this client. + +Testing +------- + +This library has tools to help make tests for code using Stackdriver Logging. + +See [TESTING] to read more about testing. + +Versioning +---------- + +This library follows [Semantic Versioning](http://semver.org/). + +It is currently in major version one (``1.y.z``), which means that the public API should be considered stable. + +Contributing +------------ + +Contributions to this library are always welcome and highly encouraged. + +See `google-cloud`'s [CONTRIBUTING] documentation and the [shared documentation](https://github.com/GoogleCloudPlatform/gcloud-common/blob/master/contributing/readme.md#how-to-contribute-to-gcloud) for more information on how to get started. + +Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more information. + +License +------- + +Apache 2.0 - See [LICENSE] for more information. + + +[CONTRIBUTING]:https://github.com/GoogleCloudPlatform/google-cloud-java/blob/master/CONTRIBUTING.md +[code-of-conduct]:https://github.com/GoogleCloudPlatform/google-cloud-java/blob/master/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[LICENSE]: https://github.com/GoogleCloudPlatform/google-cloud-java/blob/master/LICENSE +[TESTING]: https://github.com/GoogleCloudPlatform/google-cloud-java/blob/master/TESTING.md#testing-code-that-uses-logging + + +[stackdriver-logging]: https://cloud.google.com/logging/ +[stackdriver-logging-quickstart]: https://cloud.google.com/logging/docs/quickstart-sdk +[logging-product-docs]: https://cloud.google.com/logging/docs/ +[logging-client-lib-docs]: https://googlecloudplatform.github.io/google-cloud-java/latest/apidocs/index.html?com/google/cloud/logging/package-summary.html diff --git a/google-cloud-logging/pom.xml b/google-cloud-logging/pom.xml new file mode 100644 index 000000000000..23bd35c606f1 --- /dev/null +++ b/google-cloud-logging/pom.xml @@ -0,0 +1,87 @@ + + + 4.0.0 + google-cloud-logging + 1.29.1-SNAPSHOT + jar + Google Cloud Logging + https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-logging + + Java idiomatic client for Stackdriver Logging. + + + com.google.cloud + google-cloud-clients + 0.47.1-alpha-SNAPSHOT + + + google-cloud-logging + + + + ${project.groupId} + google-cloud-core + + + ${project.groupId} + google-cloud-core-grpc + + + com.google.api + gax-grpc + + + com.google.api.grpc + proto-google-cloud-logging-v2 + + + io.grpc + grpc-netty-shaded + + + io.grpc + grpc-stub + + + io.grpc + grpc-auth + + + ${project.groupId} + google-cloud-core + test-jar + test + + + com.google.truth + truth + test + + + com.google.api.grpc + grpc-google-cloud-logging-v2 + test + + + junit + junit + test + + + org.easymock + easymock + test + + + org.objenesis + objenesis + test + + + com.google.api + gax-grpc + testlib + test + + + diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/HttpRequest.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/HttpRequest.java new file mode 100644 index 000000000000..3f4a269fb5c7 --- /dev/null +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/HttpRequest.java @@ -0,0 +1,604 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging; + +import com.google.api.core.ApiFunction; +import com.google.cloud.StringEnumType; +import com.google.cloud.StringEnumValue; +import com.google.common.base.MoreObjects; +import com.google.common.base.Strings; +import java.io.Serializable; +import java.util.Objects; +import org.threeten.bp.Duration; + +/** + * Objects of this class represent information about the (optional) HTTP request associated with a + * log entry. + * + * @see + * Http Request + */ +public final class HttpRequest implements Serializable { + + private static final long serialVersionUID = -274998005454709817L; + + private final RequestMethod requestMethod; + private final String requestUrl; + private final Long requestSize; + private final Integer status; + private final Long responseSize; + private final String userAgent; + private final String remoteIp; + private final String serverIp; + private final String referer; + private final boolean cacheLookup; + private final boolean cacheHit; + private final boolean cacheValidatedWithOriginServer; + private final Long cacheFillBytes; + private final Duration latency; + + /** + * The HTTP request method. + */ + public static final class RequestMethod extends StringEnumValue { + private static final long serialVersionUID = 2403969065179486996L; + + private RequestMethod(String constant) { + super(constant); + } + + private static final ApiFunction CONSTRUCTOR = + new ApiFunction() { + @Override + public RequestMethod apply(String constant) { + return new RequestMethod(constant); + } + }; + + private static final StringEnumType type = new StringEnumType( + RequestMethod.class, + CONSTRUCTOR); + + public static final RequestMethod GET = type.createAndRegister("GET"); + public static final RequestMethod HEAD = type.createAndRegister("HEAD"); + public static final RequestMethod PUT = type.createAndRegister("PUT"); + public static final RequestMethod POST = type.createAndRegister("POST"); + + /** + * Get the RequestMethod for the given String constant, and throw an exception if the constant is + * not recognized. + */ + public static RequestMethod valueOfStrict(String constant) { + return type.valueOfStrict(constant); + } + + /** + * Get the RequestMethod for the given String constant, and allow unrecognized values. + */ + public static RequestMethod valueOf(String constant) { + return type.valueOf(constant); + } + + /** + * Return the known values for RequestMethod. + */ + public static RequestMethod[] values() { + return type.values(); + } + } + + /** + * A builder for {@code HttpRequest} objects. + */ + public static final class Builder { + + private RequestMethod requestMethod; + private String requestUrl; + private Long requestSize; + private Integer status; + private Long responseSize; + private String userAgent; + private String remoteIp; + private String serverIp; + private String referer; + private boolean cacheLookup; + private boolean cacheHit; + private boolean cacheValidatedWithOriginServer; + private Long cacheFillBytes; + private Duration latency; + + Builder() {} + + Builder(HttpRequest request) { + this.requestMethod = request.requestMethod; + this.requestUrl = request.requestUrl; + this.requestSize = request.requestSize; + this.status = request.status; + this.responseSize = request.responseSize; + this.userAgent = request.userAgent; + this.remoteIp = request.remoteIp; + this.serverIp = request.serverIp; + this.referer = request.referer; + this.cacheLookup = request.cacheLookup; + this.cacheHit = request.cacheHit; + this.cacheValidatedWithOriginServer = request.cacheValidatedWithOriginServer; + this.cacheFillBytes = request.cacheFillBytes; + this.latency = request.latency; + } + + + /** + * Sets the HTTP request method. + */ + public Builder setRequestMethod(RequestMethod requestMethod) { + this.requestMethod = requestMethod; + return this; + } + + + /** + * Sets the requested URL. Request URL contains the scheme ({@code http}, {@code https}), the + * host name, the path and the query portion of the URL that was requested. Example: + * {@code http://example.com/some/info?color=red}. + */ + public Builder setRequestUrl(String requestUrl) { + this.requestUrl = requestUrl; + return this; + } + + + /** + * Sets the size of the HTTP request message in bytes, including the request headers and the + * request body. + */ + public Builder setRequestSize(long requestSize) { + this.requestSize = requestSize; + return this; + } + + + /** + * Sets the response code indicating the status of response. + */ + public Builder setStatus(int status) { + this.status = status; + return this; + } + + + /** + * Sets the size of the HTTP response message sent back to the client, in bytes, including the + * response headers and the response body. + */ + public Builder setResponseSize(long responseSize) { + this.responseSize = responseSize; + return this; + } + + + /** + * Sets the user agent sent by the client. Example: + * {@code Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705)}. + */ + public Builder setUserAgent(String userAgent) { + this.userAgent = userAgent; + return this; + } + + + /** + * Sets the IP address (IPv4 or IPv6) of the client that issued the HTTP request. Examples: + * {@code 192.168.1.1}, {@code FE80::0202:B3FF:FE1E:8329}. + */ + public Builder setRemoteIp(String remoteIp) { + this.remoteIp = remoteIp; + return this; + } + + + /** + * Sets the IP address (IPv4 or IPv6) of the origin server that the request was sent to. + * Examples: {@code 192.168.1.1}, {@code FE80::0202:B3FF:FE1E:8329}. + */ + public Builder setServerIp(String serverIp) { + this.serverIp = serverIp; + return this; + } + + + /** + * Sets the referer URL of the request, as defined in HTTP/1.1 Header Field Definitions. + * + * @see HTTP/1.1 Header Field + * Definitions + */ + public Builder setReferer(String referer) { + this.referer = referer; + return this; + } + + + /** + * Sets whether or not a cache lookup was attempted. If not set, {@code false} is used. + */ + public Builder setCacheLookup(boolean cacheLookup) { + this.cacheLookup = cacheLookup; + return this; + } + + + /** + * Sets whether or not an entity was served from cache (with or without validation). If not set, + * {@code false} is used. + */ + public Builder setCacheHit(boolean cacheHit) { + this.cacheHit = cacheHit; + return this; + } + + + /** + * Sets whether or not the response was validated with the origin server before being served + * from cache. This field is only meaningful if {@link #setCacheHit(boolean)} is set to + * {@code true}. If not set, {@code false} is used. + */ + public Builder setCacheValidatedWithOriginServer(boolean cacheValidatedWithOriginServer) { + this.cacheValidatedWithOriginServer = cacheValidatedWithOriginServer; + return this; + } + + + /** + * Sets the number of HTTP response bytes inserted into cache. Set only when a cache fill was + * attempted. + */ + public Builder setCacheFillBytes(long cacheFillBytes) { + this.cacheFillBytes = cacheFillBytes; + return this; + } + + /** + * Sets the latency on the server, from the time the request was received until the response was + * sent. + */ + public Builder setLatency(Duration latency) { + this.latency = latency; + return this; + } + + /** + * Creates a {@code HttpRequest} object for this builder. + */ + public HttpRequest build() { + return new HttpRequest(this); + } + } + + HttpRequest(Builder builder) { + this.requestMethod = builder.requestMethod; + this.requestUrl = builder.requestUrl; + this.requestSize = builder.requestSize; + this.status = builder.status; + this.responseSize = builder.responseSize; + this.userAgent = builder.userAgent; + this.remoteIp = builder.remoteIp; + this.serverIp = builder.serverIp; + this.referer = builder.referer; + this.cacheLookup = builder.cacheLookup; + this.cacheHit = builder.cacheHit; + this.cacheValidatedWithOriginServer = builder.cacheValidatedWithOriginServer; + this.cacheFillBytes = builder.cacheFillBytes; + this.latency = builder.latency; + } + + + /** + * Returns the HTTP request method. + */ + public RequestMethod getRequestMethod() { + return requestMethod; + } + + + /** + * Returns the requested URL. Request URL contains the scheme ({@code http}, {@code https}), the + * host name, the path and the query portion of the URL that was requested. Example: + * {@code http://example.com/some/info?color=red}. + */ + public String getRequestUrl() { + return requestUrl; + } + + + /** + * Returns the size of the HTTP request message in bytes, including the request headers and the + * request body. + */ + public Long getRequestSize() { + return requestSize; + } + + + /** + * Returns the response code indicating the status of response. + */ + public Integer getStatus() { + return status; + } + + + /** + * Returns the size of the HTTP response message sent back to the client, in bytes, including the + * response headers and the response body. + */ + public Long getResponseSize() { + return responseSize; + } + + + /** + * Returns the user agent sent by the client. Example: + * {@code Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705)}. + */ + public String getUserAgent() { + return userAgent; + } + + + /** + * Returns the IP address (IPv4 or IPv6) of the client that issued the HTTP request. Examples: + * {@code 192.168.1.1}, {@code FE80::0202:B3FF:FE1E:8329}. + */ + public String getRemoteIp() { + return remoteIp; + } + + + /** + * Returns the IP address (IPv4 or IPv6) of the origin server that the request was sent to. + * Examples: {@code 192.168.1.1}, {@code FE80::0202:B3FF:FE1E:8329}. + */ + public String getServerIp() { + return serverIp; + } + + + /** + * Returns the referer URL of the request, as defined in HTTP/1.1 Header Field Definitions. + * + * @see HTTP/1.1 Header Field + * Definitions + */ + public String getReferer() { + return referer; + } + + /** + * Returns whether or not a cache lookup was attempted. If not set, this method returns + * {@code false}. + */ + public boolean cacheLookup() { + return cacheLookup; + } + + /** + * Returns whether or not an entity was served from cache (with or without validation). If not + * set, this method returns {@code false}. + */ + public boolean cacheHit() { + return cacheHit; + } + + /** + * Returns whether or not the response was validated with the origin server before being served + * from cache. If not set, this method returns {@code false}. This field is only meaningful if + * {@link #cacheHit()} is set to {@code true}. + */ + public boolean cacheValidatedWithOriginServer() { + return cacheValidatedWithOriginServer; + } + + + /** + * Returns the number of HTTP response bytes inserted into cache. Set only when a cache fill was + * attempted. + */ + public Long getCacheFillBytes() { + return cacheFillBytes; + } + + /** + * Returns the processing latency on the server, from the time the request was received until the + * response was sent. + * + * @return the latency, for null if not populated. + */ + public Duration getLatency() { + return latency; + } + + @Override + public int hashCode() { + return Objects.hash( + requestMethod, + requestUrl, + requestSize, + status, + responseSize, + userAgent, + serverIp, + cacheLookup, + cacheFillBytes, + remoteIp, + referer, + cacheHit, + cacheValidatedWithOriginServer, + latency); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("requestMethod", requestMethod) + .add("requestUrl", requestUrl) + .add("requestSize", requestSize) + .add("status", status) + .add("responseSize", responseSize) + .add("userAgent", userAgent) + .add("remoteIp", remoteIp) + .add("serverIp", serverIp) + .add("referer", referer) + .add("cacheLookup", cacheLookup) + .add("cacheHit", cacheHit) + .add("cacheValidatedWithOriginServer", cacheValidatedWithOriginServer) + .add("cacheFillBytes", cacheFillBytes) + .add("latency", latency) + .toString(); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof HttpRequest)) { + return false; + } + HttpRequest other = (HttpRequest) obj; + return Objects.equals(requestMethod, other.requestMethod) + && Objects.equals(requestUrl, other.requestUrl) + && Objects.equals(requestSize, other.requestSize) + && Objects.equals(status, other.status) + && Objects.equals(responseSize, other.responseSize) + && Objects.equals(userAgent, other.userAgent) + && Objects.equals(remoteIp, other.remoteIp) + && Objects.equals(serverIp, other.serverIp) + && Objects.equals(referer, other.referer) + && Objects.equals(latency, other.latency) + && cacheLookup == other.cacheLookup + && cacheHit == other.cacheHit + && cacheValidatedWithOriginServer == other.cacheValidatedWithOriginServer + && Objects.equals(cacheFillBytes, other.cacheFillBytes); + } + + /** + * Returns a builder for this object. + */ + public Builder toBuilder() { + return new Builder(this); + } + + com.google.logging.type.HttpRequest toPb() { + com.google.logging.type.HttpRequest.Builder builder = + com.google.logging.type.HttpRequest.newBuilder(); + if (requestMethod != null) { + builder.setRequestMethod(requestMethod.name()); + } + if (requestUrl != null) { + builder.setRequestUrl(requestUrl); + } + if (requestSize != null) { + builder.setRequestSize(requestSize); + } + if (status != null) { + builder.setStatus(status); + } + if (responseSize != null) { + builder.setResponseSize(responseSize); + } + if (userAgent != null) { + builder.setUserAgent(userAgent); + } + if (remoteIp != null) { + builder.setRemoteIp(remoteIp); + } + if (serverIp != null) { + builder.setServerIp(serverIp); + } + if (referer != null) { + builder.setReferer(referer); + } + builder.setCacheLookup(cacheLookup); + builder.setCacheHit(cacheHit); + builder.setCacheValidatedWithOriginServer(cacheValidatedWithOriginServer); + if (cacheFillBytes != null) { + builder.setCacheFillBytes(cacheFillBytes); + } + if (latency != null) { + // NOTE(pongad): Don't convert to nano; large durations overflow longs! + builder.setLatency( + com.google.protobuf.Duration.newBuilder() + .setSeconds(latency.getSeconds()) + .setNanos(latency.getNano()) + .build()); + } + return builder.build(); + } + + + /** + * Returns a builder for {@code HttpRequest} objects. + */ + public static Builder newBuilder() { + return new Builder(); + } + + static HttpRequest fromPb(com.google.logging.type.HttpRequest requestPb) { + Builder builder = newBuilder(); + if (!Strings.isNullOrEmpty(requestPb.getRequestMethod())) { + builder.setRequestMethod(RequestMethod.valueOf(requestPb.getRequestMethod())); + } + if (!Strings.isNullOrEmpty(requestPb.getRequestUrl())) { + builder.setRequestUrl(requestPb.getRequestUrl()); + } + if (requestPb.getRequestSize() != 0L) { + builder.setRequestSize(requestPb.getRequestSize()); + } + if (requestPb.getStatus() != 0L) { + builder.setStatus(requestPb.getStatus()); + } + if (requestPb.getResponseSize() != 0L) { + builder.setResponseSize(requestPb.getResponseSize()); + } + if (!Strings.isNullOrEmpty(requestPb.getUserAgent())) { + builder.setUserAgent(requestPb.getUserAgent()); + } + if (!Strings.isNullOrEmpty(requestPb.getServerIp())) { + builder.setServerIp(requestPb.getServerIp()); + } + if (!Strings.isNullOrEmpty(requestPb.getRemoteIp())) { + builder.setRemoteIp(requestPb.getRemoteIp()); + } + if (!Strings.isNullOrEmpty(requestPb.getReferer())) { + builder.setReferer(requestPb.getReferer()); + } + builder.setCacheLookup(requestPb.getCacheLookup()); + builder.setCacheHit(requestPb.getCacheHit()); + builder.setCacheValidatedWithOriginServer(requestPb.getCacheValidatedWithOriginServer()); + if (requestPb.getCacheFillBytes() != 0L) { + builder.setCacheFillBytes(requestPb.getCacheFillBytes()); + } + if (requestPb.hasLatency()) { + // NOTE(pongad): Don't convert to nano; large durations overflow longs! + builder.setLatency( + Duration.ofSeconds( + requestPb.getLatency().getSeconds(), requestPb.getLatency().getNanos())); + } + return builder.build(); + } +} diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/LogEntry.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/LogEntry.java new file mode 100644 index 000000000000..c42125a0e60a --- /dev/null +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/LogEntry.java @@ -0,0 +1,560 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.cloud.MonitoredResource; +import com.google.common.base.Function; +import com.google.common.base.MoreObjects; +import com.google.common.collect.ImmutableMap; +import com.google.logging.v2.LogEntryOperation; +import com.google.logging.v2.LogEntrySourceLocation; +import com.google.logging.v2.LogName; +import com.google.logging.v2.ProjectLogName; +import com.google.protobuf.Timestamp; + +import java.io.Serializable; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * A Stackdriver Logging log entry. All log entries are represented via objects of this class. Log + * entries can have different type of payloads: an UTF-8 string (see + * {@link Payload.StringPayload}), a JSON object (see {@link Payload.JsonPayload}, or a protobuf + * object (see {@link Payload.ProtoPayload}). Entries can also store additional information about + * the operation or the HTTP request that generated the log (see {@link LogEntry#getOperation()} and + * {@link LogEntry#getHttpRequest()}, respectively). + * + * @see Log Entries and Logs + */ +public class LogEntry implements Serializable { + + private static final long serialVersionUID = -944788159728228219L; + private static final long NANOS_PER_MILLISECOND = 1000000; + private static final long MILLIS_PER_SECOND = 1000; + static final Function FROM_PB_FUNCTION = + new Function() { + @Override + public LogEntry apply(com.google.logging.v2.LogEntry pb) { + return fromPb(pb); + } + }; + + private final String logName; + private final MonitoredResource resource; + private final Long timestamp; + private final Long receiveTimestamp; + private final Severity severity; + private final String insertId; + private final HttpRequest httpRequest; + private final Map labels; + private final Operation operation; + private final String trace; + private final SourceLocation sourceLocation; + private final Payload payload; + + /** + * A builder for {@code LogEntry} objects. + */ + public static class Builder { + + private String logName; + private MonitoredResource resource; + private Long timestamp; + private Long receiveTimestamp; + private Severity severity = Severity.DEFAULT; + private String insertId; + private HttpRequest httpRequest; + private Map labels = new HashMap<>(); + private Operation operation; + private String trace; + private SourceLocation sourceLocation; + private Payload payload; + + Builder(Payload payload) { + this.payload = payload; + } + + Builder(LogEntry entry) { + this.logName = entry.logName; + this.resource = entry.resource; + this.timestamp = entry.timestamp; + this.receiveTimestamp = entry.receiveTimestamp; + this.severity = entry.severity; + this.insertId = entry.insertId; + this.httpRequest = entry.httpRequest; + this.labels = new HashMap<>(entry.labels); + this.operation = entry.operation; + this.trace = entry.trace; + this.sourceLocation = entry.sourceLocation; + this.payload = entry.payload; + } + + + /** + * Sets the name of the log to which this log entry belongs. The log name must be less than 512 + * characters long and can only include the following characters: upper and lower case + * alphanumeric characters: {@code [A-Za-z0-9]}; and punctuation characters: {@code _-./}. The + * forward-slash ({@code /}) characters in the log name must be URL-encoded. Examples: + * {@code syslog}, {@code library.googleapis.com%2Fbook_log}. + */ + public Builder setLogName(String logName) { + this.logName = logName; + return this; + } + + + /** + * Sets the monitored resource associated with this log entry. Example: a log entry that reports + * a database error would be associated with the monitored resource designating the particular + * database that reported the error. + */ + public Builder setResource(MonitoredResource resource) { + this.resource = resource; + return this; + } + + + /** + * Sets the time at which the event described by the log entry occurred, in milliseconds. If + * omitted, the Logging service will use the time at which the log entry is received. + */ + public Builder setTimestamp(long timestamp) { + this.timestamp = timestamp; + return this; + } + + + /** + * Sets the time the log entry was received by Stackdriver Logging. + */ + public Builder setReceiveTimestamp(long receiveTimestamp) { + this.receiveTimestamp = receiveTimestamp; + return this; + } + + + /** + * Sets the severity of the log entry. If not set, {@link Severity#DEFAULT} is used. + */ + public Builder setSeverity(Severity severity) { + this.severity = severity; + return this; + } + + + /** + * Sets a unique ID for the log entry. If you provide this field, the Logging service considers + * other log entries in the same log with the same ID as duplicates which can be removed. If + * omitted, the Logging service will generate a unique ID for this log entry. + */ + public Builder setInsertId(String insertId) { + this.insertId = insertId; + return this; + } + + + /** + * Sets information about the HTTP request associated with this log entry, if applicable. + */ + public Builder setHttpRequest(HttpRequest httpRequest) { + this.httpRequest = httpRequest; + return this; + } + + + /** + * Sets an optional set of user-defined (key, value) data that provides additional information + * about the log entry. + */ + public Builder setLabels(Map labels) { + this.labels = new HashMap<>(checkNotNull(labels)); + return this; + } + + + /** + * Adds a label to the log entry's labels. Labels are user-defined (key, value) data that + * provides additional information about the log entry. + */ + public Builder addLabel(String key, String value) { + this.labels.put(key, value); + return this; + } + + + /** + * Clears all the labels of the log entry. Labels are user-defined (key, value) data that + * provides additional information about the log entry. + */ + public Builder clearLabels() { + this.labels.clear(); + return this; + } + + + /** + * Sets information about an operation associated with the log entry, if applicable. + */ + public Builder setOperation(Operation operation) { + this.operation = operation; + return this; + } + + + /** + * Sets the resource name of the trace associated with the log entry, if any. If it contains a + * relative resource name, the name is assumed to be relative to `//tracing.googleapis.com`. + */ + public Builder setTrace(String trace) { + this.trace = trace; + return this; + } + + + /** + * Sets the source code location information associated with the log entry if any. + */ + public Builder setSourceLocation(SourceLocation sourceLocation) { + this.sourceLocation = sourceLocation; + return this; + } + + + /** + * Sets the payload for this log entry. The log entry payload can be provided as an UTF-8 string + * (see {@link Payload.StringPayload}), a JSON object (see {@link Payload.JsonPayload}, or + * a protobuf object (see {@link Payload.ProtoPayload}). + * + * @see Log Entries and Logs + */ + public Builder setPayload(Payload payload) { + this.payload = payload; + return this; + } + + /** + * Creates a {@code LogEntry} object for this builder. + */ + public LogEntry build() { + return new LogEntry(this); + } + } + + LogEntry(Builder builder) { + this.logName = builder.logName; + this.resource = builder.resource; + this.timestamp = builder.timestamp; + this.receiveTimestamp = builder.receiveTimestamp; + this.severity = builder.severity; + this.insertId = builder.insertId; + this.httpRequest = builder.httpRequest; + this.labels = ImmutableMap.copyOf(builder.labels); + this.operation = builder.operation; + this.trace = builder.trace; + this.sourceLocation = builder.sourceLocation; + this.payload = builder.payload; + } + + + /** + * Returns the name of the log to which this log entry belongs. The log name must be less than 512 + * characters long and can only include the following characters: upper and lower case + * alphanumeric characters: {@code [A-Za-z0-9]}; and punctuation characters: {@code _-./}. The + * forward-slash ({@code /}) characters in the log name must be URL-encoded. Examples: + * {@code syslog}, {@code library.googleapis.com%2Fbook_log}. + */ + public String getLogName() { + return logName; + } + + + /** + * Returns the monitored resource associated with this log entry. Example: a log entry that + * reports a database error would be associated with the monitored resource designating the + * particular database that reported the error. + */ + public MonitoredResource getResource() { + return resource; + } + + + /** + * Returns the time at which the event described by the log entry occurred, in milliseconds. If + * omitted, the Logging service will use the time at which the log entry is received. + */ + public Long getTimestamp() { + return timestamp; + } + + + /** + * Returns the time the log entry was received by Stackdriver Logging. + */ + public Long getReceiveTimestamp() { + return receiveTimestamp; + } + + + /** + * Returns the severity of the log entry. If not set, {@link Severity#DEFAULT} is used. + */ + public Severity getSeverity() { + return severity; + } + + + /** + * Returns a unique ID for the log entry. The Logging service considers other log entries in the + * same log with the same ID as duplicates which can be removed. + */ + public String getInsertId() { + return insertId; + } + + + /** + * Returns information about the HTTP request associated with this log entry, if applicable. + */ + public HttpRequest getHttpRequest() { + return httpRequest; + } + + + /** + * Returns an optional set of user-defined (key, value) data that provides additional information + * about the log entry. + */ + public Map getLabels() { + return labels; + } + + + /** + * Returns information about an operation associated with the log entry, if applicable. + */ + public Operation getOperation() { + return operation; + } + + + /** + * Returns the resource name of the trace associated with the log entry, if any. If it contains a + * relative resource name, the name is assumed to be relative to `//tracing.googleapis.com`. + */ + public String getTrace() { + return trace; + } + + + /** + * Returns the source code location information associated with the log entry, if any. + */ + public SourceLocation getSourceLocation() { + return sourceLocation; + } + + + /** + * Returns the payload for this log entry. The log entry payload can be an UTF-8 string (see + * {@link Payload.StringPayload}), a JSON object (see {@link Payload.JsonPayload}, or a protobuf + * object (see {@link Payload.ProtoPayload}). + * + * @see Log Entries and Logs + */ + @SuppressWarnings("unchecked") + public T getPayload() { + return (T) payload; + } + + @Override + public int hashCode() { + return Objects.hash(logName, resource, timestamp, receiveTimestamp, severity, insertId, + httpRequest, labels, operation, trace, sourceLocation, payload); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof LogEntry)) { + return false; + } + LogEntry other = (LogEntry) obj; + return Objects.equals(logName, other.logName) + && Objects.equals(resource, other.resource) + && Objects.equals(timestamp, other.timestamp) + && Objects.equals(receiveTimestamp, other.receiveTimestamp) + && Objects.equals(severity, other.severity) + && Objects.equals(insertId, other.insertId) + && Objects.equals(httpRequest, other.httpRequest) + && Objects.equals(labels, other.labels) + && Objects.equals(operation, other.operation) + && Objects.equals(trace, other.trace) + && Objects.equals(sourceLocation, other.sourceLocation) + && Objects.equals(payload, other.payload); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("logName", logName) + .add("resource", resource) + .add("timestamp", timestamp) + .add("receiveTimestamp", receiveTimestamp) + .add("severity", severity) + .add("insertId", insertId) + .add("httpRequest", httpRequest) + .add("labels", labels) + .add("operation", operation) + .add("trace", trace) + .add("sourceLocation", sourceLocation) + .add("payload", payload) + .toString(); + } + + /** + * Returns a {@code Builder} for this log entry. + */ + public Builder toBuilder() { + return new Builder(this); + } + + private static Timestamp timestampFromMillis(Long millis) { + Timestamp.Builder tsBuilder = Timestamp.newBuilder(); + tsBuilder.setSeconds(millis / MILLIS_PER_SECOND); + tsBuilder.setNanos((int) (millis % MILLIS_PER_SECOND * NANOS_PER_MILLISECOND)); + return tsBuilder.build(); + } + + private static Long millisFromTimestamp(Timestamp timestamp) { + return timestamp.getSeconds() * MILLIS_PER_SECOND + + timestamp.getNanos() / NANOS_PER_MILLISECOND; + } + + com.google.logging.v2.LogEntry toPb(String projectId) { + com.google.logging.v2.LogEntry.Builder builder = payload.toPb(); + builder.putAllLabels(labels); + if (logName != null) { + builder.setLogName(ProjectLogName.of(projectId, logName).toString()); + } + if (resource != null) { + builder.setResource(resource.toPb()); + } + if (timestamp != null) { + builder.setTimestamp(timestampFromMillis(timestamp)); + } + if (receiveTimestamp != null) { + builder.setReceiveTimestamp(timestampFromMillis(receiveTimestamp)); + } + if (severity != null) { + builder.setSeverity(severity.toPb()); + } + if (insertId != null) { + builder.setInsertId(insertId); + } + if (httpRequest != null) { + builder.setHttpRequest(httpRequest.toPb()); + } + if (operation != null) { + builder.setOperation(operation.toPb()); + } + if (trace != null) { + builder.setTrace(trace); + } + if (sourceLocation != null) { + builder.setSourceLocation(sourceLocation.toPb()); + } + return builder.build(); + } + + + /** + * Returns a builder for {@code LogEntry} objects given the entry payload. + */ + public static Builder newBuilder(Payload payload) { + return new Builder(payload); + } + + /** + * Creates a {@code LogEntry} object given the entry payload. + */ + public static LogEntry of(Payload payload) { + return newBuilder(payload).build(); + } + + /** + * Creates a {@code LogEntry} object given the log name, the monitored resource and the entry + * payload. + */ + public static LogEntry of(String logName, MonitoredResource resource, Payload payload) { + return newBuilder(payload).setLogName(logName).setResource(resource).build(); + } + + static LogEntry fromPb(com.google.logging.v2.LogEntry entryPb) { + Builder builder = newBuilder(Payload.fromPb(entryPb)); + builder.setLabels(entryPb.getLabelsMap()); + builder.setSeverity(Severity.fromPb(entryPb.getSeverity())); + if (!entryPb.getLogName().equals("")) { + builder.setLogName(ProjectLogName.parse(entryPb.getLogName()).getLog()); + } + if (!entryPb.getResource().equals(com.google.api.MonitoredResource.getDefaultInstance())) { + builder.setResource(MonitoredResource.fromPb(entryPb.getResource())); + } + if (entryPb.hasTimestamp()) { + Long millis = millisFromTimestamp(entryPb.getTimestamp()); + if (millis != 0) { + builder.setTimestamp(millis); + } + } + if (entryPb.hasReceiveTimestamp()) { + Long millis = millisFromTimestamp(entryPb.getReceiveTimestamp()); + if (millis != 0) { + builder.setReceiveTimestamp(millis); + } + } + if (!entryPb.getInsertId().equals("")) { + builder.setInsertId(entryPb.getInsertId()); + } + if (!entryPb.getHttpRequest().equals( + com.google.logging.type.HttpRequest.getDefaultInstance())) { + builder.setHttpRequest(HttpRequest.fromPb(entryPb.getHttpRequest())); + } + if (!entryPb.getOperation().equals(LogEntryOperation.getDefaultInstance())) { + builder.setOperation(Operation.fromPb(entryPb.getOperation())); + } + if (!entryPb.getTrace().equals("")) { + builder.setTrace(entryPb.getTrace()); + } + if (!entryPb.getSourceLocation().equals(LogEntrySourceLocation.getDefaultInstance())) { + builder.setSourceLocation(SourceLocation.fromPb(entryPb.getSourceLocation())); + } + return builder.build(); + } + + static Function toPbFunction(final String projectId) { + return new Function() { + @Override + public com.google.logging.v2.LogEntry apply(LogEntry entry) { + return entry.toPb(projectId); + } + }; + } +} diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/Logging.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/Logging.java new file mode 100644 index 000000000000..b6153a9a639b --- /dev/null +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/Logging.java @@ -0,0 +1,748 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging; + +import com.google.api.core.ApiFuture; +import com.google.api.gax.paging.AsyncPage; +import com.google.api.gax.paging.Page; +import com.google.cloud.MonitoredResource; +import com.google.cloud.MonitoredResourceDescriptor; +import com.google.cloud.Service; +import com.google.common.collect.ImmutableMap; +import java.util.Map; + +public interface Logging extends AutoCloseable, Service { + + /** + * Class for specifying options for listing sinks, monitored resources and monitored resource + * descriptors. + */ + final class ListOption extends Option { + + private static final long serialVersionUID = -6857294816115909271L; + + enum OptionType implements Option.OptionType { + PAGE_SIZE, PAGE_TOKEN; + + @SuppressWarnings("unchecked") + T get(Map options) { + return (T) options.get(this); + } + } + + private ListOption(OptionType option, Object value) { + super(option, value); + } + + /** + * Returns an option to specify the maximum number of resources returned per page. + */ + public static ListOption pageSize(int pageSize) { + return new ListOption(OptionType.PAGE_SIZE, pageSize); + } + + /** + * Returns an option to specify the page token from which to start listing resources. + */ + public static ListOption pageToken(String pageToken) { + return new ListOption(OptionType.PAGE_TOKEN, pageToken); + } + } + + /** + * Class for specifying options for writing log entries. + */ + final class WriteOption extends Option { + + private static final long serialVersionUID = 715900132268584612L; + + enum OptionType implements Option.OptionType { + LOG_NAME, RESOURCE, LABELS; + + @SuppressWarnings("unchecked") + T get(Map options) { + return (T) options.get(this); + } + } + + private WriteOption(OptionType option, Object value) { + super(option, value); + } + + /** + * Returns an option to specify a default log name (see {@link LogEntry#getLogName()}) for those + * log entries that do not specify their own log name. Example: {@code syslog}. + */ + public static WriteOption logName(String logName) { + return new WriteOption(OptionType.LOG_NAME, logName); + } + + /** + * Returns an option to specify a default monitored resource (see {@link LogEntry#getResource()}) + * for those log entries that do not specify their own resource. + */ + public static WriteOption resource(MonitoredResource resource) { + return new WriteOption(OptionType.RESOURCE, resource); + } + + /** + * Sets an option to specify (key, value) pairs that are added to the + * {@link LogEntry#getLabels()} of each log entry written, except when a log entry already has a + * value associated to the same key. + */ + public static WriteOption labels(Map labels) { + return new WriteOption(OptionType.LABELS, ImmutableMap.copyOf(labels)); + } + } + + /** + * Fields according to which log entries can be sorted. + */ + enum SortingField { + TIMESTAMP; + + String selector() { + return name().toLowerCase(); + } + } + + /** + * Sorting orders available when listing log entries. + */ + enum SortingOrder { + DESCENDING("desc"), + ASCENDING("asc"); + + private final String selector; + + SortingOrder(String selector) { + this.selector = selector; + } + + String selector() { + return selector; + } + } + + /** + * Class for specifying options for listing log entries. + */ + final class EntryListOption extends Option { + + private static final long serialVersionUID = -1561159676386917050L; + + enum OptionType implements Option.OptionType { + ORDER_BY, + FILTER; + + @SuppressWarnings("unchecked") + T get(Map options) { + return (T) options.get(this); + } + } + + private EntryListOption(Option.OptionType option, Object value) { + super(option, value); + } + + /** + * Returns an option to specify the maximum number of log entries returned per page. + */ + public static EntryListOption pageSize(int pageSize) { + return new EntryListOption(ListOption.OptionType.PAGE_SIZE, pageSize); + } + + /** + * Returns an option to specify the page token from which to start listing log entries. + */ + public static EntryListOption pageToken(String pageToken) { + return new EntryListOption(ListOption.OptionType.PAGE_TOKEN, pageToken); + } + + /** + * Returns an option to sort log entries. If not specified, log entries are sorted in ascending + * (most-recent last) order with respect to the {@link LogEntry#getTimestamp()} value. + */ + public static EntryListOption sortOrder(SortingField field, SortingOrder order) { + return new EntryListOption(OptionType.ORDER_BY, field.selector() + ' ' + order.selector()); + } + + /** + * Returns an option to specify a filter to the log entries to be listed. + * + * @see Advanced Logs + * Filters + */ + public static EntryListOption filter(String filter) { + return new EntryListOption(OptionType.FILTER, filter); + } + } + + /* Sets synchronicity {@link Synchronicity} of logging writes, defaults to asynchronous. */ + void setWriteSynchronicity(Synchronicity synchronicity); + + /* Retrieves current set synchronicity {@link Synchronicity} of logging writes. */ + Synchronicity getWriteSynchronicity(); + + /** + * Sets flush severity for asynchronous logging writes. Default is ERROR. + * Logs will be immediately written out for entries at or higher than flush severity. + */ + void setFlushSeverity(Severity flushSeverity); + + /* Retrieves flush severity for asynchronous logging writes. */ + Severity getFlushSeverity(); + + /** + * Creates a new sink. + * + *

Example of creating a sink to export logs to a BigQuery dataset (in the + * {@link LoggingOptions#getProjectId()} project). + *

 {@code
+   * String sinkName = "my_sink_name";
+   * String datasetName = "my_dataset";
+   * SinkInfo sinkInfo = SinkInfo.of(sinkName, DatasetDestination.of(datasetName));
+   * Sink sink = logging.create(sinkInfo);
+   * }
+ * + * @return the created sink + * @throws LoggingException upon failure + */ + Sink create(SinkInfo sink); + + /** + * Sends a request for creating a sink. This method returns a {@code ApiFuture} object to consume the + * result. {@link ApiFuture#get()} returns the created sink. + * + *

Example of asynchronously creating a sink to export logs to a BigQuery dataset (in the + * {@link LoggingOptions#getProjectId()} project). + *

 {@code
+   * String sinkName = "my_sink_name";
+   * String datasetName = "my_dataset";
+   * SinkInfo sinkInfo = SinkInfo.of(sinkName, DatasetDestination.of(datasetName));
+   * ApiFuture future = logging.createAsync(sinkInfo);
+   * // ...
+   * Sink sink = future.get();
+   * }
+ * + */ + ApiFuture createAsync(SinkInfo sink); + + /** + * Updates a sink or creates one if it does not exist. + * + *

Example of updating a sink. + *

 {@code
+   * String sinkName = "my_sink_name";
+   * String datasetName = "my_dataset";
+   * SinkInfo sinkInfo = SinkInfo.newBuilder(sinkName, DatasetDestination.of(datasetName))
+   *     .setVersionFormat(SinkInfo.VersionFormat.V2)
+   *     .setFilter("severity>=ERROR")
+   *     .build();
+   * Sink sink = logging.update(sinkInfo);
+   * }
+ * + * @return the created sink + * @throws LoggingException upon failure + */ + Sink update(SinkInfo sink); + + /** + * Sends a request for updating a sink (or creating it, if it does not exist). This method returns + * a {@code ApiFuture} object to consume the result. {@link ApiFuture#get()} returns the + * updated/created sink or {@code null} if not found. + * + *

Example of asynchronously updating a sink. + *

 {@code
+   * String sinkName = "my_sink_name";
+   * String datasetName = "my_dataset";
+   * SinkInfo sinkInfo = SinkInfo.newBuilder(sinkName, DatasetDestination.of(datasetName))
+   *     .setVersionFormat(SinkInfo.VersionFormat.V2)
+   *     .setFilter("severity>=ERROR")
+   *     .build();
+   * ApiFuture future = logging.updateAsync(sinkInfo);
+   * // ...
+   * Sink sink = future.get();
+   * }
+ * + */ + ApiFuture updateAsync(SinkInfo sink); + + /** + * Returns the requested sink or {@code null} if not found. + * + *

Example of getting a sink. + *

 {@code
+   * String sinkName = "my_sink_name";
+   * Sink sink = logging.getSink(sinkName);
+   * if (sink == null) {
+   *   // sink was not found
+   * }
+   * }
+ * + * @throws LoggingException upon failure + */ + Sink getSink(String sink); + + /** + * Sends a request for getting a sink. This method returns a {@code ApiFuture} object to consume the + * result. {@link ApiFuture#get()} returns the requested sink or {@code null} if not found. + * + *

Example of asynchronously getting a sink. + *

 {@code
+   * String sinkName = "my_sink_name";
+   * ApiFuture future = logging.getSinkAsync(sinkName);
+   * // ...
+   * Sink sink = future.get();
+   * if (sink == null) {
+   *   // sink was not found
+   * }
+   * }
+ * + * @throws LoggingException upon failure + */ + ApiFuture getSinkAsync(String sink); + + /** + * Lists the sinks. This method returns a {@link Page} object that can be used to consume + * paginated results. Use {@link ListOption} to specify the page size or the page token from which + * to start listing sinks. + * + *

Example of listing sinks, specifying the page size. + *

 {@code
+   * Page sinks = logging.listSinks(ListOption.pageSize(100));
+   * Iterator sinkIterator = sinks.iterateAll();
+   * while (sinkIterator.hasNext()) {
+   *   Sink sink = sinkIterator.next();
+   *   // do something with the sink
+   * }
+   * }
+ * + * @throws LoggingException upon failure + */ + Page listSinks(ListOption... options); + + /** + * Sends a request for listing sinks. This method returns a {@code ApiFuture} object to consume + * the result. {@link ApiFuture#get()} returns an {@link AsyncPage} object that can be used to + * asynchronously handle paginated results. Use {@link ListOption} to specify the page size or the + * page token from which to start listing sinks. + * + *

Example of asynchronously listing sinks, specifying the page size. + *

 {@code
+   * ApiFuture> future = logging.listSinksAsync(ListOption.pageSize(100));
+   * // ...
+   * AsyncPage sinks = future.get();
+   * Iterator sinkIterator = sinks.iterateAll();
+   * while (sinkIterator.hasNext()) {
+   *   Sink sink = sinkIterator.next();
+   *   // do something with the sink
+   * }
+   * }
+ * + */ + ApiFuture> listSinksAsync(ListOption... options); + + /** + * Deletes the requested sink. + * + *

Example of deleting a sink. + *

 {@code
+   * String sinkName = "my_sink_name";
+   * boolean deleted = logging.deleteSink(sinkName);
+   * if (deleted) {
+   *   // the sink was deleted
+   * } else {
+   *   // the sink was not found
+   * }
+   * }
+ * + * @return {@code true} if the sink was deleted, {@code false} if it was not found + */ + boolean deleteSink(String sink); + + /** + * Sends a request for deleting a sink. This method returns a {@code ApiFuture} object to consume the + * result. {@link ApiFuture#get()} returns {@code true} if the sink was deleted, {@code false} if it + * was not found. + * + *

Example of asynchronously deleting a sink. + *

 {@code
+   * String sinkName = "my_sink_name";
+   * ApiFuture future = logging.deleteSinkAsync(sinkName);
+   * // ...
+   * boolean deleted = future.get();
+   * if (deleted) {
+   *   // the sink was deleted
+   * } else {
+   *   // the sink was not found
+   * }
+   * }
+ * + */ + ApiFuture deleteSinkAsync(String sink); + + /** + * Deletes a log and all its log entries. The log will reappear if new entries are written to it. + * + *

Example of deleting a log. + *

 {@code
+   * String logName = "my_log_name";
+   * boolean deleted = logging.deleteLog(logName);
+   * if (deleted) {
+   *   // the log was deleted
+   * } else {
+   *   // the log was not found
+   * }
+   * }
+ * + * @return {@code true} if the log was deleted, {@code false} if it was not found + */ + boolean deleteLog(String log); + + /** + * Sends a request for deleting a log and all its log entries. This method returns a + * {@code ApiFuture} object to consume the result. {@link ApiFuture#get()} returns {@code true} if the + * log was deleted, {@code false} if it was not found. + * + *

Example of asynchronously deleting a log. + *

 {@code
+   * String logName = "my_log_name";
+   * ApiFuture future = logging.deleteLogAsync(logName);
+   * // ...
+   * boolean deleted = future.get();
+   * if (deleted) {
+   *   // the log was deleted
+   * } else {
+   *   // the log was not found
+   * }
+   * }
+ * + */ + ApiFuture deleteLogAsync(String log); + + /** + * Lists the monitored resource descriptors used by Stackdriver Logging. This method returns a + * {@link Page} object that can be used to consume paginated results. Use {@link ListOption} to + * specify the page size or the page token from which to start listing resource descriptors. + * + *

Example of listing monitored resource descriptors, specifying the page size. + *

 {@code
+   * Page descriptors =
+   *     logging.listMonitoredResourceDescriptors(ListOption.pageSize(100));
+   * Iterator descriptorIterator = descriptors.iterateAll();
+   * while (descriptorIterator.hasNext()) {
+   *   MonitoredResourceDescriptor descriptor = descriptorIterator.next();
+   *   // do something with the descriptor
+   * }
+   * }
+ * + * @throws LoggingException upon failure + */ + Page listMonitoredResourceDescriptors(ListOption... options); + + /** + * Sends a request for listing monitored resource descriptors used by Stackdriver Logging. This + * method returns a {@code ApiFuture} object to consume the result. {@link ApiFuture#get()} returns an + * {@link AsyncPage} object that can be used to asynchronously handle paginated results. Use + * {@link ListOption} to specify the page size or the page token from which to start listing + * resource descriptors. + * + *

Example of asynchronously listing monitored resource descriptors, specifying the page size. + *

 {@code
+   * ApiFuture> future =
+   *     logging.listMonitoredResourceDescriptorsAsync(ListOption.pageSize(100));
+   * // ...
+   * AsyncPage descriptors = future.get();
+   * Iterator descriptorIterator = descriptors.iterateAll();
+   * while (descriptorIterator.hasNext()) {
+   *   MonitoredResourceDescriptor descriptor = descriptorIterator.next();
+   *   // do something with the descriptor
+   * }
+   * }
+ * + */ + ApiFuture> listMonitoredResourceDescriptorsAsync( + ListOption... options); + + /** + * Creates a new metric. + * + *

Example of creating a metric for logs with severity higher or equal to ERROR. + *

 {@code
+   * String metricName = "my_metric_name";
+   * MetricInfo metricInfo = MetricInfo.of(metricName, "severity>=ERROR");
+   * Metric metric = logging.create(metricInfo);
+   * }
+ * + * @return the created metric + * @throws LoggingException upon failure + */ + Metric create(MetricInfo metric); + + /** + * Sends a request for creating a metric. This method returns a {@code ApiFuture} object to consume + * the result. {@link ApiFuture#get()} returns the created metric. + * + *

Example of asynchronously creating a metric for logs with severity higher or equal to ERROR. + *

 {@code
+   * String metricName = "my_metric_name";
+   * MetricInfo metricInfo = MetricInfo.of(metricName, "severity>=ERROR");
+   * ApiFuture future = logging.createAsync(metricInfo);
+   * // ...
+   * Metric metric = future.get();
+   * }
+ * + */ + ApiFuture createAsync(MetricInfo metric); + + /** + * Updates a metric or creates one if it does not exist. + * + *

Example of updating a metric. + *

 {@code
+   * String metricName = "my_metric_name";
+   * MetricInfo metricInfo = MetricInfo.newBuilder(metricName, "severity>=ERROR")
+   *     .setDescription("new description")
+   *     .build();
+   * Metric metric = logging.update(metricInfo);
+   * }
+ * + * @return the created metric + * @throws LoggingException upon failure + */ + Metric update(MetricInfo metric); + + /** + * Sends a request for updating a metric (or creating it, if it does not exist). This method + * returns a {@code ApiFuture} object to consume the result. {@link ApiFuture#get()} returns the + * updated/created metric or {@code null} if not found. + * + *

Example of asynchronously updating a metric. + *

 {@code
+   * String metricName = "my_metric_name";
+   * MetricInfo metricInfo = MetricInfo.newBuilder(metricName, "severity>=ERROR")
+   *     .setDescription("new description")
+   *     .build();
+   * ApiFuture future = logging.updateAsync(metricInfo);
+   * // ...
+   * Metric metric = future.get();
+   * }
+ * + */ + ApiFuture updateAsync(MetricInfo metric); + + /** + * Returns the requested metric or {@code null} if not found. + * + *

Example of getting a metric. + *

 {@code
+   * String metricName = "my_metric_name";
+   * Metric metric = logging.getMetric(metricName);
+   * if (metric == null) {
+   *   // metric was not found
+   * }
+   * }
+ * + * @throws LoggingException upon failure + */ + Metric getMetric(String metric); + + /** + * Sends a request for getting a metric. This method returns a {@code ApiFuture} object to consume + * the result. {@link ApiFuture#get()} returns the requested metric or {@code null} if not found. + * + *

Example of asynchronously getting a metric. + *

 {@code
+   * String metricName = "my_metric_name";
+   * ApiFuture future = logging.getMetricAsync(metricName);
+   * // ...
+   * Metric metric = future.get();
+   * if (metric == null) {
+   *   // metric was not found
+   * }
+   * }
+ * + * @throws LoggingException upon failure + */ + ApiFuture getMetricAsync(String metric); + + /** + * Lists the metrics. This method returns a {@link Page} object that can be used to consume + * paginated results. Use {@link ListOption} to specify the page size or the page token from which + * to start listing metrics. + * + *

Example of listing metrics, specifying the page size. + *

 {@code
+   * Page metrics = logging.listMetrics(ListOption.pageSize(100));
+   * Iterator metricIterator = metrics.iterateAll();
+   * while (metricIterator.hasNext()) {
+   *   Metric metric = metricIterator.next();
+   *   // do something with the metric
+   * }
+   * }
+ * + * @throws LoggingException upon failure + */ + Page listMetrics(ListOption... options); + + /** + * Sends a request for listing metrics. This method returns a {@code ApiFuture} object to consume + * the result. {@link ApiFuture#get()} returns an {@link AsyncPage} object that can be used to + * asynchronously handle paginated results. Use {@link ListOption} to specify the page size or the + * page token from which to start listing metrics. + * + *

Example of asynchronously listing metrics, specifying the page size. + *

 {@code
+   * ApiFuture> future = logging.listMetricsAsync(ListOption.pageSize(100));
+   * // ...
+   * AsyncPage metrics = future.get();
+   * Iterator metricIterator = metrics.iterateAll();
+   * while (metricIterator.hasNext()) {
+   *   Metric metric = metricIterator.next();
+   *   // do something with the metric
+   * }
+   * }
+ * + */ + ApiFuture> listMetricsAsync(ListOption... options); + + /** + * Deletes the requested metric. + * + *

Example of deleting a metric. + *

 {@code
+   * String metricName = "my_metric_name";
+   * boolean deleted = logging.deleteMetric(metricName);
+   * if (deleted) {
+   *   // the metric was deleted
+   * } else {
+   *   // the metric was not found
+   * }
+   * }
+ * + * @return {@code true} if the metric was deleted, {@code false} if it was not found + */ + boolean deleteMetric(String metric); + + /** + * Sends a request for deleting a metric. This method returns a {@code ApiFuture} object to consume + * the result. {@link ApiFuture#get()} returns {@code true} if the metric was deleted, {@code false} + * if it was not found. + * + *

Example of asynchronously deleting a metric. + *

 {@code
+   * String metricName = "my_metric_name";
+   * ApiFuture future = logging.deleteMetricAsync(metricName);
+   * // ...
+   * boolean deleted = future.get();
+   * if (deleted) {
+   *   // the metric was deleted
+   * } else {
+   *   // the metric was not found
+   * }
+   * }
+ * + */ + ApiFuture deleteMetricAsync(String metric); + + /** + * Flushes any pending asynchronous logging writes. + * Logs are automatically flushed based on time and message count that be configured via + * {@link com.google.api.gax.batching.BatchingSettings}, + * Logs are also flushed if at or above flush severity, see {@link #setFlushSeverity}. + * Logging frameworks require support for an explicit flush. + * See usage in the java.util.logging handler{@link LoggingHandler}. + */ + void flush(); + + /** + * Sends a request to log entries to Stackdriver Logging. Use {@link WriteOption#logName(String)} + * to provide a log name for those entries that do not specify one. Use + * {@link WriteOption#resource(MonitoredResource)} to provide a monitored resource for those + * entries that do not specify one. Use {@link WriteOption#labels(Map)} to provide some labels + * to be added to every entry in {@code logEntries}. + * + *

Example of writing log entries and providing a default log name and monitored + * resource. + *

 {@code
+   * String logName = "my_log_name";
+   * List entries = new ArrayList<>();
+   * entries.add(LogEntry.of(StringPayload.of("Entry payload")));
+   * Map jsonMap = new HashMap<>();
+   * jsonMap.put("key", "value");
+   * entries.add(LogEntry.of(JsonPayload.of(jsonMap)));
+   * logging.write(
+   *     entries,
+   *     WriteOption.logName(logName),
+   *     WriteOption.resource(MonitoredResource.newBuilder("global").build()));
+   * }
+ * + */ + void write(Iterable logEntries, WriteOption... options); + + /** + * Lists log entries. This method returns a {@link Page} object that can be used to consume + * paginated results. Use {@link EntryListOption#pageSize(int)} to specify the page size. Use + * {@link EntryListOption#pageToken(String)} to specify the page token from which to start listing + * entries. Use {@link EntryListOption#sortOrder(SortingField, SortingOrder)} to sort log entries + * according to your preferred order (default is most-recent last). Use + * {@link EntryListOption#filter(String)} to filter listed log entries. + * + *

Example of listing log entries for a specific log. + *

 {@code
+   * String filter = "logName=projects/my_project_id/logs/my_log_name";
+   * Page entries = logging.listLogEntries(EntryListOption.filter(filter));
+   * Iterator entryIterator = entries.iterateAll();
+   * while (entryIterator.hasNext()) {
+   *   LogEntry entry = entryIterator.next();
+   *   // do something with the entry
+   * }
+   * }
+ * + * @throws LoggingException upon failure + */ + Page listLogEntries(EntryListOption... options); + + /** + * Sends a request for listing log entries. This method returns a {@code ApiFuture} object to consume + * the result. {@link ApiFuture#get()} returns an {@link AsyncPage} object that can be used to + * asynchronously handle paginated results. Use {@link EntryListOption#pageSize(int)} to specify + * the page size. Use {@link EntryListOption#pageToken(String)} to specify the page token from + * which to start listing entries. Use + * {@link EntryListOption#sortOrder(SortingField, SortingOrder)} to sort log entries according to + * your preferred order (default is most-recent last). Use {@link EntryListOption#filter(String)} + * to filter listed log entries. + * + *

Example of asynchronously listing log entries for a specific log. + *

 {@code
+   * String filter = "logName=projects/my_project_id/logs/my_log_name";
+   * ApiFuture> future =
+   *     logging.listLogEntriesAsync(EntryListOption.filter(filter));
+   * // ...
+   * AsyncPage entries = future.get();
+   * Iterator entryIterator = entries.iterateAll();
+   * while (entryIterator.hasNext()) {
+   *   LogEntry entry = entryIterator.next();
+   *   // do something with the entry
+   * }
+   * }
+ * + * @throws LoggingException upon failure + */ + ApiFuture> listLogEntriesAsync(EntryListOption... options); +} diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingConfig.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingConfig.java new file mode 100644 index 000000000000..d63109c9153f --- /dev/null +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingConfig.java @@ -0,0 +1,148 @@ +/* + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging; + +import static com.google.common.base.MoreObjects.firstNonNull; + +import com.google.cloud.MonitoredResource; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.logging.Filter; +import java.util.logging.Formatter; +import java.util.logging.Level; +import java.util.logging.LogManager; +import java.util.logging.SimpleFormatter; + +class LoggingConfig { + + private final LogManager manager = LogManager.getLogManager(); + private final String className; + private static final String FLUSH_LEVEL_TAG = "flushLevel"; + private static final String LOG_FILENAME_TAG = "log"; + private static final String LOG_LEVEL_TAG = "level"; + private static final String FILTER_TAG = "filter"; + private static final String FORMATTER_TAG = "formatter"; + private static final String SYNCHRONICITY_TAG = "synchronicity"; + private static final String RESOURCE_TYPE_TAG = "resourceType"; + private static final String ENHANCERS_TAG = "enhancers"; + + public LoggingConfig(String className) { + this.className = className; + } + + Level getFlushLevel() { + return getLevelProperty(FLUSH_LEVEL_TAG, LoggingLevel.ERROR); + } + + String getLogName() { + return getProperty(LOG_FILENAME_TAG, "java.log"); + } + + Level getLogLevel() { + return getLevelProperty(LOG_LEVEL_TAG, LoggingLevel.INFO); + } + + Filter getFilter() { + return getFilterProperty(FILTER_TAG, null); + } + + Synchronicity getSynchronicity() { + String synchronicityStr = getProperty(SYNCHRONICITY_TAG); + try { + return Synchronicity.valueOf(synchronicityStr); + } catch (Exception ex) { + // If we cannot create the Synchronicity we fall back to default value + } + return Synchronicity.ASYNC; + } + + Formatter getFormatter() { + return getFormatterProperty(FORMATTER_TAG, new SimpleFormatter()); + } + + MonitoredResource getMonitoredResource(String projectId) { + String resourceType = getProperty(RESOURCE_TYPE_TAG, ""); + return MonitoredResourceUtil.getResource(projectId, resourceType); + } + + List getEnhancers() { + String list = getProperty(ENHANCERS_TAG); + try { + List enhancers = new ArrayList<>(); + if (list != null) { + String[] items = list.split(","); + for (String e_name : items) { + Class clz = + (Class) ClassLoader.getSystemClassLoader().loadClass(e_name); + enhancers.add(clz.newInstance()); + } + } + return enhancers; + } catch (Exception ex) { + // If we cannot create the enhancers we fall back to the default + } + return Collections.emptyList(); + } + + private String getProperty(String name, String defaultValue) { + return firstNonNull(getProperty(name), defaultValue); + } + + private Level getLevelProperty(String name, Level defaultValue) { + String stringLevel = getProperty(name); + if (stringLevel == null) { + return defaultValue; + } + try { + return Level.parse(stringLevel); + } catch (IllegalArgumentException ex) { + // If the level does not exist we fall back to default value + } + return defaultValue; + } + + private Filter getFilterProperty(String name, Filter defaultValue) { + String stringFilter = getProperty(name); + try { + if (stringFilter != null) { + Class clz = ClassLoader.getSystemClassLoader().loadClass(stringFilter); + return (Filter) clz.newInstance(); + } + } catch (Exception ex) { + // If we cannot create the filter we fall back to default value + } + return defaultValue; + } + + private Formatter getFormatterProperty(String name, Formatter defaultValue) { + String stringFilter = getProperty(name); + try { + if (stringFilter != null) { + Class clz = ClassLoader.getSystemClassLoader().loadClass(stringFilter); + return (Formatter) clz.newInstance(); + } + } catch (Exception ex) { + // If we cannot create the filter we fall back to default value + } + return defaultValue; + } + + private String getProperty(String propertyName) { + return manager.getProperty(className + "." + propertyName); + } +} diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingEnhancer.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingEnhancer.java new file mode 100644 index 000000000000..7c36cf698021 --- /dev/null +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingEnhancer.java @@ -0,0 +1,25 @@ +/* + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging; + +/** + * An enhancer for log entries. + * Used to add custom labels to the {@link LogEntry.Builder} + */ +public interface LoggingEnhancer { + void enhanceLogEntry(LogEntry.Builder builder); +} diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingException.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingException.java new file mode 100644 index 000000000000..21a3b5670366 --- /dev/null +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingException.java @@ -0,0 +1,39 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging; + +import com.google.api.core.BetaApi; +import com.google.api.gax.rpc.ApiException; +import com.google.cloud.grpc.BaseGrpcServiceException; +import java.io.IOException; + +/** + * Logging service exception. + */ +public final class LoggingException extends BaseGrpcServiceException { + + private static final long serialVersionUID = 449689219311927047L; + + public LoggingException(IOException ex, boolean idempotent) { + super(ex, idempotent); + } + + @BetaApi + public LoggingException(ApiException apiException) { + super(apiException); + } +} diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingFactory.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingFactory.java new file mode 100644 index 000000000000..7a61a377aff9 --- /dev/null +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingFactory.java @@ -0,0 +1,25 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging; + +import com.google.cloud.ServiceFactory; + +/** + * An interface for Logging factories. + */ +public interface LoggingFactory extends ServiceFactory { +} diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingHandler.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingHandler.java new file mode 100644 index 000000000000..d57668f1a3f2 --- /dev/null +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingHandler.java @@ -0,0 +1,366 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging; + +import static com.google.common.base.MoreObjects.firstNonNull; + +import com.google.cloud.MonitoredResource; +import com.google.cloud.logging.Logging.WriteOption; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; +import java.util.logging.ErrorManager; +import java.util.logging.Filter; +import java.util.logging.Formatter; +import java.util.logging.Handler; +import java.util.logging.Level; +import java.util.logging.LogRecord; +import java.util.logging.Logger; +import java.util.logging.SimpleFormatter; + +/** + * A logging handler that outputs logs generated with {@link java.util.logging.Logger} + * to Stackdriver Logging. + * + *

Java logging levels (see {@link java.util.logging.Level}) are mapped to the following Google + * Stackdriver Logging severities: + * + * + * + * + * + * + * + * + * + * + *
Java LevelStackdriver Logging Severity
SEVEREERROR
WARNINGWARNING
INFOINFO
CONFIGINFO
FINEDEBUG
FINERDEBUG
FINESTDEBUG
+ * + *

Original Java logging levels are added as labels (with {@code levelName} and {@code + * levelValue} keys, respectively) to the corresponding Stackdriver Logging {@link LogEntry}. You + * can read entry labels using {@link LogEntry#getLabels()}. To use logging levels that correspond + * to Stackdriver Logging severities you can use {@link LoggingLevel}. + * + *

Configuration: By default each {@code LoggingHandler} is initialized using the + * following {@code LogManager} configuration properties (that you can set in the {@code + * logging.properties} file). If properties are not defined (or have invalid values) then the + * specified default values are used. + * + *

    + *
  • {@code com.google.cloud.logging.LoggingHandler.log} the log name (defaults to {@code + * java.log}). + *
  • {@code com.google.cloud.logging.LoggingHandler.level} specifies the default level for the + * handler (defaults to {@code Level.INFO}). + *
  • {@code com.google.cloud.logging.LoggingHandler.filter} specifies the name of a {@link + * Filter} class to use (defaults to no filter). + *
  • {@code com.google.cloud.logging.LoggingHandler.formatter} specifies the name of a {@link + * Formatter} class to use (defaults to {@link SimpleFormatter}). + *
  • {@code com.google.cloud.logging.LoggingHandler.flushLevel} specifies the flush log level. + * When a log with this level is published, logs are transmitted to the Stackdriver Logging + * service (defaults to {@link LoggingLevel#ERROR}). + *
  • {@code com.google.cloud.logging.LoggingHandler.enhancers} specifies a comma separated list + * of {@link LoggingEnhancer} classes. This handler will call each enhancer list whenever it builds a + * {@link LogEntry} instance (defaults to empty list). + *
  • {@code com.google.cloud.logging.LoggingHandler.resourceType} the type name to use when + * creating the default {@link MonitoredResource} (defaults to auto-detected resource type, + * else "global"). + *
  • {@code com.google.cloud.logging.Synchronicity} the synchronicity of the write method to use + * to write logs to the Stackdriver Logging service (defaults to {@link Synchronicity#ASYNC}). + *
+ * + *

To add a {@code LoggingHandler} to an existing {@link Logger} and be sure to avoid infinite + * recursion when logging, use the {@link #addHandler(Logger, LoggingHandler)} method. Alternatively + * you can add the handler via {@code logging.properties}. For example using the following line: + * + *

+ * {@code com.example.mypackage.handlers=com.google.cloud.logging.LoggingHandler}
+ * 
+ */ +public class LoggingHandler extends Handler { + + private static final String HANDLERS_PROPERTY = "handlers"; + private static final String ROOT_LOGGER_NAME = ""; + private static final String[] NO_HANDLERS = new String[0]; + private static final String LEVEL_NAME_KEY = "levelName"; + private static final String LEVEL_VALUE_KEY = "levelValue"; + + private final List enhancers; + private final LoggingOptions loggingOptions; + + private volatile Logging logging; + + // Logs with the same severity with the base could be more efficiently sent to Stackdriver. + // Defaults to level of the handler or Level.FINEST if the handler is set to Level.ALL. + // Currently there is no way to modify the base level, see + // https://github.com/GoogleCloudPlatform/google-cloud-java/issues/1740 . + private final Level baseLevel; + + private volatile Level flushLevel; + + private WriteOption[] defaultWriteOptions; + + /** Creates an handler that publishes messages to Stackdriver Logging. */ + public LoggingHandler() { + this(null, null, null); + } + + /** + * Creates a handler that publishes messages to Stackdriver Logging. + * + * @param log the name of the log to which log entries are written + */ + public LoggingHandler(String log) { + this(log, null, null); + } + + /** + * Creates a handler that publishes messages to Stackdriver Logging. + * + * @param log the name of the log to which log entries are written + * @param options options for the Stackdriver Logging service + */ + public LoggingHandler(String log, LoggingOptions options) { + this(log, options, null); + } + + /** + * Creates a handler that publishes messages to Stackdriver Logging. + * + * @param log the name of the log to which log entries are written + * @param options options for the Stackdriver Logging service + * @param monitoredResource the monitored resource to which log entries refer. If it is null then + * a default resource is created based on the project ID and deployment environment. + */ + public LoggingHandler(String log, LoggingOptions options, MonitoredResource monitoredResource) { + this(log, options, monitoredResource, null); + } + + /** + * Creates a handler that publishes messages to Stackdriver Logging. + * + * @param log the name of the log to which log entries are written + * @param options options for the Stackdriver Logging service + * @param monitoredResource the monitored resource to which log entries refer. If it is null then + * a default resource is created based on the project ID and deployment environment. + * @param enhancers List of {@link LoggingEnhancer} instances used to enhance any{@link LogEntry} + * instances built by this handler. + */ + public LoggingHandler( + String log, + LoggingOptions options, + MonitoredResource monitoredResource, + List enhancers) { + try { + loggingOptions = options != null ? options : LoggingOptions.getDefaultInstance(); + LoggingConfig config = new LoggingConfig(getClass().getName()); + setFilter(config.getFilter()); + setFormatter(config.getFormatter()); + Level level = config.getLogLevel(); + setLevel(level); + baseLevel = level.equals(Level.ALL) ? Level.FINEST : level; + flushLevel = config.getFlushLevel(); + String logName = log != null ? log : config.getLogName(); + + MonitoredResource resource = + firstNonNull( + monitoredResource, config.getMonitoredResource(loggingOptions.getProjectId())); + defaultWriteOptions = + new WriteOption[] { + WriteOption.logName(logName), + WriteOption.resource(resource), + WriteOption.labels( + ImmutableMap.of( + LEVEL_NAME_KEY, + baseLevel.getName(), + LEVEL_VALUE_KEY, + String.valueOf(baseLevel.intValue()))) + }; + + getLogging().setFlushSeverity(severityFor(flushLevel)); + getLogging().setWriteSynchronicity(config.getSynchronicity()); + + this.enhancers = new LinkedList<>(); + + List enhancersParam = firstNonNull(enhancers, + firstNonNull(config.getEnhancers(), Collections.emptyList())); + + this.enhancers.addAll(enhancersParam); + + List loggingEnhancers = MonitoredResourceUtil.getResourceEnhancers(); + if (loggingEnhancers != null) { + this.enhancers.addAll(loggingEnhancers); + } + } catch (Exception ex) { + reportError(null, ex, ErrorManager.OPEN_FAILURE); + throw ex; + } + } + + @Override + public void publish(LogRecord record) { + // check that the log record should be logged + if (!isLoggable(record)) { + return; + } + // HACK warning: this logger doesn't work like normal loggers; the log calls are issued + // from another class instead of by itself, so it can't be configured off like normal + // loggers. We have to check the source class name instead. + if ("io.netty.handler.codec.http2.Http2FrameLogger".equals(record.getSourceClassName())) { + return; + } + LogEntry logEntry; + try { + logEntry = logEntryFor(record); + } catch (Exception ex) { + getErrorManager().error(null, ex, ErrorManager.FORMAT_FAILURE); + return; + } + if (logEntry != null) { + try { + getLogging().write(ImmutableList.of(logEntry), defaultWriteOptions); + } catch (Exception ex) { + getErrorManager().error(null, ex, ErrorManager.WRITE_FAILURE); + } + } + } + + private LogEntry logEntryFor(LogRecord record) throws Exception { + String payload = getFormatter().format(record); + Level level = record.getLevel(); + LogEntry.Builder builder = + LogEntry.newBuilder(Payload.StringPayload.of(payload)) + .setTimestamp(record.getMillis()) + .setSeverity(severityFor(level)); + + if (!baseLevel.equals(level)) { + builder + .addLabel("levelName", level.getName()) + .addLabel("levelValue", String.valueOf(level.intValue())); + } + + for (LoggingEnhancer enhancer : enhancers) { + enhancer.enhanceLogEntry(builder); + } + return builder.build(); + } + + @Override + public void flush() { + try { + getLogging().flush(); + } catch (Exception ex) { + getErrorManager().error(null, ex, ErrorManager.FLUSH_FAILURE); + } + } + + /** Closes the handler and the associated {@link Logging} object. */ + @Override + public synchronized void close() throws SecurityException { + if (logging != null) { + try { + logging.close(); + } catch (Exception ex) { + // ignore + } + } + logging = null; + } + + /** Get the flush log level. */ + public Level getFlushLevel() { + return flushLevel; + } + + /** + * Sets minimum logging level to log immediately and flush any pending writes. + * @param flushLevel minimum log level to trigger flush + */ + public void setFlushLevel(Level flushLevel) { + this.flushLevel = flushLevel; + getLogging().setFlushSeverity(severityFor(flushLevel)); + } + + /** + * Sets synchronicity of logging writes. By default, writes are asynchronous. + * @param synchronicity {@link Synchronicity} + */ + public void setSynchronicity(Synchronicity synchronicity) { + getLogging().setWriteSynchronicity(synchronicity); + } + + /** Get the flush log level. */ + public Synchronicity getSynchronicity() { + return getLogging().getWriteSynchronicity(); + } + + /** + * Adds the provided {@code LoggingHandler} to {@code logger}. Use this method to register Cloud + * Logging handlers instead of {@link Logger#addHandler(Handler)} to avoid infinite recursion when + * logging. + */ + public static void addHandler(Logger logger, LoggingHandler handler) { + logger.addHandler(handler); + } + + private static Severity severityFor(Level level) { + if (level instanceof LoggingLevel) { + return ((LoggingLevel) level).getSeverity(); + } + + switch (level.intValue()) { + // FINEST + case 300: + return Severity.DEBUG; + // FINER + case 400: + return Severity.DEBUG; + // FINE + case 500: + return Severity.DEBUG; + // CONFIG + case 700: + return Severity.INFO; + // INFO + case 800: + return Severity.INFO; + // WARNING + case 900: + return Severity.WARNING; + // SEVERE + case 1000: + return Severity.ERROR; + default: + return Severity.DEFAULT; + } + } + + /** + * Returns an instance of the logging service. + */ + private Logging getLogging() { + if (logging == null) { + synchronized (this) { + if (logging == null) { + logging = loggingOptions.getService(); + } + } + } + return logging; + } +} diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingImpl.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingImpl.java new file mode 100644 index 000000000000..32eb71c2861b --- /dev/null +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingImpl.java @@ -0,0 +1,666 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging; + +import static com.google.api.client.util.Preconditions.checkArgument; +import static com.google.cloud.logging.Logging.EntryListOption.OptionType.FILTER; +import static com.google.cloud.logging.Logging.EntryListOption.OptionType.ORDER_BY; +import static com.google.cloud.logging.Logging.ListOption.OptionType.PAGE_SIZE; +import static com.google.cloud.logging.Logging.ListOption.OptionType.PAGE_TOKEN; +import static com.google.cloud.logging.Logging.WriteOption.OptionType.LABELS; +import static com.google.cloud.logging.Logging.WriteOption.OptionType.LOG_NAME; +import static com.google.cloud.logging.Logging.WriteOption.OptionType.RESOURCE; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutureCallback; +import com.google.api.core.ApiFutures; +import com.google.api.gax.paging.AsyncPage; +import com.google.api.gax.paging.Page; +import com.google.cloud.AsyncPageImpl; +import com.google.cloud.BaseService; +import com.google.cloud.MonitoredResource; +import com.google.cloud.MonitoredResourceDescriptor; +import com.google.cloud.PageImpl; +import com.google.cloud.logging.spi.v2.LoggingRpc; +import com.google.common.base.Function; +import com.google.common.base.Throwables; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Iterables; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.util.concurrent.Uninterruptibles; +import com.google.logging.v2.CreateLogMetricRequest; +import com.google.logging.v2.CreateSinkRequest; +import com.google.logging.v2.DeleteLogMetricRequest; +import com.google.logging.v2.DeleteLogRequest; +import com.google.logging.v2.DeleteSinkRequest; +import com.google.logging.v2.GetLogMetricRequest; +import com.google.logging.v2.GetSinkRequest; +import com.google.logging.v2.ListLogEntriesRequest; +import com.google.logging.v2.ListLogEntriesResponse; +import com.google.logging.v2.ListLogMetricsRequest; +import com.google.logging.v2.ListLogMetricsResponse; +import com.google.logging.v2.ListMonitoredResourceDescriptorsRequest; +import com.google.logging.v2.ListMonitoredResourceDescriptorsResponse; +import com.google.logging.v2.ListSinksRequest; +import com.google.logging.v2.ListSinksResponse; +import com.google.logging.v2.ProjectLogName; +import com.google.logging.v2.ProjectMetricName; +import com.google.logging.v2.ProjectName; +import com.google.logging.v2.ProjectSinkName; +import com.google.logging.v2.UpdateLogMetricRequest; +import com.google.logging.v2.UpdateSinkRequest; +import com.google.logging.v2.WriteLogEntriesRequest; +import com.google.logging.v2.WriteLogEntriesResponse; +import com.google.protobuf.Empty; +import java.util.ArrayList; +import java.util.Collections; +import java.util.IdentityHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ExecutionException; + +class LoggingImpl extends BaseService implements Logging { + + private final LoggingRpc rpc; + private final Object writeLock = new Object(); + private final Set> pendingWrites = + Collections.newSetFromMap(new IdentityHashMap, Boolean>()); + + private volatile Synchronicity writeSynchronicity = Synchronicity.ASYNC; + private volatile Severity flushSeverity = Severity.ERROR; + private boolean closed; + + private static final Function EMPTY_TO_BOOLEAN_FUNCTION = + new Function() { + @Override + public Boolean apply(Empty input) { + return input != null; + } + }; + private static final Function WRITE_RESPONSE_TO_VOID_FUNCTION = + new Function() { + @Override + public Void apply(WriteLogEntriesResponse input) { + return null; + } + }; + private static final ThreadLocal inWriteCall = new ThreadLocal<>(); + + LoggingImpl(LoggingOptions options) { + super(options); + rpc = options.getLoggingRpcV2(); + } + + public void setWriteSynchronicity(Synchronicity writeSynchronicity) { + this.writeSynchronicity = writeSynchronicity; + } + + public void setFlushSeverity(Severity flushSeverity) { + this.flushSeverity = flushSeverity; + } + + public Synchronicity getWriteSynchronicity() { + return writeSynchronicity; + } + + public Severity getFlushSeverity() { + return flushSeverity; + } + + private static V get(ApiFuture future) { + try { + return Uninterruptibles.getUninterruptibly(future); + } catch (ExecutionException ex) { + Throwables.throwIfUnchecked(ex.getCause()); + throw new RuntimeException(ex); + } + } + + private static ApiFuture transform(ApiFuture future, + final Function function) { + return ApiFutures.transform(future, new ApiFunction() { + @Override + public O apply(I i) { + return function.apply(i); + } + }); + } + + private abstract static class BasePageFetcher implements AsyncPageImpl.NextPageFetcher { + + private static final long serialVersionUID = 5095123855547444030L; + + private final LoggingOptions serviceOptions; + private final Map requestOptions; + + private BasePageFetcher(LoggingOptions serviceOptions, String cursor, + Map requestOptions) { + this.serviceOptions = serviceOptions; + this.requestOptions = + PageImpl.nextRequestOptions(PAGE_TOKEN, cursor, requestOptions); + } + + LoggingOptions serviceOptions() { + return serviceOptions; + } + + Map requestOptions() { + return requestOptions; + } + } + + private static class SinkPageFetcher extends BasePageFetcher { + + private static final long serialVersionUID = 4879364260060886875L; + + SinkPageFetcher(LoggingOptions serviceOptions, String cursor, + Map requestOptions) { + super(serviceOptions, cursor, requestOptions); + } + + + @Override + public ApiFuture> getNextPage() { + return listSinksAsync(serviceOptions(), requestOptions()); + } + } + + private static class MonitoredResourceDescriptorPageFetcher + extends BasePageFetcher { + + private static final long serialVersionUID = -2346495771766629195L; + + MonitoredResourceDescriptorPageFetcher(LoggingOptions serviceOptions, String cursor, + Map requestOptions) { + super(serviceOptions, cursor, requestOptions); + } + + + @Override + public ApiFuture> getNextPage() { + return listMonitoredResourceDescriptorsAsync(serviceOptions(), requestOptions()); + } + } + + private static class MetricPageFetcher extends BasePageFetcher { + + private static final long serialVersionUID = -316783549651771553L; + + MetricPageFetcher(LoggingOptions serviceOptions, String cursor, + Map requestOptions) { + super(serviceOptions, cursor, requestOptions); + } + + + @Override + public ApiFuture> getNextPage() { + return listMetricsAsync(serviceOptions(), requestOptions()); + } + } + + private static class LogEntryPageFetcher extends BasePageFetcher { + + private static final long serialVersionUID = 4001239712280747734L; + + LogEntryPageFetcher(LoggingOptions serviceOptions, String cursor, + Map requestOptions) { + super(serviceOptions, cursor, requestOptions); + } + + + @Override + public ApiFuture> getNextPage() { + return listLogEntriesAsync(serviceOptions(), requestOptions()); + } + } + + @Override + public Sink create(SinkInfo sink) { + return get(createAsync(sink)); + } + + @Override + public ApiFuture createAsync(SinkInfo sink) { + CreateSinkRequest request = CreateSinkRequest.newBuilder() + .setParent(ProjectName.of(getOptions().getProjectId()).toString()) + .setSink(sink.toPb(getOptions().getProjectId())) + .build(); + return transform(rpc.create(request), Sink.fromPbFunction(this)); + } + + @Override + public Sink update(SinkInfo sink) { + return get(updateAsync(sink)); + } + + @Override + public ApiFuture updateAsync(SinkInfo sink) { + UpdateSinkRequest request = UpdateSinkRequest.newBuilder() + .setSinkName(ProjectSinkName.of(getOptions().getProjectId(), sink.getName()).toString()) + .setSink(sink.toPb(getOptions().getProjectId())) + .build(); + return transform(rpc.update(request), Sink.fromPbFunction(this)); + } + + @Override + public Sink getSink(String sink) { + return get(getSinkAsync(sink)); + } + + @Override + public ApiFuture getSinkAsync(String sink) { + GetSinkRequest request = GetSinkRequest.newBuilder() + .setSinkName(ProjectSinkName.of(getOptions().getProjectId(), sink).toString()) + .build(); + return transform(rpc.get(request), Sink.fromPbFunction(this)); + } + + private static ListSinksRequest listSinksRequest(LoggingOptions serviceOptions, + Map options) { + ListSinksRequest.Builder builder = ListSinksRequest.newBuilder(); + builder.setParent(ProjectName.of(serviceOptions.getProjectId()).toString()); + Integer pageSize = PAGE_SIZE.get(options); + String pageToken = PAGE_TOKEN.get(options); + if (pageSize != null) { + builder.setPageSize(pageSize); + } + if (pageToken != null) { + builder.setPageToken(pageToken); + } + return builder.build(); + } + + private static ApiFuture> listSinksAsync(final LoggingOptions serviceOptions, + final Map options) { + final ListSinksRequest request = listSinksRequest(serviceOptions, options); + ApiFuture list = serviceOptions.getLoggingRpcV2().list(request); + return transform(list, new Function>() { + @Override + public AsyncPage apply(ListSinksResponse listSinksResponse) { + List sinks = listSinksResponse.getSinksList() == null ? ImmutableList.of() + : Lists.transform(listSinksResponse.getSinksList(), + Sink.fromPbFunction(serviceOptions.getService())); + String cursor = listSinksResponse.getNextPageToken().equals("") ? null + : listSinksResponse.getNextPageToken(); + return new AsyncPageImpl<>( + new SinkPageFetcher(serviceOptions, cursor, options), cursor, sinks); + } + }); + } + + @Override + public Page listSinks(ListOption... options) { + return get(listSinksAsync(options)); + } + + @Override + public ApiFuture> listSinksAsync(ListOption... options) { + return listSinksAsync(getOptions(), optionMap(options)); + } + + @Override + public boolean deleteSink(String sink) { + return get(deleteSinkAsync(sink)); + } + + @Override + public ApiFuture deleteSinkAsync(String sink) { + DeleteSinkRequest request = DeleteSinkRequest.newBuilder() + .setSinkName(ProjectSinkName.of(getOptions().getProjectId(), sink).toString()) + .build(); + return transform(rpc.delete(request), EMPTY_TO_BOOLEAN_FUNCTION); + } + + public boolean deleteLog(String log) { + return get(deleteLogAsync(log)); + } + + public ApiFuture deleteLogAsync(String log) { + DeleteLogRequest request = DeleteLogRequest.newBuilder() + .setLogName(ProjectLogName.of(getOptions().getProjectId(), log).toString()) + .build(); + return transform(rpc.delete(request), EMPTY_TO_BOOLEAN_FUNCTION); + } + + private static ListMonitoredResourceDescriptorsRequest listMonitoredResourceDescriptorsRequest( + Map options) { + ListMonitoredResourceDescriptorsRequest.Builder builder = + ListMonitoredResourceDescriptorsRequest.newBuilder(); + Integer pageSize = PAGE_SIZE.get(options); + String pageToken = PAGE_TOKEN.get(options); + if (pageSize != null) { + builder.setPageSize(pageSize); + } + if (pageToken != null) { + builder.setPageToken(pageToken); + } + return builder.build(); + } + + private static ApiFuture> + listMonitoredResourceDescriptorsAsync(final LoggingOptions serviceOptions, + final Map options) { + final ListMonitoredResourceDescriptorsRequest request = + listMonitoredResourceDescriptorsRequest(options); + ApiFuture list = serviceOptions.getLoggingRpcV2() + .list(request); + return transform(list, new Function>() { + @Override + public AsyncPage apply( + ListMonitoredResourceDescriptorsResponse listDescriptorsResponse) { + List descriptors = + listDescriptorsResponse.getResourceDescriptorsList() == null + ? ImmutableList.of() + : Lists.transform(listDescriptorsResponse.getResourceDescriptorsList(), + new Function() { + @Override + public MonitoredResourceDescriptor apply( + com.google.api.MonitoredResourceDescriptor monitoredResourceDescriptor) { + return MonitoredResourceDescriptor.FROM_PB_FUNCTION.apply(monitoredResourceDescriptor); + } + }); + String cursor = listDescriptorsResponse.getNextPageToken().equals("") ? null + : listDescriptorsResponse.getNextPageToken(); + return new AsyncPageImpl<>( + new MonitoredResourceDescriptorPageFetcher(serviceOptions, cursor, options), cursor, + descriptors); + } + }); + } + + public Page listMonitoredResourceDescriptors(ListOption... options) { + return get(listMonitoredResourceDescriptorsAsync(options)); + } + + public ApiFuture> listMonitoredResourceDescriptorsAsync( + ListOption... options) { + return listMonitoredResourceDescriptorsAsync(getOptions(), optionMap(options)); + } + + @Override + public Metric create(MetricInfo metric) { + return get(createAsync(metric)); + } + + @Override + public ApiFuture createAsync(MetricInfo metric) { + CreateLogMetricRequest request = CreateLogMetricRequest.newBuilder() + .setParent(ProjectName.of(getOptions().getProjectId()).toString()) + .setMetric(metric.toPb()) + .build(); + return transform(rpc.create(request), Metric.fromPbFunction(this)); + } + + @Override + public Metric update(MetricInfo metric) { + return get(updateAsync(metric)); + } + + @Override + public ApiFuture updateAsync(MetricInfo metric) { + UpdateLogMetricRequest request = UpdateLogMetricRequest.newBuilder() + .setMetricName(ProjectMetricName.of(getOptions().getProjectId(), metric.getName()).toString()) + .setMetric(metric.toPb()) + .build(); + return transform(rpc.update(request), Metric.fromPbFunction(this)); + } + + @Override + public Metric getMetric(String metric) { + return get(getMetricAsync(metric)); + } + + @Override + public ApiFuture getMetricAsync(String metric) { + GetLogMetricRequest request = GetLogMetricRequest.newBuilder() + .setMetricName(ProjectMetricName.of(getOptions().getProjectId(), metric).toString()) + .build(); + return transform(rpc.get(request), Metric.fromPbFunction(this)); + } + + private static ListLogMetricsRequest listMetricsRequest(LoggingOptions serviceOptions, + Map options) { + ListLogMetricsRequest.Builder builder = ListLogMetricsRequest.newBuilder(); + builder.setParent(ProjectName.of(serviceOptions.getProjectId()).toString()); + Integer pageSize = PAGE_SIZE.get(options); + String pageToken = PAGE_TOKEN.get(options); + if (pageSize != null) { + builder.setPageSize(pageSize); + } + if (pageToken != null) { + builder.setPageToken(pageToken); + } + return builder.build(); + } + + private static ApiFuture> listMetricsAsync(final LoggingOptions serviceOptions, + final Map options) { + final ListLogMetricsRequest request = listMetricsRequest(serviceOptions, options); + ApiFuture list = serviceOptions.getLoggingRpcV2().list(request); + return transform(list, new Function>() { + @Override + public AsyncPage apply(ListLogMetricsResponse listMetricsResponse) { + List metrics = listMetricsResponse.getMetricsList() == null + ? ImmutableList.of() : Lists.transform(listMetricsResponse.getMetricsList(), + Metric.fromPbFunction(serviceOptions.getService())); + String cursor = listMetricsResponse.getNextPageToken().equals("") ? null + : listMetricsResponse.getNextPageToken(); + return new AsyncPageImpl<>(new MetricPageFetcher(serviceOptions, cursor, options), cursor, + metrics); + } + }); + } + + @Override + public Page listMetrics(ListOption... options) { + return get(listMetricsAsync(options)); + } + + @Override + public ApiFuture> listMetricsAsync(ListOption... options) { + return listMetricsAsync(getOptions(), optionMap(options)); + } + + @Override + public boolean deleteMetric(String metric) { + return get(deleteMetricAsync(metric)); + } + + @Override + public ApiFuture deleteMetricAsync(String metric) { + DeleteLogMetricRequest request = DeleteLogMetricRequest.newBuilder() + .setMetricName(ProjectMetricName.of(getOptions().getProjectId(), metric).toString()) + .build(); + return transform(rpc.delete(request), EMPTY_TO_BOOLEAN_FUNCTION); + } + + private static WriteLogEntriesRequest writeLogEntriesRequest(LoggingOptions serviceOptions, + Iterable logEntries, Map options) { + String projectId = serviceOptions.getProjectId(); + WriteLogEntriesRequest.Builder builder = WriteLogEntriesRequest.newBuilder(); + String logName = LOG_NAME.get(options); + if (logName != null) { + builder.setLogName(ProjectLogName.of(projectId, logName).toString()); + } + MonitoredResource resource = RESOURCE.get(options); + if (resource != null) { + builder.setResource(resource.toPb()); + } + Map labels = LABELS.get(options); + if (labels != null) { + builder.putAllLabels(labels); + } + builder.addAllEntries(Iterables.transform(logEntries, LogEntry.toPbFunction(projectId))); + return builder.build(); + } + + public void write(Iterable logEntries, WriteOption... options) { + if (inWriteCall.get() != null) { + return; + } + inWriteCall.set(true); + + try { + writeLogEntries(logEntries, options); + for (LogEntry logEntry : logEntries) { + // flush pending writes if log severity at or above flush severity + if (logEntry.getSeverity().compareTo(flushSeverity) >= 0) { + flush(); + break; + } + } + } finally { + inWriteCall.remove(); + } + } + + public void flush() { + // BUG(1795): We should force batcher to issue RPC call for buffered messages, + // so the code below doesn't wait uselessly. + ArrayList> writesToFlush = new ArrayList<>(); + synchronized (writeLock) { + writesToFlush.addAll(pendingWrites); + } + + try { + ApiFutures.allAsList(writesToFlush).get(); + } catch (InterruptedException|ExecutionException e) { + throw new RuntimeException(e); + } + } + + /* Write logs synchronously or asynchronously based on writeSynchronicity setting. */ + private void writeLogEntries(Iterable logEntries, WriteOption... writeOptions) { + switch (this.writeSynchronicity) { + case SYNC: + get(writeAsync(logEntries, writeOptions)); + break; + + case ASYNC: + default: + final ApiFuture writeFuture = writeAsync(logEntries, writeOptions); + ApiFutures.addCallback( + writeFuture, + new ApiFutureCallback() { + private void removeFromPending() { + synchronized (writeLock) { + pendingWrites.remove(writeFuture); + } + } + + @Override + public void onSuccess(Void v) { + removeFromPending(); + } + + @Override + public void onFailure(Throwable t) { + try { + Exception ex = t instanceof Exception ? (Exception) t : new Exception(t); + throw new RuntimeException(ex); + } finally { + removeFromPending(); + } + } + }); + synchronized (writeLock) { + pendingWrites.add(writeFuture); + } + break; + } + } + + private ApiFuture writeAsync(Iterable logEntries, WriteOption... options) { + return transform( + rpc.write(writeLogEntriesRequest(getOptions(), logEntries, optionMap(options))), + WRITE_RESPONSE_TO_VOID_FUNCTION); + } + + static ListLogEntriesRequest listLogEntriesRequest( + String projectId, Map options) { + ListLogEntriesRequest.Builder builder = ListLogEntriesRequest.newBuilder(); + builder.addProjectIds(projectId); + Integer pageSize = PAGE_SIZE.get(options); + if (pageSize != null) { + builder.setPageSize(pageSize); + } + String pageToken = PAGE_TOKEN.get(options); + if (pageToken != null) { + builder.setPageToken(pageToken); + } + String orderBy = ORDER_BY.get(options); + if (orderBy != null) { + builder.setOrderBy(orderBy); + } + String filter = FILTER.get(options); + if (filter != null) { + builder.setFilter(filter); + } + return builder.build(); + } + + private static ApiFuture> listLogEntriesAsync( + final LoggingOptions serviceOptions, final Map options) { + final ListLogEntriesRequest request = + listLogEntriesRequest(serviceOptions.getProjectId(), options); + ApiFuture list = serviceOptions.getLoggingRpcV2().list(request); + return transform(list, new Function>() { + @Override + public AsyncPage apply(ListLogEntriesResponse listLogEntrysResponse) { + List entries = listLogEntrysResponse.getEntriesList() == null + ? ImmutableList.of() : Lists.transform(listLogEntrysResponse.getEntriesList(), + LogEntry.FROM_PB_FUNCTION); + String cursor = listLogEntrysResponse.getNextPageToken().equals("") ? null + : listLogEntrysResponse.getNextPageToken(); + return new AsyncPageImpl<>(new LogEntryPageFetcher(serviceOptions, cursor, options), cursor, + entries); + } + }); + } + + @Override + public Page listLogEntries(EntryListOption... options) { + return get(listLogEntriesAsync(options)); + } + + @Override + public ApiFuture> listLogEntriesAsync(EntryListOption... options) { + return listLogEntriesAsync(getOptions(), optionMap(options)); + } + + @Override + public void close() throws Exception { + if (closed) { + return; + } + closed = true; + rpc.close(); + } + + static Map optionMap(Option... options) { + Map optionMap = Maps.newHashMap(); + for (Option option : options) { + Object prev = optionMap.put(option.getOptionType(), option.getValue()); + checkArgument(prev == null, "Duplicate option %s", option); + } + return optionMap; + } +} diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingLevel.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingLevel.java new file mode 100644 index 000000000000..a1454ba61846 --- /dev/null +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingLevel.java @@ -0,0 +1,96 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging; + +import java.util.logging.Level; + +/** + * This class adds some additional Java logging levels for Stackdriver Logging. Added levels fill in + * the gap between Java logging levels and Stackdriver Logging severities. + * + *

Added levels in descending order are (between parenthesis the relation with Java logging + * levels): + *

    + *
  • EMERGENCY + *
  • ALERT + *
  • CRITICAL + *
  • ERROR ({@code WARNING < ERROR < SEVERE}) + *
  • NOTICE ({@code INFO < NOTICE < WARNING}) + *
  • DEBUG ({@code ALL < DEBUG < FINES}T + *
+ * + *

Notice that {@code ERROR} is lower than {@link java.util.logging.Level#SEVERE} but higher + * than {@link java.util.logging.Level#WARNING}. {@code DEBUG} instead is lower than + * {@link java.util.logging.Level#FINEST} but higher than {@link java.util.logging.Level#ALL}. + */ +public final class LoggingLevel extends Level { + + private static final long serialVersionUID = -6455416241709366337L; + + /** + * A level to be used for debug or trace information. This level is initialized to {@code 250}. + */ + public static final LoggingLevel DEBUG = + new LoggingLevel("DEBUG", 250, Severity.DEBUG); + + /** + * A level to be used when normal events occur, such as start up and shut down. This level is + * initialized to {@code 850}. + */ + public static final LoggingLevel NOTICE = + new LoggingLevel("NOTICE", 850, Severity.NOTICE); + + /** + * A level to be used when events occur that are likely to cause problems. This level is + * initialized to {@code 950}. + */ + public static final LoggingLevel ERROR = new LoggingLevel("ERROR", 950, Severity.ERROR); + + /** + * A level to be used when critical events cause more severe problems or brief outages. This level + * is initialized to {@code 1050}. + */ + public static final LoggingLevel CRITICAL = new LoggingLevel("CRITICAL", 1050, Severity.CRITICAL); + + /** + * A level to be used when a person must take an action immediately. This level is initialized to + * {@code 1100}. + */ + public static final LoggingLevel ALERT = new LoggingLevel("ALERT", 1100, Severity.ALERT); + + /** + * A levet to be used when one or more systems are unusable. This level is initialized to + * {@code 1150}. + */ + public static final LoggingLevel EMERGENCY = + new LoggingLevel("EMERGENCY", 1150, Severity.EMERGENCY); + + private final Severity severity; + + private LoggingLevel(String name, int value, Severity severity) { + super(name, value); + this.severity = severity; + } + + + /** + * Returns the Stackdriver Logging severity associated with this logging level. + */ + public Severity getSeverity() { + return severity; + } +} diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingOptions.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingOptions.java new file mode 100644 index 000000000000..3f6907448672 --- /dev/null +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingOptions.java @@ -0,0 +1,157 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging; + +import com.google.api.core.InternalApi; +import com.google.cloud.grpc.GrpcTransportOptions; +import com.google.cloud.ServiceDefaults; +import com.google.cloud.ServiceOptions; +import com.google.cloud.ServiceRpc; +import com.google.cloud.TransportOptions; +import com.google.cloud.logging.spi.v2.GrpcLoggingRpc; +import com.google.cloud.logging.spi.v2.LoggingRpc; +import com.google.cloud.logging.spi.LoggingRpcFactory; +import com.google.cloud.logging.v2.LoggingSettings; +import com.google.common.collect.ImmutableSet; +import java.io.IOException; +import java.util.Set; + +public class LoggingOptions extends ServiceOptions { + + private static final String API_SHORT_NAME = "Logging"; + private static final String LOGGING_SCOPE = "https://www.googleapis.com/auth/logging.admin"; + private static final Set SCOPES = ImmutableSet.of(LOGGING_SCOPE); + private static final String DEFAULT_HOST = LoggingSettings.getDefaultEndpoint(); + private static final long serialVersionUID = 5753499510627426717L; + + public static class DefaultLoggingFactory implements LoggingFactory { + private static final LoggingFactory INSTANCE = new DefaultLoggingFactory(); + + @Override + public Logging create(LoggingOptions options) { + return new LoggingImpl(options); + } + } + + + /** + * Returns a default {@code LoggingOptions} instance. + */ + public static LoggingOptions getDefaultInstance() { + return newBuilder().build(); + } + + public static class DefaultLoggingRpcFactory implements LoggingRpcFactory { + private static final LoggingRpcFactory INSTANCE = new DefaultLoggingRpcFactory(); + + @Override + public ServiceRpc create(LoggingOptions options) { + try { + return new GrpcLoggingRpc(options); + } catch (IOException e) { + throw new LoggingException(e, true); + } + } + } + + @Override + protected String getDefaultHost() { + return DEFAULT_HOST; + } + + public static class Builder extends + ServiceOptions.Builder { + + private Builder() {} + + private Builder(LoggingOptions options) { + super(options); + } + + @Override + public Builder setTransportOptions(TransportOptions transportOptions) { + if (!(transportOptions instanceof GrpcTransportOptions)) { + throw new IllegalArgumentException( + "Only grpc transport is allowed for " + API_SHORT_NAME + "."); + } + return super.setTransportOptions(transportOptions); + } + + @Override + public LoggingOptions build() { + return new LoggingOptions(this); + } + } + + @InternalApi("This class should only be extended within google-cloud-java") + protected LoggingOptions(Builder builder) { + super(LoggingFactory.class, LoggingRpcFactory.class, builder, new LoggingDefaults()); + } + + private static class LoggingDefaults implements + ServiceDefaults { + + @Override + public LoggingFactory getDefaultServiceFactory() { + return DefaultLoggingFactory.INSTANCE; + } + + @Override + public LoggingRpcFactory getDefaultRpcFactory() { + return DefaultLoggingRpcFactory.INSTANCE; + } + + @Override + public TransportOptions getDefaultTransportOptions() { + return getDefaultGrpcTransportOptions(); + } + } + + public static GrpcTransportOptions getDefaultGrpcTransportOptions() { + return GrpcTransportOptions.newBuilder().build(); + } + + @Override + protected Set getScopes() { + return SCOPES; + } + + protected LoggingRpc getLoggingRpcV2() { + return (LoggingRpc) getRpc(); + } + + @Override + public boolean equals(Object obj) { + return obj instanceof LoggingOptions && baseEquals((LoggingOptions) obj); + } + + @Override + public int hashCode() { + return baseHashCode(); + } + + @SuppressWarnings("unchecked") + @Override + public Builder toBuilder() { + return new Builder(this); + } + + + public static Builder newBuilder() { + return new Builder(); + } +} diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/Metric.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/Metric.java new file mode 100644 index 000000000000..8bc288a84aa4 --- /dev/null +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/Metric.java @@ -0,0 +1,262 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.api.core.ApiFuture; +import com.google.common.base.Function; +import com.google.logging.v2.LogMetric; + +import java.io.IOException; +import java.io.ObjectInputStream; +import java.util.Objects; + +/** + * Stackdriver Logging metrics describe logs-based metric. The value of the metric is the number of + * log entries that match a logs filter (see {@link #getFilter()}). + * + *

{@code Metric} adds a layer of service-related functionality over {@link MetricInfo}. Objects + * of this class are immutable. To get a {@code Metric} object with the most recent information use + * {@link #reload} or {@link #reloadAsync}. + * + * @see Logs-based Metrics + * + */ +public class Metric extends MetricInfo { + + private static final long serialVersionUID = -1549310461066853001L; + + private final LoggingOptions options; + private transient Logging logging; + + /** + * A builder for {@code Metric} objects. + */ + public static final class Builder extends MetricInfo.Builder { + + private final Logging logging; + private final BuilderImpl delegate; + + private Builder(Metric metric) { + logging = metric.logging; + delegate = new BuilderImpl(metric); + } + + + @Override + public Builder setName(String name) { + delegate.setName(name); + return this; + } + + + @Override + public Builder setDescription(String description) { + delegate.setDescription(description); + return this; + } + + + @Override + public Builder setFilter(String filter) { + delegate.setFilter(filter); + return this; + } + + @Override + public Metric build() { + return new Metric(this.logging, this.delegate); + } + } + + Metric(Logging logging, BuilderImpl builder) { + super(builder); + this.logging = checkNotNull(logging); + options = logging.getOptions(); + } + + @Override + public Builder toBuilder() { + return new Builder(this); + } + + @Override + public final int hashCode() { + return Objects.hash(options, super.hashCode()); + } + + @Override + public final boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (obj == null || !obj.getClass().equals(Metric.class)) { + return false; + } + Metric other = (Metric) obj; + return baseEquals(other) && Objects.equals(options, other.options); + } + + + /** + * Returns the metrics's {@code Logging} object used to issue requests. + */ + public Logging getLogging() { + return logging; + } + + /** + * Deletes this metric. + * + *

Example of deleting the metric. + *

 {@code
+   * boolean deleted = metric.delete();
+   * if (deleted) {
+   *   // the metric was deleted
+   * } else {
+   *   // the metric was not found
+   * }
+   * }
+ * + * @return {@code true} if the metric was deleted, {@code false} if it was not found + * @throws LoggingException upon failure + */ + public boolean delete() { + return logging.deleteMetric(getName()); + } + + /** + * Sends a request for deleting this metric. This method returns a {@code ApiFuture} object to + * consume the result. {@link ApiFuture#get()} returns {@code true} if the metric was deleted, + * {@code false} if it was not found. + * + *

Example of asynchronously deleting the metric. + *

 {@code
+   * ApiFuture future = metric.deleteAsync();
+   * // ...
+   * boolean deleted = future.get();
+   * if (deleted) {
+   *   // the metric was deleted
+   * } else {
+   *   // the metric was not found
+   * }
+   * }
+ * + * @throws LoggingException upon failure + */ + public ApiFuture deleteAsync() { + return logging.deleteMetricAsync(getName()); + } + + /** + * Fetches current metric's latest information. Returns {@code null} if the metric does not exist. + * + *

Example of getting the metric's latest information. + *

 {@code
+   * Metric latestMetric = metric.reload();
+   * if (latestMetric == null) {
+   *   // the metric was not found
+   * }
+   * }
+ * + * @return a {@code Metric} object with latest information or {@code null} if not found + * @throws LoggingException upon failure + */ + public Metric reload() { + return logging.getMetric(getName()); + } + + /** + * Sends a request to fetch current metric's latest information. This method returns a + * {@code ApiFuture} object to consume the result. {@link ApiFuture#get()} returns a {@code Metric} + * object with latest information or {@code null} if not found. + * + *

Example of asynchronously getting the metric's latest information. + *

 {@code
+   * ApiFuture future = metric.reloadAsync();
+   * // ...
+   * Metric latestMetric = future.get();
+   * if (latestMetric == null) {
+   *   // the metric was not found
+   * }
+   * }
+ * + * @throws LoggingException upon failure + */ + public ApiFuture reloadAsync() { + return logging.getMetricAsync(getName()); + } + + /** + * Updates current metric. If the metric does not exist, it is created. + * + *

Example of updating the metric's information. + *

 {@code
+   * Metric updatedMetric = metric.toBuilder()
+   *     .setDescription("A more detailed description")
+   *     .build()
+   *     .update();
+   * }
+ * + * @return a {@code Metric} object with updated information + * @throws LoggingException upon failure + */ + public Metric update() { + return logging.update(this); + } + + /** + * Sends a request to update current metric. If the metric does not exist, it is created. This + * method returns a {@code ApiFuture} object to consume the result. {@link ApiFuture#get()} returns a + * {@code Metric} object with updated information. + * + *

Example of asynchronously updating the metric's information. + *

 {@code
+   * ApiFuture future = metric.toBuilder()
+   *     .setDescription("A more detailed description")
+   *     .build()
+   *     .updateAsync();
+   * // ...
+   * Metric updatedMetric = future.get();
+   * }
+ * + * @throws LoggingException upon failure + */ + public ApiFuture updateAsync() { + return logging.updateAsync(this); + } + + private void readObject(ObjectInputStream input) throws IOException, ClassNotFoundException { + input.defaultReadObject(); + this.logging = options.getService(); + } + + static Metric fromPb(Logging logging, LogMetric metricPb) { + MetricInfo metricInfo = MetricInfo.fromPb(metricPb); + return new Metric(logging, new BuilderImpl(metricInfo)); + } + + static Function fromPbFunction(final Logging logging) { + return new Function() { + @Override + public Metric apply(LogMetric metricPb) { + return metricPb != null ? fromPb(logging, metricPb) : null; + } + }; + } +} diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/MetricInfo.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/MetricInfo.java new file mode 100644 index 000000000000..2edee63bb954 --- /dev/null +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/MetricInfo.java @@ -0,0 +1,234 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.common.base.MoreObjects; +import com.google.logging.v2.LogMetric; + +import java.io.Serializable; +import java.util.Objects; + +/** + * Stackdriver Logging metrics describe logs-based metric. The value of the metric is the number of + * log entries that match a logs filter (see {@link #getFilter()}). + * + * @see Logs-based Metrics + * + */ +public class MetricInfo implements Serializable { + + private static final long serialVersionUID = 666208243838820325L; + + private final String name; + private final String description; + private final String filter; + + /** + * A builder for {@code MetricInfo} objects. + */ + public abstract static class Builder { + + Builder() { + } + + /** + * Sets the name of the metric. Example: {@code severe-errors}. Metric identifiers are + * limited to 1000 characters and can include only the following characters: {@code A-Z}, + * {@code a-z}, {@code 0-9}, and the special characters {@code _-.,+!*',()%/\}. The + * forward-slash character ({@code /}) denotes a hierarchy of name pieces, and it cannot be the + * first character of the name. + */ + public abstract Builder setName(String name); + + + /** + * Sets an optional description for this metric. Used for documentation purpose. + */ + public abstract Builder setDescription(String description); + + + /** + * Sets an advanced logs filter. The value of the metric is the number of log entries that match + * this filter. Example: {@code logName=projects/my-projectid/logs/syslog AND severity>=ERROR}. + * + * @see Advanced Log + * Filters + */ + public abstract Builder setFilter(String filter); + + /** + * Creates a {@code MetricInfo} object for this builder. + */ + public abstract MetricInfo build(); + } + + static final class BuilderImpl extends Builder { + + private String name; + private String description; + private String filter; + + BuilderImpl(String name, String filter) { + this.name = name; + this.filter = filter; + } + + BuilderImpl(MetricInfo metric) { + this.name = metric.name; + this.description = metric.description; + this.filter = metric.filter; + } + + + @Override + public Builder setName(String name) { + this.name = name; + return this; + } + + + @Override + public Builder setDescription(String description) { + this.description = description; + return this; + } + + + @Override + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + @Override + public MetricInfo build() { + return new MetricInfo(this); + } + } + + MetricInfo(BuilderImpl builder) { + this.name = checkNotNull(builder.name); + this.filter = checkNotNull(builder.filter); + this.description = builder.description; + } + + + /** + * Returns the name of the metric. Example: {@code severe-errors}. Metric identifiers are + * limited to 1000 characters and can include only the following characters: {@code A-Z}, + * {@code a-z}, {@code 0-9}, and the special characters {@code _-.,+!*',()%/\}. The + * forward-slash character ({@code /}) denotes a hierarchy of name pieces, and it cannot be the + * first character of the name. + */ + public String getName() { + return name; + } + + + /** + * Returns an optional description for this metric. Used for documentation purpose. + */ + public String getDescription() { + return description; + } + + + /** + * Returns an advanced logs filter. The value of the metric is the number of log entries that + * match this filter. Example: + * {@code logName=projects/my-projectid/logs/syslog AND severity>=ERROR}. + * + * @see Advanced Log + * Filters + */ + public String getFilter() { + return filter; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("name", name) + .add("description", description) + .add("filter", filter) + .toString(); + } + + final boolean baseEquals(MetricInfo metricInfo) { + return Objects.equals(name, metricInfo.name) + && Objects.equals(description, metricInfo.description) + && Objects.equals(filter, metricInfo.filter); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (obj == null || !(obj.getClass().equals(MetricInfo.class))) { + return false; + } + return baseEquals((MetricInfo) obj); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, filter); + } + + /** + * Returns a builder for this {@code MetricInfo} object. + */ + public Builder toBuilder() { + return new BuilderImpl(this); + } + + + /** + * Returns a builder for {@code MetricInfo} objects given the name of the metric and its filter. + */ + public static Builder newBuilder(String name, String filter) { + return new BuilderImpl(name, filter); + } + + /** + * Creates a {@code MetricInfo} object given the name of the metric and its filter. + */ + public static MetricInfo of(String name, String filter) { + return new BuilderImpl(name, filter).build(); + } + + LogMetric toPb() { + LogMetric.Builder builder = LogMetric.newBuilder() + .setName(name) + .setFilter(filter); + if (description != null) { + builder.setDescription(description); + } + return builder.build(); + } + + static MetricInfo fromPb(LogMetric metricPb) { + Builder builder = newBuilder(metricPb.getName(), metricPb.getFilter()); + if (!metricPb.getDescription().equals("")) { + builder.setDescription(metricPb.getDescription()); + } + return builder.build(); + } +} diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/MonitoredResourceUtil.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/MonitoredResourceUtil.java new file mode 100644 index 000000000000..5af50769ec20 --- /dev/null +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/MonitoredResourceUtil.java @@ -0,0 +1,243 @@ +/* + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging; + +import com.google.cloud.MetadataConfig; +import com.google.cloud.MonitoredResource; +import com.google.cloud.ServiceOptions; +import com.google.cloud.logging.LogEntry.Builder; +import com.google.common.base.Strings; +import com.google.common.collect.ImmutableMultimap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Monitored resource construction utilities to detect resource type and add labels. + * Used by logging framework adapters to configure default resource. + * See usage in {@link LoggingHandler}. + */ +public class MonitoredResourceUtil { + + private enum Label { + AppId("app_id"), + ClusterName("cluster_name"), + InstanceId("instance_id"), + InstanceName("instance_name"), + ModuleId("module_id"), + PodId("pod_id"), + ProjectId("project_id"), + VersionId("version_id"), + Zone("zone"); + + private final String key; + + Label(String key) { + this.key = key; + } + + String getKey() { + return key; + } + } + + private enum Resource { + Container("container"), + GaeAppFlex("gae_app_flex"), + GaeAppStandard("gae_app_standard"), + GceInstance("gce_instance"), + Global("global"); + + private final String key; + + Resource(String key) { + this.key = key; + } + + String getKey() { + return key; + } + } + + private static final String APPENGINE_LABEL_PREFIX = "appengine.googleapis.com/"; + + private static ImmutableMultimap resourceTypeWithLabels = + ImmutableMultimap.builder() + .putAll(Resource.GaeAppFlex.getKey(), Label.ModuleId, Label.VersionId, Label.Zone) + .putAll(Resource.GaeAppStandard.getKey(), Label.ModuleId, Label.VersionId) + .putAll( + Resource.Container.getKey(), + Label.ClusterName, + Label.InstanceId, + Label.PodId, + Label.Zone) + .putAll(Resource.GceInstance.getKey(), Label.InstanceId, Label.Zone) + .build(); + + private MonitoredResourceUtil() { + } + + /* Return a self-configured monitored Resource. */ + public static MonitoredResource getResource(String projectId, String resourceTypeParam) { + String resourceType = resourceTypeParam; + if (Strings.isNullOrEmpty(resourceType)) { + Resource detectedResourceType = getAutoDetectedResourceType(); + resourceType = detectedResourceType.getKey(); + } + // Currently, "gae_app" is the supported logging Resource type, but we distinguish + // between "gae_app_flex", "gae_app_standard" to support zone id, instance name logging on flex VMs. + // Hence, "gae_app_flex", "gae_app_standard" are trimmed to "gae_app" + String resourceName = resourceType.startsWith("gae_app") ? "gae_app" : resourceType; + MonitoredResource.Builder builder = + MonitoredResource.newBuilder(resourceName).addLabel(Label.ProjectId.getKey(), projectId); + + for (Label label : resourceTypeWithLabels.get(resourceType)) { + String value = getValue(label); + if (value != null) { + builder.addLabel(label.getKey(), value); + } + } + return builder.build(); + } + + /** + * Returns custom log entry enhancers (if available) for resource type. + * + * @return custom log entry enhancers + */ + public static List getResourceEnhancers() { + Resource resourceType = getAutoDetectedResourceType(); + return createEnhancers(resourceType); + } + + private static String getValue(Label label) { + String value; + switch (label) { + case AppId: + value = ServiceOptions.getAppEngineAppId(); + break; + case ClusterName: + value = MetadataConfig.getClusterName(); + break; + case InstanceId: + value = MetadataConfig.getInstanceId(); + break; + case InstanceName: + value = getAppEngineInstanceName(); + break; + case ModuleId: + value = getAppEngineModuleId(); + break; + case PodId: + value = System.getenv("HOSTNAME"); + break; + case VersionId: + value = getAppEngineVersionId(); + break; + case Zone: + value = MetadataConfig.getZone(); + break; + default: + value = null; + break; + } + return value; + } + + /* Detect monitored Resource type using environment variables, else return global as default. */ + private static Resource getAutoDetectedResourceType() { + if (System.getenv("GAE_INSTANCE") != null) { + return Resource.GaeAppFlex; + } + if (System.getenv("KUBERNETES_SERVICE_HOST") != null) { + return Resource.Container; + } + if (ServiceOptions.getAppEngineAppId() != null) { + return Resource.GaeAppStandard; + } + if (MetadataConfig.getInstanceId() != null) { + return Resource.GceInstance; + } + // default Resource type + return Resource.Global; + } + + private static String getAppEngineModuleId() { + return System.getenv("GAE_SERVICE"); + } + + private static String getAppEngineVersionId() { + return System.getenv("GAE_VERSION"); + } + + private static String getAppEngineInstanceName() { + return System.getenv("GAE_INSTANCE"); + } + + private static List createEnhancers(Resource resourceType) { + List enhancers = new ArrayList<>(2); + switch (resourceType) { + // Trace logging enhancer is supported on GAE Flex and Standard. + case GaeAppFlex: + enhancers.add(new LabelLoggingEnhancer( + APPENGINE_LABEL_PREFIX, Collections.singletonList(Label.InstanceName))); + enhancers.add(new TraceLoggingEnhancer(APPENGINE_LABEL_PREFIX)); + break; + case GaeAppStandard: + enhancers.add(new TraceLoggingEnhancer(APPENGINE_LABEL_PREFIX)); + break; + default: + break; + } + return enhancers; + } + + /** + * Adds additional resource-based labels to log entries. + * Labels that can be provided with {@link MonitoredResource.Builder#addLabel(String, String)} + * are restricted to a supported set per resource. + * + * @see Logging Labels + */ + private static class LabelLoggingEnhancer implements LoggingEnhancer { + + private final Map labels; + + LabelLoggingEnhancer(String prefix, List