diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml
index 52eaa54d8..dc05a7276 100644
--- a/.github/.OwlBot.lock.yaml
+++ b/.github/.OwlBot.lock.yaml
@@ -1,4 +1,4 @@
-# Copyright 2023 Google LLC
+# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -13,5 +13,5 @@
# limitations under the License.
docker:
image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest
- digest: sha256:88ba8dcc5c2c7792e1c3511381f4ab329002a1c42c512f66ca87ced572dfbf9f
-# created: 2023-09-05T18:54:42.225408832Z
+ digest: sha256:a6aa751984f1e905c3ae5a3aac78fc7b68210626ce91487dc7ff4f0a06f010cc
+# created: 2024-01-22T14:14:20.913785597Z
diff --git a/.github/blunderbuss.yml b/.github/blunderbuss.yml
index 07df945a0..6edb50b98 100644
--- a/.github/blunderbuss.yml
+++ b/.github/blunderbuss.yml
@@ -1,9 +1,9 @@
# Configuration for the Blunderbuss GitHub app. For more info see
# https://github.com/googleapis/repo-automation-bots/tree/main/packages/blunderbuss
assign_issues:
- - googleapis/api-logging-reviewers
+ - googleapis/api-logging-java-reviewers
assign_prs:
- - googleapis/api-logging-reviewers
+ - googleapis/api-logging-java-reviewers
assign_prs_by:
- labels:
- samples
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index e27b2c575..ae66b1973 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -25,7 +25,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- java: [11, 17]
+ java: [11, 17, 21]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
diff --git a/.github/workflows/renovate_config_check.yaml b/.github/workflows/renovate_config_check.yaml
new file mode 100644
index 000000000..87d8eb2be
--- /dev/null
+++ b/.github/workflows/renovate_config_check.yaml
@@ -0,0 +1,25 @@
+name: Renovate Bot Config Validation
+
+on:
+ pull_request:
+ paths:
+ - 'renovate.json'
+
+jobs:
+ renovate_bot_config_validation:
+ runs-on: ubuntu-22.04
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+
+ - name: Set up Node.js
+ uses: actions/setup-node@v3
+ with:
+ node-version: '20'
+
+ - name: Install Renovate and Config Validator
+ run: |
+ npm install -g npm@latest
+ npm install --global renovate
+ renovate-config-validator
diff --git a/.kokoro/nightly/integration.cfg b/.kokoro/nightly/integration.cfg
index a2907a257..5a95c6828 100644
--- a/.kokoro/nightly/integration.cfg
+++ b/.kokoro/nightly/integration.cfg
@@ -35,3 +35,4 @@ env_vars: {
key: "SECRET_MANAGER_KEYS"
value: "java-it-service-account"
}
+
diff --git a/.kokoro/nightly/java11-integration.cfg b/.kokoro/nightly/java11-integration.cfg
index 58049cc38..6a6ef94ef 100644
--- a/.kokoro/nightly/java11-integration.cfg
+++ b/.kokoro/nightly/java11-integration.cfg
@@ -35,3 +35,4 @@ env_vars: {
key: "SECRET_MANAGER_KEYS"
value: "java-it-service-account"
}
+
diff --git a/.kokoro/presubmit/graalvm-native-17.cfg b/.kokoro/presubmit/graalvm-native-17.cfg
index f52533545..fb5bb678f 100644
--- a/.kokoro/presubmit/graalvm-native-17.cfg
+++ b/.kokoro/presubmit/graalvm-native-17.cfg
@@ -3,7 +3,7 @@
# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
- value: "gcr.io/cloud-devrel-kokoro-resources/graalvm17:22.3.2"
+ value: "gcr.io/cloud-devrel-kokoro-resources/graalvm17:22.3.3"
}
env_vars: {
diff --git a/.kokoro/presubmit/graalvm-native.cfg b/.kokoro/presubmit/graalvm-native.cfg
index 44b100487..59efee340 100644
--- a/.kokoro/presubmit/graalvm-native.cfg
+++ b/.kokoro/presubmit/graalvm-native.cfg
@@ -3,7 +3,7 @@
# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
- value: "gcr.io/cloud-devrel-kokoro-resources/graalvm:22.3.2"
+ value: "gcr.io/cloud-devrel-kokoro-resources/graalvm:22.3.3"
}
env_vars: {
diff --git a/.kokoro/presubmit/integration.cfg b/.kokoro/presubmit/integration.cfg
index dded67a9d..5864c603e 100644
--- a/.kokoro/presubmit/integration.cfg
+++ b/.kokoro/presubmit/integration.cfg
@@ -31,3 +31,4 @@ env_vars: {
key: "SECRET_MANAGER_KEYS"
value: "java-it-service-account"
}
+
diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt
index a73256ab8..445c5c1f0 100644
--- a/.kokoro/requirements.txt
+++ b/.kokoro/requirements.txt
@@ -170,30 +170,30 @@ colorlog==6.7.0 \
--hash=sha256:0d33ca236784a1ba3ff9c532d4964126d8a2c44f1f0cb1d2b0728196f512f662 \
--hash=sha256:bd94bd21c1e13fac7bd3153f4bc3a7dc0eb0974b8bc2fdf1a989e474f6e582e5
# via gcp-docuploader
-cryptography==41.0.2 \
- --hash=sha256:01f1d9e537f9a15b037d5d9ee442b8c22e3ae11ce65ea1f3316a41c78756b711 \
- --hash=sha256:079347de771f9282fbfe0e0236c716686950c19dee1b76240ab09ce1624d76d7 \
- --hash=sha256:182be4171f9332b6741ee818ec27daff9fb00349f706629f5cbf417bd50e66fd \
- --hash=sha256:192255f539d7a89f2102d07d7375b1e0a81f7478925b3bc2e0549ebf739dae0e \
- --hash=sha256:2a034bf7d9ca894720f2ec1d8b7b5832d7e363571828037f9e0c4f18c1b58a58 \
- --hash=sha256:342f3767e25876751e14f8459ad85e77e660537ca0a066e10e75df9c9e9099f0 \
- --hash=sha256:439c3cc4c0d42fa999b83ded80a9a1fb54d53c58d6e59234cfe97f241e6c781d \
- --hash=sha256:49c3222bb8f8e800aead2e376cbef687bc9e3cb9b58b29a261210456a7783d83 \
- --hash=sha256:674b669d5daa64206c38e507808aae49904c988fa0a71c935e7006a3e1e83831 \
- --hash=sha256:7a9a3bced53b7f09da251685224d6a260c3cb291768f54954e28f03ef14e3766 \
- --hash=sha256:7af244b012711a26196450d34f483357e42aeddb04128885d95a69bd8b14b69b \
- --hash=sha256:7d230bf856164de164ecb615ccc14c7fc6de6906ddd5b491f3af90d3514c925c \
- --hash=sha256:84609ade00a6ec59a89729e87a503c6e36af98ddcd566d5f3be52e29ba993182 \
- --hash=sha256:9a6673c1828db6270b76b22cc696f40cde9043eb90373da5c2f8f2158957f42f \
- --hash=sha256:9b6d717393dbae53d4e52684ef4f022444fc1cce3c48c38cb74fca29e1f08eaa \
- --hash=sha256:9c3fe6534d59d071ee82081ca3d71eed3210f76ebd0361798c74abc2bcf347d4 \
- --hash=sha256:a719399b99377b218dac6cf547b6ec54e6ef20207b6165126a280b0ce97e0d2a \
- --hash=sha256:b332cba64d99a70c1e0836902720887fb4529ea49ea7f5462cf6640e095e11d2 \
- --hash=sha256:d124682c7a23c9764e54ca9ab5b308b14b18eba02722b8659fb238546de83a76 \
- --hash=sha256:d73f419a56d74fef257955f51b18d046f3506270a5fd2ac5febbfa259d6c0fa5 \
- --hash=sha256:f0dc40e6f7aa37af01aba07277d3d64d5a03dc66d682097541ec4da03cc140ee \
- --hash=sha256:f14ad275364c8b4e525d018f6716537ae7b6d369c094805cae45300847e0894f \
- --hash=sha256:f772610fe364372de33d76edcd313636a25684edb94cee53fd790195f5989d14
+cryptography==41.0.6 \
+ --hash=sha256:068bc551698c234742c40049e46840843f3d98ad7ce265fd2bd4ec0d11306596 \
+ --hash=sha256:0f27acb55a4e77b9be8d550d762b0513ef3fc658cd3eb15110ebbcbd626db12c \
+ --hash=sha256:2132d5865eea673fe6712c2ed5fb4fa49dba10768bb4cc798345748380ee3660 \
+ --hash=sha256:3288acccef021e3c3c10d58933f44e8602cf04dba96d9796d70d537bb2f4bbc4 \
+ --hash=sha256:35f3f288e83c3f6f10752467c48919a7a94b7d88cc00b0668372a0d2ad4f8ead \
+ --hash=sha256:398ae1fc711b5eb78e977daa3cbf47cec20f2c08c5da129b7a296055fbb22aed \
+ --hash=sha256:422e3e31d63743855e43e5a6fcc8b4acab860f560f9321b0ee6269cc7ed70cc3 \
+ --hash=sha256:48783b7e2bef51224020efb61b42704207dde583d7e371ef8fc2a5fb6c0aabc7 \
+ --hash=sha256:4d03186af98b1c01a4eda396b137f29e4e3fb0173e30f885e27acec8823c1b09 \
+ --hash=sha256:5daeb18e7886a358064a68dbcaf441c036cbdb7da52ae744e7b9207b04d3908c \
+ --hash=sha256:60e746b11b937911dc70d164060d28d273e31853bb359e2b2033c9e93e6f3c43 \
+ --hash=sha256:742ae5e9a2310e9dade7932f9576606836ed174da3c7d26bc3d3ab4bd49b9f65 \
+ --hash=sha256:7e00fb556bda398b99b0da289ce7053639d33b572847181d6483ad89835115f6 \
+ --hash=sha256:85abd057699b98fce40b41737afb234fef05c67e116f6f3650782c10862c43da \
+ --hash=sha256:8efb2af8d4ba9dbc9c9dd8f04d19a7abb5b49eab1f3694e7b5a16a5fc2856f5c \
+ --hash=sha256:ae236bb8760c1e55b7a39b6d4d32d2279bc6c7c8500b7d5a13b6fb9fc97be35b \
+ --hash=sha256:afda76d84b053923c27ede5edc1ed7d53e3c9f475ebaf63c68e69f1403c405a8 \
+ --hash=sha256:b27a7fd4229abef715e064269d98a7e2909ebf92eb6912a9603c7e14c181928c \
+ --hash=sha256:b648fe2a45e426aaee684ddca2632f62ec4613ef362f4d681a9a6283d10e079d \
+ --hash=sha256:c5a550dc7a3b50b116323e3d376241829fd326ac47bc195e04eb33a8170902a9 \
+ --hash=sha256:da46e2b5df770070412c46f87bac0849b8d685c5f2679771de277a422c7d0b86 \
+ --hash=sha256:f39812f70fc5c71a15aa3c97b2bbe213c3f2a460b79bd21c40d033bb34a9bf36 \
+ --hash=sha256:ff369dd19e8fe0528b02e8df9f2aeb2479f89b1270d90f96a63500afe9af5cae
# via
# gcp-releasetool
# secretstorage
@@ -418,6 +418,7 @@ protobuf==3.20.3 \
# gcp-docuploader
# gcp-releasetool
# google-api-core
+ # googleapis-common-protos
pyasn1==0.5.0 \
--hash=sha256:87a2121042a1ac9358cabcaf1d07680ff97ee6404333bacca15f76aa8ad01a57 \
--hash=sha256:97b7290ca68e62a832558ec3976f15cbf911bf5d7c7039d8b861c2a0ece69fde
@@ -469,9 +470,9 @@ typing-extensions==4.7.1 \
--hash=sha256:440d5dd3af93b060174bf433bccd69b0babc3b15b1a8dca43789fd7f61514b36 \
--hash=sha256:b75ddc264f0ba5615db7ba217daeb99701ad295353c45f9e95963337ceeeffb2
# via -r requirements.in
-urllib3==1.26.16 \
- --hash=sha256:8d36afa7616d8ab714608411b4a3b13e58f463aee519024578e062e141dce20f \
- --hash=sha256:8f135f6502756bde6b2a9b28989df5fbe87c9970cecaa69041edcce7f0589b14
+urllib3==1.26.18 \
+ --hash=sha256:34b97092d7e0a3a8cf7cd10e386f401b3737364026c45e622aa02903dffe0f07 \
+ --hash=sha256:f8ecc1bba5667413457c529ab955bf8c67b45db799d159066261719e328580a0
# via
# google-auth
# requests
@@ -485,5 +486,6 @@ zipp==3.16.1 \
# via importlib-metadata
# WARNING: The following packages were not pinned, but pip requires them to be
-# pinned when the requirements file includes hashes. Consider using the --allow-unsafe flag.
+# pinned when the requirements file includes hashes and the requirement is not
+# satisfied by a package already installed. Consider using the --allow-unsafe flag.
# setuptools
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0cebc5525..458fe86e4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,48 @@
# Changelog
+## [3.15.15](https://github.com/googleapis/java-logging/compare/v3.15.14...v3.15.15) (2024-01-10)
+
+
+### Bug Fixes
+
+* **deps:** Update the Java code generator (gapic-generator-java) to 2.31.0 ([#1502](https://github.com/googleapis/java-logging/issues/1502)) ([c7a20de](https://github.com/googleapis/java-logging/commit/c7a20de29bf6fae079f8d73e3062025a79c220c9))
+* Replace internal Structs class with google-cloud-core version ([#1501](https://github.com/googleapis/java-logging/issues/1501)) ([21e1929](https://github.com/googleapis/java-logging/commit/21e19295923a33759229e2e992d003409ab1feb3))
+
+
+### Dependencies
+
+* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.21.0 ([#1500](https://github.com/googleapis/java-logging/issues/1500)) ([6cce3c9](https://github.com/googleapis/java-logging/commit/6cce3c9bbe051180789c7ff4fbdde4c45fe46888))
+
+## [3.15.14](https://github.com/googleapis/java-logging/compare/v3.15.13...v3.15.14) (2023-12-01)
+
+
+### Dependencies
+
+* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.20.0 ([#1484](https://github.com/googleapis/java-logging/issues/1484)) ([f3227db](https://github.com/googleapis/java-logging/commit/f3227dbbb6ef7f8b16ff4a6d39882f57868915f1))
+
+## [3.15.13](https://github.com/googleapis/java-logging/compare/v3.15.12...v3.15.13) (2023-11-06)
+
+
+### Dependencies
+
+* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.19.0 ([#1468](https://github.com/googleapis/java-logging/issues/1468)) ([5835a7d](https://github.com/googleapis/java-logging/commit/5835a7dc1c839eb3bc379470846451bd51fdfc24))
+* Update dependency org.junit.vintage:junit-vintage-engine to v5.10.1 ([#1471](https://github.com/googleapis/java-logging/issues/1471)) ([debc77f](https://github.com/googleapis/java-logging/commit/debc77f4ce57d768474c27eb6c056f7c10c7d743))
+
+## [3.15.12](https://github.com/googleapis/java-logging/compare/v3.15.11...v3.15.12) (2023-10-25)
+
+
+### Dependencies
+
+* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.18.0 ([#1454](https://github.com/googleapis/java-logging/issues/1454)) ([dc25a87](https://github.com/googleapis/java-logging/commit/dc25a87cb6e1d64c2e2c811a928ea2553a684daa))
+* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.28 ([#1455](https://github.com/googleapis/java-logging/issues/1455)) ([3080cec](https://github.com/googleapis/java-logging/commit/3080cec373f8d9d61ce57363553925a07702d552))
+
+## [3.15.11](https://github.com/googleapis/java-logging/compare/v3.15.10...v3.15.11) (2023-10-10)
+
+
+### Dependencies
+
+* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.17.0 ([#1444](https://github.com/googleapis/java-logging/issues/1444)) ([748e8a2](https://github.com/googleapis/java-logging/commit/748e8a29026b6eb782a559df207a70555289f906))
+
## [3.15.10](https://github.com/googleapis/java-logging/compare/v3.15.9...v3.15.10) (2023-09-27)
diff --git a/README.md b/README.md
index dbc6f17c3..2a60cfeda 100644
--- a/README.md
+++ b/README.md
@@ -19,7 +19,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
com.google.cloudlibraries-bom
- 26.23.0
+ 26.30.0pomimport
@@ -44,7 +44,7 @@ If you are using Maven without the BOM, add this to your dependencies:
com.google.cloudgoogle-cloud-logging
- 3.15.9
+ 3.15.13
```
@@ -52,20 +52,20 @@ If you are using Maven without the BOM, add this to your dependencies:
If you are using Gradle 5.x or later, add this to your dependencies:
```Groovy
-implementation platform('com.google.cloud:libraries-bom:26.24.0')
+implementation platform('com.google.cloud:libraries-bom:26.30.0')
implementation 'com.google.cloud:google-cloud-logging'
```
If you are using Gradle without BOM, add this to your dependencies:
```Groovy
-implementation 'com.google.cloud:google-cloud-logging:3.15.10'
+implementation 'com.google.cloud:google-cloud-logging:3.15.15'
```
If you are using SBT, add this to your dependencies:
```Scala
-libraryDependencies += "com.google.cloud" % "google-cloud-logging" % "3.15.10"
+libraryDependencies += "com.google.cloud" % "google-cloud-logging" % "3.15.15"
```
@@ -452,7 +452,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-logging/java11.html
[stability-image]: https://img.shields.io/badge/stability-stable-green
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-logging.svg
-[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-logging/3.15.10
+[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-logging/3.15.15
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
diff --git a/google-cloud-logging-bom/pom.xml b/google-cloud-logging-bom/pom.xml
index 755963a40..ca6ce6574 100644
--- a/google-cloud-logging-bom/pom.xml
+++ b/google-cloud-logging-bom/pom.xml
@@ -3,12 +3,12 @@
4.0.0com.google.cloudgoogle-cloud-logging-bom
- 3.15.11-SNAPSHOT
+ 3.15.16-SNAPSHOTpomcom.google.cloudgoogle-cloud-shared-config
- 1.5.7
+ 1.7.1Google Cloud logging BOM
@@ -53,17 +53,17 @@
com.google.cloudgoogle-cloud-logging
- 3.15.11-SNAPSHOT
+ 3.15.16-SNAPSHOTcom.google.api.grpcgrpc-google-cloud-logging-v2
- 0.104.11-SNAPSHOT
+ 0.104.16-SNAPSHOTcom.google.api.grpcproto-google-cloud-logging-v2
- 0.104.11-SNAPSHOT
+ 0.104.16-SNAPSHOT
diff --git a/google-cloud-logging/pom.xml b/google-cloud-logging/pom.xml
index 1d6041314..74df9c3f6 100644
--- a/google-cloud-logging/pom.xml
+++ b/google-cloud-logging/pom.xml
@@ -3,7 +3,7 @@
4.0.0com.google.cloudgoogle-cloud-logging
- 3.15.11-SNAPSHOT
+ 3.15.16-SNAPSHOTjarGoogle Cloud Logginghttps://github.com/googleapis/java-logging
@@ -11,7 +11,7 @@
com.google.cloudgoogle-cloud-logging-parent
- 3.15.11-SNAPSHOT
+ 3.15.16-SNAPSHOTgoogle-cloud-logging
diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/Instrumentation.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/Instrumentation.java
index e7b4c549c..17f290ad4 100644
--- a/google-cloud-logging/src/main/java/com/google/cloud/logging/Instrumentation.java
+++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/Instrumentation.java
@@ -40,7 +40,7 @@ public final class Instrumentation {
// See
// https://github.com/googleapis/release-please/blob/main/docs/customizing.md#updating-arbitrary-files
// {x-version-update-start:google-cloud-logging:current}
- public static final String DEFAULT_INSTRUMENTATION_VERSION = "3.15.11-SNAPSHOT";
+ public static final String DEFAULT_INSTRUMENTATION_VERSION = "3.15.16-SNAPSHOT";
// {x-version-update-end}
public static final String INSTRUMENTATION_LOG_NAME = "diagnostic-log";
public static final int MAX_DIAGNOSTIC_VALUE_LENGTH = 14;
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
index 72622031d..2fd872f09 100644
--- 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
@@ -760,7 +760,7 @@ public static LogEntry of(String logName, MonitoredResource resource, Payload>
return newBuilder(payload).setLogName(logName).setResource(resource).build();
}
- static LogEntry fromPb(com.google.logging.v2.LogEntry entryPb) {
+ public 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()));
@@ -805,7 +805,8 @@ static LogEntry fromPb(com.google.logging.v2.LogEntry entryPb) {
return builder.build();
}
- static Function toPbFunction(final String projectId) {
+ public static Function toPbFunction(
+ final String projectId) {
return (LogEntry entry) -> {
return entry.toPb(projectId);
};
diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/Payload.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/Payload.java
index a80262f75..9e86b50bb 100644
--- a/google-cloud-logging/src/main/java/com/google/cloud/logging/Payload.java
+++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/Payload.java
@@ -18,6 +18,7 @@
import static com.google.common.base.Preconditions.checkNotNull;
+import com.google.cloud.Structs;
import com.google.common.base.MoreObjects;
import com.google.protobuf.Any;
import com.google.protobuf.Struct;
diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/Structs.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/Structs.java
deleted file mode 100644
index 46ba567e6..000000000
--- a/google-cloud-logging/src/main/java/com/google/cloud/logging/Structs.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * 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.client.util.Types;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Iterators;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-import com.google.protobuf.ListValue;
-import com.google.protobuf.NullValue;
-import com.google.protobuf.Struct;
-import com.google.protobuf.Value;
-import java.util.AbstractMap;
-import java.util.AbstractSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * This class contains static utility methods that operate on or return protobuf's {@code Struct}
- * objects.
- */
-final class Structs {
-
- private Structs() {}
-
- /**
- * This class wraps a protobuf's {@code Struct} object and offers a map interface to it, hiding
- * protobuf types.
- */
- private static final class StructMap extends AbstractMap {
-
- private final Set> entrySet;
-
- private StructMap(Struct struct) {
- this.entrySet = new StructSet(struct);
- }
-
- private static final class StructSet extends AbstractSet> {
-
- private static Entry valueToObject(Entry entry) {
- return new AbstractMap.SimpleEntry<>(
- entry.getKey(), Structs.valueToObject(entry.getValue()));
- }
-
- private final Struct struct;
-
- private StructSet(Struct struct) {
- this.struct = struct;
- }
-
- @Override
- public Iterator> iterator() {
- return Iterators.transform(
- struct.getFieldsMap().entrySet().iterator(), StructSet::valueToObject);
- }
-
- @Override
- public int size() {
- return struct.getFieldsMap().size();
- }
- }
-
- @Override
- public Set> entrySet() {
- return entrySet;
- }
- }
-
- /** Returns an unmodifiable map view of the {@link Struct} parameter. */
- static Map asMap(Struct struct) {
- return new StructMap(checkNotNull(struct));
- }
-
- /**
- * Creates a new {@link Struct} object given the content of the provided {@code map} parameter.
- *
- *
Notice that all numbers (int, long, float and double) are serialized as double values. Enums
- * are serialized as strings.
- */
- static Struct newStruct(Map map) {
- Map valueMap = Maps.transformValues(checkNotNull(map), Structs::objectToValue);
- return Struct.newBuilder().putAllFields(valueMap).build();
- }
-
- private static Object valueToObject(Value value) {
- switch (value.getKindCase()) {
- case NULL_VALUE:
- return null;
- case NUMBER_VALUE:
- return value.getNumberValue();
- case STRING_VALUE:
- return value.getStringValue();
- case BOOL_VALUE:
- return value.getBoolValue();
- case STRUCT_VALUE:
- return new StructMap(value.getStructValue());
- case LIST_VALUE:
- return Lists.transform(value.getListValue().getValuesList(), Structs::valueToObject);
- default:
- throw new IllegalArgumentException(String.format("Unsupported protobuf value %s", value));
- }
- }
-
- @SuppressWarnings("unchecked")
- private static Value objectToValue(final Object obj) {
- Value.Builder builder = Value.newBuilder();
- if (obj == null) {
- builder.setNullValue(NullValue.NULL_VALUE);
- return builder.build();
- }
- Class> objClass = obj.getClass();
- if (obj instanceof String) {
- builder.setStringValue((String) obj);
- } else if (obj instanceof Number) {
- builder.setNumberValue(((Number) obj).doubleValue());
- } else if (obj instanceof Boolean) {
- builder.setBoolValue((Boolean) obj);
- } else if (obj instanceof Iterable> || objClass.isArray()) {
- builder.setListValue(
- ListValue.newBuilder()
- .addAllValues(Iterables.transform(Types.iterableOf(obj), Structs::objectToValue)));
- } else if (objClass.isEnum()) {
- builder.setStringValue(((Enum>) obj).name());
- } else if (obj instanceof Map) {
- Map map = (Map) obj;
- builder.setStructValue(newStruct(map));
- } else {
- throw new IllegalArgumentException(String.format("Unsupported protobuf value %s", obj));
- }
- return builder.build();
- }
-}
diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/ConfigClient.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/ConfigClient.java
index ee9fc8439..9f0de332d 100644
--- a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/ConfigClient.java
+++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/ConfigClient.java
@@ -124,19 +124,594 @@
*
Note: close() needs to be called on the ConfigClient object to clean up resources such as
* threads. In the example above, try-with-resources is used, which automatically calls close().
*
- *
The surface of this class includes several types of Java methods for each of the API's
- * methods:
- *
- *
- *
A "flattened" method. With this type of method, the fields of the request type have been
- * converted into function parameters. It may be the case that not all fields are available as
- * parameters, and not every API method will have a flattened method entry point.
- *
A "request object" method. This type of method only takes one parameter, a request object,
- * which must be constructed before the call. Not every API method will have a request object
- * method.
- *
A "callable" method. This type of method takes no parameters and returns an immutable API
- * callable object, which can be used to initiate calls to the service.
- *
+ *
+ *
Methods
+ *
+ *
Method
+ *
Description
+ *
Method Variants
+ *
+ *
+ *
ListBuckets
+ *
Lists log buckets.
+ *
+ *
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ *
listBuckets(ListBucketsRequest request)
+ *
+ *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ *
updateBucketAsyncOperationCallable()
+ *
updateBucketAsyncCallable()
+ *
+ *
+ *
+ *
+ *
CreateBucket
+ *
Creates a log bucket that can be used to store log entries. After a bucket has been created, the bucket's location cannot be changed.
+ *
+ *
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ *
createBucket(CreateBucketRequest request)
+ *
+ *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ *
createBucketCallable()
+ *
+ *
+ *
+ *
+ *
UpdateBucket
+ *
Updates a log bucket.
+ *
If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then `FAILED_PRECONDITION` will be returned.
+ *
After a bucket has been created, the bucket's location cannot be changed.
+ *
+ *
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ *
updateBucket(UpdateBucketRequest request)
+ *
+ *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ *
updateBucketCallable()
+ *
+ *
+ *
+ *
+ *
DeleteBucket
+ *
Deletes a log bucket.
+ *
Changes the bucket's `lifecycle_state` to the `DELETE_REQUESTED` state. After 7 days, the bucket will be purged and all log entries in the bucket will be permanently deleted.
+ *
+ *
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ *
deleteBucket(DeleteBucketRequest request)
+ *
+ *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ *
deleteBucketCallable()
+ *
+ *
+ *
+ *
+ *
UndeleteBucket
+ *
Undeletes a log bucket. A bucket that has been deleted can be undeleted within the grace period of 7 days.
+ *
+ *
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ *
undeleteBucket(UndeleteBucketRequest request)
+ *
+ *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ *
undeleteBucketCallable()
+ *
+ *
+ *
+ *
+ *
ListViews
+ *
Lists views on a log bucket.
+ *
+ *
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ *
listViews(ListViewsRequest request)
+ *
+ *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *
+ *
listViews(String parent)
+ *
+ *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ *
listViewsPagedCallable()
+ *
listViewsCallable()
+ *
+ *
+ *
+ *
+ *
GetView
+ *
Gets a view on a log bucket..
+ *
+ *
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ *
getView(GetViewRequest request)
+ *
+ *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ *
getViewCallable()
+ *
+ *
+ *
+ *
+ *
CreateView
+ *
Creates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views.
+ *
+ *
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ *
createView(CreateViewRequest request)
+ *
+ *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ *
createViewCallable()
+ *
+ *
+ *
+ *
+ *
UpdateView
+ *
Updates a view on a log bucket. This method replaces the following fields in the existing view with values from the new view: `filter`. If an `UNAVAILABLE` error is returned, this indicates that system is not in a state where it can update the view. If this occurs, please try again in a few minutes.
+ *
+ *
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ *
updateView(UpdateViewRequest request)
+ *
+ *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ *
updateViewCallable()
+ *
+ *
+ *
+ *
+ *
DeleteView
+ *
Deletes a view on a log bucket. If an `UNAVAILABLE` error is returned, this indicates that system is not in a state where it can delete the view. If this occurs, please try again in a few minutes.
+ *
+ *
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ *
deleteView(DeleteViewRequest request)
+ *
+ *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ *
deleteViewCallable()
+ *
+ *
+ *
+ *
+ *
ListSinks
+ *
Lists sinks.
+ *
+ *
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ *
listSinks(ListSinksRequest request)
+ *
+ *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *
+ *
listSinks(BillingAccountName parent)
+ *
listSinks(FolderName parent)
+ *
listSinks(OrganizationName parent)
+ *
listSinks(ProjectName parent)
+ *
listSinks(String parent)
+ *
+ *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ *
listSinksPagedCallable()
+ *
listSinksCallable()
+ *
+ *
+ *
+ *
+ *
GetSink
+ *
Gets a sink.
+ *
+ *
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ *
getSink(GetSinkRequest request)
+ *
+ *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *
+ *
getSink(LogSinkName sinkName)
+ *
getSink(String sinkName)
+ *
+ *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ *
getSinkCallable()
+ *
+ *
+ *
+ *
+ *
CreateSink
+ *
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.
+ *
+ *
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ *
createSink(CreateSinkRequest request)
+ *
+ *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ *
updateSinkCallable()
+ *
+ *
+ *
+ *
+ *
DeleteSink
+ *
Deletes a sink. If the sink has a unique `writer_identity`, then that service account is also deleted.
+ *
+ *
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ *
deleteSink(DeleteSinkRequest request)
+ *
+ *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *
+ *
deleteSink(LogSinkName sinkName)
+ *
deleteSink(String sinkName)
+ *
+ *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ *
deleteSinkCallable()
+ *
+ *
+ *
+ *
+ *
CreateLink
+ *
Asynchronously creates a linked dataset in BigQuery which makes it possible to use BigQuery to read the logs stored in the log bucket. A log bucket may currently only contain one link.
+ *
+ *
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ *
createLinkAsync(CreateLinkRequest request)
+ *
+ *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
+ *
+ *
createLinkAsync(LogBucketName parent, Link link, String linkId)
+ *
createLinkAsync(String parent, Link link, String linkId)
+ *
+ *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ *
createLinkOperationCallable()
+ *
createLinkCallable()
+ *
+ *
+ *
+ *
+ *
DeleteLink
+ *
Deletes a link. This will also delete the corresponding BigQuery linked dataset.
+ *
+ *
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ *
deleteLinkAsync(DeleteLinkRequest request)
+ *
+ *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
+ *
+ *
deleteLinkAsync(LinkName name)
+ *
deleteLinkAsync(String name)
+ *
+ *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ *
deleteLinkOperationCallable()
+ *
deleteLinkCallable()
+ *
+ *
+ *
+ *
+ *
ListLinks
+ *
Lists links.
+ *
+ *
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ *
listLinks(ListLinksRequest request)
+ *
+ *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *
+ *
listLinks(LogBucketName parent)
+ *
listLinks(String parent)
+ *
+ *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ *
listLinksPagedCallable()
+ *
listLinksCallable()
+ *
+ *
+ *
+ *
+ *
GetLink
+ *
Gets a link.
+ *
+ *
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ *
getLink(GetLinkRequest request)
+ *
+ *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *
+ *
getLink(LinkName name)
+ *
getLink(String name)
+ *
+ *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ *
getLinkCallable()
+ *
+ *
+ *
+ *
+ *
ListExclusions
+ *
Lists all the exclusions on the _Default sink in a parent resource.
+ *
+ *
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ *
listExclusions(ListExclusionsRequest request)
+ *
+ *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *
+ *
listExclusions(BillingAccountName parent)
+ *
listExclusions(FolderName parent)
+ *
listExclusions(OrganizationName parent)
+ *
listExclusions(ProjectName parent)
+ *
listExclusions(String parent)
+ *
+ *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ *
listExclusionsPagedCallable()
+ *
listExclusionsCallable()
+ *
+ *
+ *
+ *
+ *
GetExclusion
+ *
Gets the description of an exclusion in the _Default sink.
+ *
+ *
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ *
getExclusion(GetExclusionRequest request)
+ *
+ *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *
+ *
getExclusion(LogExclusionName name)
+ *
getExclusion(String name)
+ *
+ *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ *
getExclusionCallable()
+ *
+ *
+ *
+ *
+ *
CreateExclusion
+ *
Creates a new exclusion in the _Default sink 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.
+ *
+ *
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *
+ *
deleteExclusion(LogExclusionName name)
+ *
deleteExclusion(String name)
+ *
+ *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ *
deleteExclusionCallable()
+ *
+ *
+ *
+ *
+ *
GetCmekSettings
+ *
Gets the Logging CMEK settings for the given resource.
+ *
Note: CMEK for the Log Router can be configured for Google Cloud projects, folders, organizations and billing accounts. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.
+ *
See [Enabling CMEK for Log Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.
+ *
+ *
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ *
getCmekSettingsCallable()
+ *
+ *
+ *
+ *
+ *
UpdateCmekSettings
+ *
Updates the Log Router CMEK settings for the given resource.
+ *
Note: CMEK for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.
+ *
[UpdateCmekSettings][google.logging.v2.ConfigServiceV2.UpdateCmekSettings] will fail if 1) `kms_key_name` is invalid, or 2) the associated service account does not have the required `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or 3) access to the key is disabled.
+ *
See [Enabling CMEK for Log Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.
+ *
+ *
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ *
updateCmekSettingsCallable()
+ *
+ *
+ *
+ *
+ *
GetSettings
+ *
Gets the Log Router settings for the given resource.
+ *
Note: Settings for the Log Router can be get for Google Cloud projects, folders, organizations and billing accounts. Currently it can only be configured for organizations. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.
+ *
See [Enabling CMEK for Log Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.
+ *
+ *
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ *
getSettings(GetSettingsRequest request)
+ *
+ *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *
+ *
getSettings(SettingsName name)
+ *
getSettings(String name)
+ *
+ *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ *
getSettingsCallable()
+ *
+ *
+ *
+ *
+ *
UpdateSettings
+ *
Updates the Log Router settings for the given resource.
+ *
Note: Settings for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.
+ *
[UpdateSettings][google.logging.v2.ConfigServiceV2.UpdateSettings] will fail if 1) `kms_key_name` is invalid, or 2) the associated service account does not have the required `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or 3) access to the key is disabled. 4) `location_id` is not supported by Logging. 5) `location_id` violate OrgPolicy.
+ *
See [Enabling CMEK for Log Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.
+ *
+ *
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ *
updateSettings(UpdateSettingsRequest request)
+ *
+ *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ *
copyLogEntriesOperationCallable()
+ *
copyLogEntriesCallable()
+ *
+ *
+ *
+ *
*
*
See the individual methods for example code.
*
diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/LoggingClient.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/LoggingClient.java
index fad5b9664..48c133832 100644
--- a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/LoggingClient.java
+++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/LoggingClient.java
@@ -76,19 +76,119 @@
*
Note: close() needs to be called on the LoggingClient object to clean up resources such as
* threads. In the example above, try-with-resources is used, which automatically calls close().
*
- *
The surface of this class includes several types of Java methods for each of the API's
- * methods:
- *
- *
- *
A "flattened" method. With this type of method, the fields of the request type have been
- * converted into function parameters. It may be the case that not all fields are available as
- * parameters, and not every API method will have a flattened method entry point.
- *
A "request object" method. This type of method only takes one parameter, a request object,
- * which must be constructed before the call. Not every API method will have a request object
- * method.
- *
A "callable" method. This type of method takes no parameters and returns an immutable API
- * callable object, which can be used to initiate calls to the service.
- *
+ *
+ *
Methods
+ *
+ *
Method
+ *
Description
+ *
Method Variants
+ *
+ *
+ *
DeleteLog
+ *
Deletes all the log entries in a log for the _Default Log Bucket. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted.
+ *
+ *
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ *
deleteLog(DeleteLogRequest request)
+ *
+ *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *
+ *
deleteLog(LogName logName)
+ *
deleteLog(String logName)
+ *
+ *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ *
deleteLogCallable()
+ *
+ *
+ *
+ *
+ *
WriteLogEntries
+ *
Writes log entries to Logging. This API method is the only way to send log entries to Logging. This method is used, directly or indirectly, by the Logging agent (fluentd) and all logging libraries configured to use Logging. A single request may contain log entries for a maximum of 1000 different resources (projects, organizations, billing accounts or folders)
+ *
+ *
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ *
writeLogEntriesCallable()
+ *
+ *
+ *
+ *
+ *
ListLogEntries
+ *
Lists log entries. Use this method to retrieve log entries that originated from a project/folder/organization/billing account. For ways to export log entries, see [Exporting Logs](https://cloud.google.com/logging/docs/export).
+ *
+ *
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ *
listLogEntries(ListLogEntriesRequest request)
+ *
+ *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.
+ *
+ *
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ *
listLogs(ListLogsRequest request)
+ *
+ *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *
+ *
listLogs(BillingAccountName parent)
+ *
listLogs(FolderName parent)
+ *
listLogs(OrganizationName parent)
+ *
listLogs(ProjectName parent)
+ *
listLogs(String parent)
+ *
+ *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ *
listLogsPagedCallable()
+ *
listLogsCallable()
+ *
+ *
+ *
+ *
+ *
TailLogEntries
+ *
Streaming read of log entries as they are ingested. Until the stream is terminated, it will continue reading logs.
+ *
+ *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ *
tailLogEntriesCallable()
+ *
+ *
+ *
+ *
*
*
See the individual methods for example code.
*
diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/MetricsClient.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/MetricsClient.java
index a0306451a..c5e4ffe2e 100644
--- a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/MetricsClient.java
+++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/MetricsClient.java
@@ -64,19 +64,110 @@
*
Note: close() needs to be called on the MetricsClient object to clean up resources such as
* threads. In the example above, try-with-resources is used, which automatically calls close().
*
- *
The surface of this class includes several types of Java methods for each of the API's
- * methods:
- *
- *
- *
A "flattened" method. With this type of method, the fields of the request type have been
- * converted into function parameters. It may be the case that not all fields are available as
- * parameters, and not every API method will have a flattened method entry point.
- *
A "request object" method. This type of method only takes one parameter, a request object,
- * which must be constructed before the call. Not every API method will have a request object
- * method.
- *
A "callable" method. This type of method takes no parameters and returns an immutable API
- * callable object, which can be used to initiate calls to the service.
- *
+ *
+ *
Methods
+ *
+ *
Method
+ *
Description
+ *
Method Variants
+ *
+ *
+ *
ListLogMetrics
+ *
Lists logs-based metrics.
+ *
+ *
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ *
listLogMetrics(ListLogMetricsRequest request)
+ *
+ *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *
+ *
listLogMetrics(ProjectName parent)
+ *
listLogMetrics(String parent)
+ *
+ *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ *
listLogMetricsPagedCallable()
+ *
listLogMetricsCallable()
+ *
+ *
+ *
+ *
+ *
GetLogMetric
+ *
Gets a logs-based metric.
+ *
+ *
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ *
getLogMetric(GetLogMetricRequest request)
+ *
+ *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *
+ *
getLogMetric(LogMetricName metricName)
+ *
getLogMetric(String metricName)
+ *
+ *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ *
getLogMetricCallable()
+ *
+ *
+ *
+ *
+ *
CreateLogMetric
+ *
Creates a logs-based metric.
+ *
+ *
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *
+ *
deleteLogMetric(LogMetricName metricName)
+ *
deleteLogMetric(String metricName)
+ *
+ *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ *
deleteLogMetricCallable()
+ *
+ *
+ *
+ *
*
*
See the individual methods for example code.
*
diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java
index 6ba722e70..df6bdaee3 100644
--- a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java
+++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java
@@ -679,6 +679,21 @@ public ConfigServiceV2Stub createStub() throws IOException {
"Transport not supported: %s", getTransportChannelProvider().getTransportName()));
}
+ /** Returns the endpoint set by the user or the the service's default endpoint. */
+ @Override
+ public String getEndpoint() {
+ if (super.getEndpoint() != null) {
+ return super.getEndpoint();
+ }
+ return getDefaultEndpoint();
+ }
+
+ /** Returns the default service name. */
+ @Override
+ public String getServiceName() {
+ return "logging";
+ }
+
/** Returns a builder for the default ExecutorProvider for this service. */
public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
return InstantiatingExecutorProvider.newBuilder();
@@ -1060,7 +1075,6 @@ private static Builder createDefault() {
builder.setTransportChannelProvider(defaultTransportChannelProvider());
builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build());
builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build());
- builder.setEndpoint(getDefaultEndpoint());
builder.setMtlsEndpoint(getDefaultMtlsEndpoint());
builder.setSwitchToMtlsEndpointAllowed(true);
@@ -1575,6 +1589,15 @@ public UnaryCallSettings.Builder copyLogEntrie
return copyLogEntriesOperationSettings;
}
+ /** Returns the endpoint set by the user or the the service's default endpoint. */
+ @Override
+ public String getEndpoint() {
+ if (super.getEndpoint() != null) {
+ return super.getEndpoint();
+ }
+ return getDefaultEndpoint();
+ }
+
@Override
public ConfigServiceV2StubSettings build() throws IOException {
return new ConfigServiceV2StubSettings(this);
diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java
index 94f5d4c16..e96353717 100644
--- a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java
+++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java
@@ -438,6 +438,21 @@ public LoggingServiceV2Stub createStub() throws IOException {
"Transport not supported: %s", getTransportChannelProvider().getTransportName()));
}
+ /** Returns the endpoint set by the user or the the service's default endpoint. */
+ @Override
+ public String getEndpoint() {
+ if (super.getEndpoint() != null) {
+ return super.getEndpoint();
+ }
+ return getDefaultEndpoint();
+ }
+
+ /** Returns the default service name. */
+ @Override
+ public String getServiceName() {
+ return "logging";
+ }
+
/** Returns a builder for the default ExecutorProvider for this service. */
public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
return InstantiatingExecutorProvider.newBuilder();
@@ -636,7 +651,6 @@ private static Builder createDefault() {
builder.setTransportChannelProvider(defaultTransportChannelProvider());
builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build());
builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build());
- builder.setEndpoint(getDefaultEndpoint());
builder.setMtlsEndpoint(getDefaultMtlsEndpoint());
builder.setSwitchToMtlsEndpointAllowed(true);
@@ -742,6 +756,15 @@ public UnaryCallSettings.Builder deleteLogSettings() {
return tailLogEntriesSettings;
}
+ /** Returns the endpoint set by the user or the the service's default endpoint. */
+ @Override
+ public String getEndpoint() {
+ if (super.getEndpoint() != null) {
+ return super.getEndpoint();
+ }
+ return getDefaultEndpoint();
+ }
+
@Override
public LoggingServiceV2StubSettings build() throws IOException {
return new LoggingServiceV2StubSettings(this);
diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java
index 3d2e16f84..e7eefab52 100644
--- a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java
+++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java
@@ -206,6 +206,21 @@ public MetricsServiceV2Stub createStub() throws IOException {
"Transport not supported: %s", getTransportChannelProvider().getTransportName()));
}
+ /** Returns the endpoint set by the user or the the service's default endpoint. */
+ @Override
+ public String getEndpoint() {
+ if (super.getEndpoint() != null) {
+ return super.getEndpoint();
+ }
+ return getDefaultEndpoint();
+ }
+
+ /** Returns the default service name. */
+ @Override
+ public String getServiceName() {
+ return "logging";
+ }
+
/** Returns a builder for the default ExecutorProvider for this service. */
public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
return InstantiatingExecutorProvider.newBuilder();
@@ -381,7 +396,6 @@ private static Builder createDefault() {
builder.setTransportChannelProvider(defaultTransportChannelProvider());
builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build());
builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build());
- builder.setEndpoint(getDefaultEndpoint());
builder.setMtlsEndpoint(getDefaultMtlsEndpoint());
builder.setSwitchToMtlsEndpointAllowed(true);
@@ -459,6 +473,15 @@ public UnaryCallSettings.Builder deleteLogMetricS
return deleteLogMetricSettings;
}
+ /** Returns the endpoint set by the user or the the service's default endpoint. */
+ @Override
+ public String getEndpoint() {
+ if (super.getEndpoint() != null) {
+ return super.getEndpoint();
+ }
+ return getDefaultEndpoint();
+ }
+
@Override
public MetricsServiceV2StubSettings build() throws IOException {
return new MetricsServiceV2StubSettings(this);
diff --git a/google-cloud-logging/src/test/java/com/google/cloud/logging/StructsTest.java b/google-cloud-logging/src/test/java/com/google/cloud/logging/StructsTest.java
deleted file mode 100644
index b2654a735..000000000
--- a/google-cloud-logging/src/test/java/com/google/cloud/logging/StructsTest.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * 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.truth.Truth.assertThat;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import com.google.protobuf.ListValue;
-import com.google.protobuf.NullValue;
-import com.google.protobuf.Struct;
-import com.google.protobuf.Value;
-import java.util.HashMap;
-import java.util.Map;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
-
-@RunWith(JUnit4.class)
-public class StructsTest {
-
- private static final Double NUMBER = 42.0;
- private static final String STRING = "string";
- private static final Boolean BOOLEAN = true;
- private static final ImmutableList