diff --git a/java-assured-workloads/samples/install-without-bom/pom.xml b/java-assured-workloads/samples/install-without-bom/pom.xml deleted file mode 100644 index 59a787faeb2f..000000000000 --- a/java-assured-workloads/samples/install-without-bom/pom.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - 4.0.0 - com.google.cloud - -install-without-bom - jar - Google Assured Workloads for Government Install Without Bom - https://github.com/googleapis/java-assured-workloads - - - - com.google.cloud.samples - shared-configuration - 1.2.0 - - - - 1.8 - 1.8 - UTF-8 - - - - - - - com.google.cloud - google-cloud-assured-workloads - 2.3.0 - - - - - junit - junit - 4.13.2 - test - - - com.google.truth - truth - 1.1.3 - test - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 3.3.0 - - - add-snippets-source - - add-source - - - - ../snippets/src/main/java - - - - - add-snippets-tests - - add-test-source - - - - ../snippets/src/test/java - - - - - - - - diff --git a/java-assured-workloads/samples/pom.xml b/java-assured-workloads/samples/pom.xml deleted file mode 100644 index 0a0c8d8363f5..000000000000 --- a/java-assured-workloads/samples/pom.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - 4.0.0 - com.google.cloud - google-cloud--samples - 0.0.1-SNAPSHOT - pom - Google Assured Workloads for Government Samples Parent - https://github.com/googleapis/java-assured-workloads - - Java idiomatic client for Google Cloud Platform services. - - - - - com.google.cloud.samples - shared-configuration - 1.2.0 - - - - 1.8 - 1.8 - UTF-8 - - - - install-without-bom - snapshot - snippets - - - - - - org.apache.maven.plugins - maven-deploy-plugin - 2.8.2 - - true - - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.13 - - true - - - - - diff --git a/java-assured-workloads/samples/snapshot/pom.xml b/java-assured-workloads/samples/snapshot/pom.xml deleted file mode 100644 index 7fd19511f1b6..000000000000 --- a/java-assured-workloads/samples/snapshot/pom.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - 4.0.0 - com.google.cloud - -snapshot - jar - Google Assured Workloads for Government Snapshot Samples - https://github.com/googleapis/java-assured-workloads - - - - com.google.cloud.samples - shared-configuration - 1.2.0 - - - - 1.8 - 1.8 - UTF-8 - - - - - - com.google.cloud - google-cloud-assured-workloads - 2.3.0 - - - - - junit - junit - 4.13.2 - test - - - com.google.truth - truth - 1.1.3 - test - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 3.3.0 - - - add-snippets-source - - add-source - - - - ../snippets/src/main/java - - - - - add-snippets-tests - - add-test-source - - - - ../snippets/src/test/java - - - - - - - - diff --git a/java-assured-workloads/samples/snippets/pom.xml b/java-assured-workloads/samples/snippets/pom.xml deleted file mode 100644 index e924f0b7edce..000000000000 --- a/java-assured-workloads/samples/snippets/pom.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - 4.0.0 - com.google.cloud - -snippets - jar - Google Assured Workloads for Government Snippets - https://github.com/googleapis/java-assured-workloads - - - - com.google.cloud.samples - shared-configuration - 1.2.0 - - - - 1.8 - 1.8 - UTF-8 - - - - - - com.google.cloud - google-cloud-assured-workloads - 2.3.0 - - - - junit - junit - 4.13.2 - test - - - com.google.truth - truth - 1.1.3 - test - - - diff --git a/java-gke-connect-gateway/README.md b/java-gke-connect-gateway/README.md index c30b7bdc54c1..86bef2c71fb2 100644 --- a/java-gke-connect-gateway/README.md +++ b/java-gke-connect-gateway/README.md @@ -22,20 +22,20 @@ If you are using Maven, add this to your pom.xml file: com.google.cloud google-cloud-gke-connect-gateway - 0.4.5 + 0.4.6 ``` If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-gke-connect-gateway:0.4.5' +implementation 'com.google.cloud:google-cloud-gke-connect-gateway:0.4.6' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-gke-connect-gateway" % "0.4.5" +libraryDependencies += "com.google.cloud" % "google-cloud-gke-connect-gateway" % "0.4.6" ``` ## Authentication diff --git a/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayserviceclient/create/SyncCreateSetCredentialsProvider.java b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayserviceclient/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..9c71e5448547 --- /dev/null +++ b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayserviceclient/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 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 + * + * https://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.gkeconnect.gateway.v1beta1.samples; + +// [START gateway_v1beta1_generated_gatewayserviceclient_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.gkeconnect.gateway.v1beta1.GatewayServiceClient; +import com.google.cloud.gkeconnect.gateway.v1beta1.GatewayServiceSettings; +import com.google.cloud.gkeconnect.gateway.v1beta1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + GatewayServiceSettings gatewayServiceSettings = + GatewayServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + GatewayServiceClient gatewayServiceClient = GatewayServiceClient.create(gatewayServiceSettings); + } +} +// [END gateway_v1beta1_generated_gatewayserviceclient_create_setcredentialsprovider_sync] diff --git a/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayserviceclient/create/SyncCreateSetEndpoint.java b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayserviceclient/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..445d57800395 --- /dev/null +++ b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayserviceclient/create/SyncCreateSetEndpoint.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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 + * + * https://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.gkeconnect.gateway.v1beta1.samples; + +// [START gateway_v1beta1_generated_gatewayserviceclient_create_setendpoint_sync] +import com.google.cloud.gkeconnect.gateway.v1beta1.GatewayServiceClient; +import com.google.cloud.gkeconnect.gateway.v1beta1.GatewayServiceSettings; +import com.google.cloud.gkeconnect.gateway.v1beta1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + GatewayServiceSettings gatewayServiceSettings = + GatewayServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + GatewayServiceClient gatewayServiceClient = GatewayServiceClient.create(gatewayServiceSettings); + } +} +// [END gateway_v1beta1_generated_gatewayserviceclient_create_setendpoint_sync] diff --git a/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayserviceclient/deleteresource/AsyncDeleteResource.java b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayserviceclient/deleteresource/AsyncDeleteResource.java new file mode 100644 index 000000000000..968fd5f3c074 --- /dev/null +++ b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayserviceclient/deleteresource/AsyncDeleteResource.java @@ -0,0 +1,53 @@ +/* + * Copyright 2022 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 + * + * https://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.gkeconnect.gateway.v1beta1.samples; + +// [START gateway_v1beta1_generated_gatewayserviceclient_deleteresource_async] +import com.google.api.HttpBody; +import com.google.api.core.ApiFuture; +import com.google.cloud.gkeconnect.gateway.v1beta1.GatewayServiceClient; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import java.util.ArrayList; + +public class AsyncDeleteResource { + + public static void main(String[] args) throws Exception { + asyncDeleteResource(); + } + + public static void asyncDeleteResource() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (GatewayServiceClient gatewayServiceClient = GatewayServiceClient.create()) { + HttpBody request = + HttpBody.newBuilder() + .setContentType("contentType-389131437") + .setData(ByteString.EMPTY) + .addAllExtensions(new ArrayList()) + .build(); + ApiFuture future = + gatewayServiceClient.deleteResourceCallable().futureCall(request); + // Do something. + HttpBody response = future.get(); + } + } +} +// [END gateway_v1beta1_generated_gatewayserviceclient_deleteresource_async] diff --git a/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayserviceclient/deleteresource/SyncDeleteResource.java b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayserviceclient/deleteresource/SyncDeleteResource.java new file mode 100644 index 000000000000..b5a4759c805a --- /dev/null +++ b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayserviceclient/deleteresource/SyncDeleteResource.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 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 + * + * https://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.gkeconnect.gateway.v1beta1.samples; + +// [START gateway_v1beta1_generated_gatewayserviceclient_deleteresource_sync] +import com.google.api.HttpBody; +import com.google.cloud.gkeconnect.gateway.v1beta1.GatewayServiceClient; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import java.util.ArrayList; + +public class SyncDeleteResource { + + public static void main(String[] args) throws Exception { + syncDeleteResource(); + } + + public static void syncDeleteResource() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (GatewayServiceClient gatewayServiceClient = GatewayServiceClient.create()) { + HttpBody request = + HttpBody.newBuilder() + .setContentType("contentType-389131437") + .setData(ByteString.EMPTY) + .addAllExtensions(new ArrayList()) + .build(); + HttpBody response = gatewayServiceClient.deleteResource(request); + } + } +} +// [END gateway_v1beta1_generated_gatewayserviceclient_deleteresource_sync] diff --git a/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayserviceclient/getresource/AsyncGetResource.java b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayserviceclient/getresource/AsyncGetResource.java new file mode 100644 index 000000000000..7e68d1398e39 --- /dev/null +++ b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayserviceclient/getresource/AsyncGetResource.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 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 + * + * https://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.gkeconnect.gateway.v1beta1.samples; + +// [START gateway_v1beta1_generated_gatewayserviceclient_getresource_async] +import com.google.api.HttpBody; +import com.google.api.core.ApiFuture; +import com.google.cloud.gkeconnect.gateway.v1beta1.GatewayServiceClient; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import java.util.ArrayList; + +public class AsyncGetResource { + + public static void main(String[] args) throws Exception { + asyncGetResource(); + } + + public static void asyncGetResource() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (GatewayServiceClient gatewayServiceClient = GatewayServiceClient.create()) { + HttpBody request = + HttpBody.newBuilder() + .setContentType("contentType-389131437") + .setData(ByteString.EMPTY) + .addAllExtensions(new ArrayList()) + .build(); + ApiFuture future = gatewayServiceClient.getResourceCallable().futureCall(request); + // Do something. + HttpBody response = future.get(); + } + } +} +// [END gateway_v1beta1_generated_gatewayserviceclient_getresource_async] diff --git a/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayserviceclient/getresource/SyncGetResource.java b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayserviceclient/getresource/SyncGetResource.java new file mode 100644 index 000000000000..1b870b3dbf08 --- /dev/null +++ b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayserviceclient/getresource/SyncGetResource.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 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 + * + * https://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.gkeconnect.gateway.v1beta1.samples; + +// [START gateway_v1beta1_generated_gatewayserviceclient_getresource_sync] +import com.google.api.HttpBody; +import com.google.cloud.gkeconnect.gateway.v1beta1.GatewayServiceClient; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import java.util.ArrayList; + +public class SyncGetResource { + + public static void main(String[] args) throws Exception { + syncGetResource(); + } + + public static void syncGetResource() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (GatewayServiceClient gatewayServiceClient = GatewayServiceClient.create()) { + HttpBody request = + HttpBody.newBuilder() + .setContentType("contentType-389131437") + .setData(ByteString.EMPTY) + .addAllExtensions(new ArrayList()) + .build(); + HttpBody response = gatewayServiceClient.getResource(request); + } + } +} +// [END gateway_v1beta1_generated_gatewayserviceclient_getresource_sync] diff --git a/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayserviceclient/patchresource/AsyncPatchResource.java b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayserviceclient/patchresource/AsyncPatchResource.java new file mode 100644 index 000000000000..ed70b13e931e --- /dev/null +++ b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayserviceclient/patchresource/AsyncPatchResource.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 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 + * + * https://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.gkeconnect.gateway.v1beta1.samples; + +// [START gateway_v1beta1_generated_gatewayserviceclient_patchresource_async] +import com.google.api.HttpBody; +import com.google.api.core.ApiFuture; +import com.google.cloud.gkeconnect.gateway.v1beta1.GatewayServiceClient; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import java.util.ArrayList; + +public class AsyncPatchResource { + + public static void main(String[] args) throws Exception { + asyncPatchResource(); + } + + public static void asyncPatchResource() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (GatewayServiceClient gatewayServiceClient = GatewayServiceClient.create()) { + HttpBody request = + HttpBody.newBuilder() + .setContentType("contentType-389131437") + .setData(ByteString.EMPTY) + .addAllExtensions(new ArrayList()) + .build(); + ApiFuture future = gatewayServiceClient.patchResourceCallable().futureCall(request); + // Do something. + HttpBody response = future.get(); + } + } +} +// [END gateway_v1beta1_generated_gatewayserviceclient_patchresource_async] diff --git a/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayserviceclient/patchresource/SyncPatchResource.java b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayserviceclient/patchresource/SyncPatchResource.java new file mode 100644 index 000000000000..ede8f8439a68 --- /dev/null +++ b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayserviceclient/patchresource/SyncPatchResource.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 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 + * + * https://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.gkeconnect.gateway.v1beta1.samples; + +// [START gateway_v1beta1_generated_gatewayserviceclient_patchresource_sync] +import com.google.api.HttpBody; +import com.google.cloud.gkeconnect.gateway.v1beta1.GatewayServiceClient; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import java.util.ArrayList; + +public class SyncPatchResource { + + public static void main(String[] args) throws Exception { + syncPatchResource(); + } + + public static void syncPatchResource() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (GatewayServiceClient gatewayServiceClient = GatewayServiceClient.create()) { + HttpBody request = + HttpBody.newBuilder() + .setContentType("contentType-389131437") + .setData(ByteString.EMPTY) + .addAllExtensions(new ArrayList()) + .build(); + HttpBody response = gatewayServiceClient.patchResource(request); + } + } +} +// [END gateway_v1beta1_generated_gatewayserviceclient_patchresource_sync] diff --git a/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayserviceclient/postresource/AsyncPostResource.java b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayserviceclient/postresource/AsyncPostResource.java new file mode 100644 index 000000000000..c20017880714 --- /dev/null +++ b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayserviceclient/postresource/AsyncPostResource.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 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 + * + * https://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.gkeconnect.gateway.v1beta1.samples; + +// [START gateway_v1beta1_generated_gatewayserviceclient_postresource_async] +import com.google.api.HttpBody; +import com.google.api.core.ApiFuture; +import com.google.cloud.gkeconnect.gateway.v1beta1.GatewayServiceClient; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import java.util.ArrayList; + +public class AsyncPostResource { + + public static void main(String[] args) throws Exception { + asyncPostResource(); + } + + public static void asyncPostResource() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (GatewayServiceClient gatewayServiceClient = GatewayServiceClient.create()) { + HttpBody request = + HttpBody.newBuilder() + .setContentType("contentType-389131437") + .setData(ByteString.EMPTY) + .addAllExtensions(new ArrayList()) + .build(); + ApiFuture future = gatewayServiceClient.postResourceCallable().futureCall(request); + // Do something. + HttpBody response = future.get(); + } + } +} +// [END gateway_v1beta1_generated_gatewayserviceclient_postresource_async] diff --git a/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayserviceclient/postresource/SyncPostResource.java b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayserviceclient/postresource/SyncPostResource.java new file mode 100644 index 000000000000..b63e86223028 --- /dev/null +++ b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayserviceclient/postresource/SyncPostResource.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 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 + * + * https://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.gkeconnect.gateway.v1beta1.samples; + +// [START gateway_v1beta1_generated_gatewayserviceclient_postresource_sync] +import com.google.api.HttpBody; +import com.google.cloud.gkeconnect.gateway.v1beta1.GatewayServiceClient; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import java.util.ArrayList; + +public class SyncPostResource { + + public static void main(String[] args) throws Exception { + syncPostResource(); + } + + public static void syncPostResource() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (GatewayServiceClient gatewayServiceClient = GatewayServiceClient.create()) { + HttpBody request = + HttpBody.newBuilder() + .setContentType("contentType-389131437") + .setData(ByteString.EMPTY) + .addAllExtensions(new ArrayList()) + .build(); + HttpBody response = gatewayServiceClient.postResource(request); + } + } +} +// [END gateway_v1beta1_generated_gatewayserviceclient_postresource_sync] diff --git a/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayserviceclient/putresource/AsyncPutResource.java b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayserviceclient/putresource/AsyncPutResource.java new file mode 100644 index 000000000000..765d217330ba --- /dev/null +++ b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayserviceclient/putresource/AsyncPutResource.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 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 + * + * https://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.gkeconnect.gateway.v1beta1.samples; + +// [START gateway_v1beta1_generated_gatewayserviceclient_putresource_async] +import com.google.api.HttpBody; +import com.google.api.core.ApiFuture; +import com.google.cloud.gkeconnect.gateway.v1beta1.GatewayServiceClient; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import java.util.ArrayList; + +public class AsyncPutResource { + + public static void main(String[] args) throws Exception { + asyncPutResource(); + } + + public static void asyncPutResource() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (GatewayServiceClient gatewayServiceClient = GatewayServiceClient.create()) { + HttpBody request = + HttpBody.newBuilder() + .setContentType("contentType-389131437") + .setData(ByteString.EMPTY) + .addAllExtensions(new ArrayList()) + .build(); + ApiFuture future = gatewayServiceClient.putResourceCallable().futureCall(request); + // Do something. + HttpBody response = future.get(); + } + } +} +// [END gateway_v1beta1_generated_gatewayserviceclient_putresource_async] diff --git a/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayserviceclient/putresource/SyncPutResource.java b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayserviceclient/putresource/SyncPutResource.java new file mode 100644 index 000000000000..521c76fca9a8 --- /dev/null +++ b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayserviceclient/putresource/SyncPutResource.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 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 + * + * https://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.gkeconnect.gateway.v1beta1.samples; + +// [START gateway_v1beta1_generated_gatewayserviceclient_putresource_sync] +import com.google.api.HttpBody; +import com.google.cloud.gkeconnect.gateway.v1beta1.GatewayServiceClient; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import java.util.ArrayList; + +public class SyncPutResource { + + public static void main(String[] args) throws Exception { + syncPutResource(); + } + + public static void syncPutResource() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (GatewayServiceClient gatewayServiceClient = GatewayServiceClient.create()) { + HttpBody request = + HttpBody.newBuilder() + .setContentType("contentType-389131437") + .setData(ByteString.EMPTY) + .addAllExtensions(new ArrayList()) + .build(); + HttpBody response = gatewayServiceClient.putResource(request); + } + } +} +// [END gateway_v1beta1_generated_gatewayserviceclient_putresource_sync] diff --git a/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservicesettings/getresource/SyncGetResource.java b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservicesettings/getresource/SyncGetResource.java new file mode 100644 index 000000000000..5ebdeb853720 --- /dev/null +++ b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservicesettings/getresource/SyncGetResource.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 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 + * + * https://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.gkeconnect.gateway.v1beta1.samples; + +// [START gateway_v1beta1_generated_gatewayservicesettings_getresource_sync] +import com.google.cloud.gkeconnect.gateway.v1beta1.GatewayServiceSettings; +import java.time.Duration; + +public class SyncGetResource { + + public static void main(String[] args) throws Exception { + syncGetResource(); + } + + public static void syncGetResource() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + GatewayServiceSettings.Builder gatewayServiceSettingsBuilder = + GatewayServiceSettings.newBuilder(); + gatewayServiceSettingsBuilder + .getResourceSettings() + .setRetrySettings( + gatewayServiceSettingsBuilder.getResourceSettings().getRetrySettings().toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + GatewayServiceSettings gatewayServiceSettings = gatewayServiceSettingsBuilder.build(); + } +} +// [END gateway_v1beta1_generated_gatewayservicesettings_getresource_sync] diff --git a/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/stub/gatewayservicestubsettings/getresource/SyncGetResource.java b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/stub/gatewayservicestubsettings/getresource/SyncGetResource.java new file mode 100644 index 000000000000..6210e35f8e3f --- /dev/null +++ b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/stub/gatewayservicestubsettings/getresource/SyncGetResource.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 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 + * + * https://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.gkeconnect.gateway.v1beta1.stub.samples; + +// [START gateway_v1beta1_generated_gatewayservicestubsettings_getresource_sync] +import com.google.cloud.gkeconnect.gateway.v1beta1.stub.GatewayServiceStubSettings; +import java.time.Duration; + +public class SyncGetResource { + + public static void main(String[] args) throws Exception { + syncGetResource(); + } + + public static void syncGetResource() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + GatewayServiceStubSettings.Builder gatewayServiceSettingsBuilder = + GatewayServiceStubSettings.newBuilder(); + gatewayServiceSettingsBuilder + .getResourceSettings() + .setRetrySettings( + gatewayServiceSettingsBuilder.getResourceSettings().getRetrySettings().toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + GatewayServiceStubSettings gatewayServiceSettings = gatewayServiceSettingsBuilder.build(); + } +} +// [END gateway_v1beta1_generated_gatewayservicestubsettings_getresource_sync] diff --git a/java-grafeas/samples/install-without-bom/pom.xml b/java-grafeas/samples/install-without-bom/pom.xml deleted file mode 100644 index d7ffd9335f22..000000000000 --- a/java-grafeas/samples/install-without-bom/pom.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - 4.0.0 - com.google.cloud - -install-without-bom - jar - Google Grafeas Install Without Bom - https://github.com/googleapis/java-grafeas - - - - com.google.cloud.samples - shared-configuration - 1.2.0 - - - - 1.8 - 1.8 - UTF-8 - - - - - - - io.grafeas - grafeas - 2.4.7 - - - - - junit - junit - 4.13.2 - test - - - com.google.truth - truth - 1.1.3 - test - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 3.3.0 - - - add-snippets-source - - add-source - - - - ../snippets/src/main/java - - - - - add-snippets-tests - - add-test-source - - - - ../snippets/src/test/java - - - - - - - - diff --git a/java-grafeas/samples/pom.xml b/java-grafeas/samples/pom.xml deleted file mode 100644 index 8cd185039b39..000000000000 --- a/java-grafeas/samples/pom.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - 4.0.0 - com.google.cloud - google-cloud--samples - 0.0.1-SNAPSHOT - pom - Google Grafeas Samples Parent - https://github.com/googleapis/java-grafeas - - Java idiomatic client for Google Cloud Platform services. - - - - - com.google.cloud.samples - shared-configuration - 1.2.0 - - - - 1.8 - 1.8 - UTF-8 - - - - install-without-bom - snapshot - snippets - - - - - - org.apache.maven.plugins - maven-deploy-plugin - 2.8.2 - - true - - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.13 - - true - - - - - diff --git a/java-grafeas/samples/snapshot/pom.xml b/java-grafeas/samples/snapshot/pom.xml deleted file mode 100644 index cca6d76c7b3a..000000000000 --- a/java-grafeas/samples/snapshot/pom.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - 4.0.0 - com.google.cloud - -snapshot - jar - Google Grafeas Snapshot Samples - https://github.com/googleapis/java-grafeas - - - - com.google.cloud.samples - shared-configuration - 1.2.0 - - - - 1.8 - 1.8 - UTF-8 - - - - - - io.grafeas - grafeas - 2.4.7 - - - - - junit - junit - 4.13.2 - test - - - com.google.truth - truth - 1.1.3 - test - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 3.3.0 - - - add-snippets-source - - add-source - - - - ../snippets/src/main/java - - - - - add-snippets-tests - - add-test-source - - - - ../snippets/src/test/java - - - - - - - - diff --git a/java-grafeas/samples/snippets/pom.xml b/java-grafeas/samples/snippets/pom.xml deleted file mode 100644 index 2ab3bb29ee7e..000000000000 --- a/java-grafeas/samples/snippets/pom.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - 4.0.0 - com.google.cloud - -snippets - jar - Google Grafeas Snippets - https://github.com/googleapis/java-grafeas - - - - com.google.cloud.samples - shared-configuration - 1.2.0 - - - - 1.8 - 1.8 - UTF-8 - - - - - - io.grafeas - grafeas - 2.4.7 - - - - junit - junit - 4.13.2 - test - - - com.google.truth - truth - 1.1.3 - test - - - diff --git a/java-speech/samples/install-without-bom/pom.xml b/java-speech/samples/install-without-bom/pom.xml deleted file mode 100644 index b34bcc71b59e..000000000000 --- a/java-speech/samples/install-without-bom/pom.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - 4.0.0 - com.google.cloud - -install-without-bom - jar - Google Cloud Speech Install Without Bom - https://github.com/googleapis/java-speech - - - - com.google.cloud.samples - shared-configuration - 1.2.0 - - - - 1.8 - 1.8 - UTF-8 - - - - - - - com.google.cloud - google-cloud-speech - 2.6.0 - - - - - junit - junit - 4.13.2 - test - - - com.google.truth - truth - 1.1.3 - test - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 3.3.0 - - - add-snippets-source - - add-source - - - - ../snippets/src/main/java - - - - - add-snippets-tests - - add-test-source - - - - ../snippets/src/test/java - - - - - - - - diff --git a/java-speech/samples/pom.xml b/java-speech/samples/pom.xml deleted file mode 100644 index e09065f9a876..000000000000 --- a/java-speech/samples/pom.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - 4.0.0 - com.google.cloud - google-cloud--samples - 0.0.1-SNAPSHOT - pom - Google Cloud Speech Samples Parent - https://github.com/googleapis/java-speech - - Java idiomatic client for Google Cloud Platform services. - - - - - com.google.cloud.samples - shared-configuration - 1.2.0 - - - - 1.8 - 1.8 - UTF-8 - - - - install-without-bom - snapshot - snippets - - - - - - org.apache.maven.plugins - maven-deploy-plugin - 2.8.2 - - true - - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.13 - - true - - - - - diff --git a/java-speech/samples/snapshot/pom.xml b/java-speech/samples/snapshot/pom.xml deleted file mode 100644 index cda9313cdadb..000000000000 --- a/java-speech/samples/snapshot/pom.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - 4.0.0 - com.google.cloud - -snapshot - jar - Google Cloud Speech Snapshot Samples - https://github.com/googleapis/java-speech - - - - com.google.cloud.samples - shared-configuration - 1.2.0 - - - - 1.8 - 1.8 - UTF-8 - - - - - - com.google.cloud - google-cloud-speech - 2.6.0 - - - - - junit - junit - 4.13.2 - test - - - com.google.truth - truth - 1.1.3 - test - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 3.3.0 - - - add-snippets-source - - add-source - - - - ../snippets/src/main/java - - - - - add-snippets-tests - - add-test-source - - - - ../snippets/src/test/java - - - - - - - - diff --git a/java-speech/samples/snippets/pom.xml b/java-speech/samples/snippets/pom.xml deleted file mode 100644 index 82916d785c38..000000000000 --- a/java-speech/samples/snippets/pom.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - 4.0.0 - com.google.cloud - -snippets - jar - Google Cloud Speech Snippets - https://github.com/googleapis/java-speech - - - - com.google.cloud.samples - shared-configuration - 1.2.0 - - - - 1.8 - 1.8 - UTF-8 - - - - - - com.google.cloud - google-cloud-speech - 2.6.0 - - - - junit - junit - 4.13.2 - test - - - com.google.truth - truth - 1.1.3 - test - - -