getNodesList();
+ /**
+ *
+ *
+ *
+ * Names of the nodes to go under maintenance simulation.
+ *
+ *
+ * repeated string nodes = 104993457;
+ *
+ * @return The count of nodes.
+ */
+ int getNodesCount();
+ /**
+ *
+ *
+ *
+ * Names of the nodes to go under maintenance simulation.
+ *
+ *
+ * repeated string nodes = 104993457;
+ *
+ * @param index The index of the element to return.
+ * @return The nodes at the given index.
+ */
+ java.lang.String getNodes(int index);
+ /**
+ *
+ *
+ *
+ * Names of the nodes to go under maintenance simulation.
+ *
+ *
+ * repeated string nodes = 104993457;
+ *
+ * @param index The index of the value to return.
+ * @return The bytes of the nodes at the given index.
+ */
+ com.google.protobuf.ByteString getNodesBytes(int index);
+}
diff --git a/java-compute/proto-google-cloud-compute-v1/src/main/java/com/google/cloud/compute/v1/SimulateMaintenanceEventNodeGroupRequest.java b/java-compute/proto-google-cloud-compute-v1/src/main/java/com/google/cloud/compute/v1/SimulateMaintenanceEventNodeGroupRequest.java
new file mode 100644
index 000000000000..a2bc93b0bea2
--- /dev/null
+++ b/java-compute/proto-google-cloud-compute-v1/src/main/java/com/google/cloud/compute/v1/SimulateMaintenanceEventNodeGroupRequest.java
@@ -0,0 +1,1572 @@
+/*
+ * Copyright 2020 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.
+ */
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: google/cloud/compute/v1/compute.proto
+
+package com.google.cloud.compute.v1;
+
+/**
+ *
+ *
+ *
+ * A request message for NodeGroups.SimulateMaintenanceEvent. See the method description for details.
+ *
+ *
+ * Protobuf type {@code google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest}
+ */
+public final class SimulateMaintenanceEventNodeGroupRequest
+ extends com.google.protobuf.GeneratedMessageV3
+ implements
+ // @@protoc_insertion_point(message_implements:google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest)
+ SimulateMaintenanceEventNodeGroupRequestOrBuilder {
+ private static final long serialVersionUID = 0L;
+ // Use SimulateMaintenanceEventNodeGroupRequest.newBuilder() to construct.
+ private SimulateMaintenanceEventNodeGroupRequest(
+ com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ super(builder);
+ }
+
+ private SimulateMaintenanceEventNodeGroupRequest() {
+ nodeGroup_ = "";
+ project_ = "";
+ requestId_ = "";
+ zone_ = "";
+ }
+
+ @java.lang.Override
+ @SuppressWarnings({"unused"})
+ protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
+ return new SimulateMaintenanceEventNodeGroupRequest();
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
+ return this.unknownFields;
+ }
+
+ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
+ return com.google.cloud.compute.v1.Compute
+ .internal_static_google_cloud_compute_v1_SimulateMaintenanceEventNodeGroupRequest_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.cloud.compute.v1.Compute
+ .internal_static_google_cloud_compute_v1_SimulateMaintenanceEventNodeGroupRequest_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest.class,
+ com.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest.Builder.class);
+ }
+
+ private int bitField0_;
+ public static final int NODE_GROUP_FIELD_NUMBER = 469958146;
+
+ @SuppressWarnings("serial")
+ private volatile java.lang.Object nodeGroup_ = "";
+ /**
+ *
+ *
+ *
+ * Name of the NodeGroup resource whose nodes will go under maintenance simulation.
+ *
+ *
+ * string node_group = 469958146 [(.google.api.field_behavior) = REQUIRED];
+ *
+ * @return The nodeGroup.
+ */
+ @java.lang.Override
+ public java.lang.String getNodeGroup() {
+ java.lang.Object ref = nodeGroup_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ nodeGroup_ = s;
+ return s;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * Name of the NodeGroup resource whose nodes will go under maintenance simulation.
+ *
+ *
+ * string node_group = 469958146 [(.google.api.field_behavior) = REQUIRED];
+ *
+ * @return The bytes for nodeGroup.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString getNodeGroupBytes() {
+ java.lang.Object ref = nodeGroup_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ nodeGroup_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int NODE_GROUPS_SIMULATE_MAINTENANCE_EVENT_REQUEST_RESOURCE_FIELD_NUMBER =
+ 351468764;
+ private com.google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest
+ nodeGroupsSimulateMaintenanceEventRequestResource_;
+ /**
+ *
+ *
+ *
+ * The body resource for this request
+ *
+ *
+ *
+ * .google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest node_groups_simulate_maintenance_event_request_resource = 351468764 [(.google.api.field_behavior) = REQUIRED];
+ *
+ *
+ * @return Whether the nodeGroupsSimulateMaintenanceEventRequestResource field is set.
+ */
+ @java.lang.Override
+ public boolean hasNodeGroupsSimulateMaintenanceEventRequestResource() {
+ return nodeGroupsSimulateMaintenanceEventRequestResource_ != null;
+ }
+ /**
+ *
+ *
+ *
+ * The body resource for this request
+ *
+ *
+ *
+ * .google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest node_groups_simulate_maintenance_event_request_resource = 351468764 [(.google.api.field_behavior) = REQUIRED];
+ *
+ *
+ * @return The nodeGroupsSimulateMaintenanceEventRequestResource.
+ */
+ @java.lang.Override
+ public com.google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest
+ getNodeGroupsSimulateMaintenanceEventRequestResource() {
+ return nodeGroupsSimulateMaintenanceEventRequestResource_ == null
+ ? com.google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest.getDefaultInstance()
+ : nodeGroupsSimulateMaintenanceEventRequestResource_;
+ }
+ /**
+ *
+ *
+ *
+ * The body resource for this request
+ *
+ *
+ *
+ * .google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest node_groups_simulate_maintenance_event_request_resource = 351468764 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ @java.lang.Override
+ public com.google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequestOrBuilder
+ getNodeGroupsSimulateMaintenanceEventRequestResourceOrBuilder() {
+ return nodeGroupsSimulateMaintenanceEventRequestResource_ == null
+ ? com.google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest.getDefaultInstance()
+ : nodeGroupsSimulateMaintenanceEventRequestResource_;
+ }
+
+ public static final int PROJECT_FIELD_NUMBER = 227560217;
+
+ @SuppressWarnings("serial")
+ private volatile java.lang.Object project_ = "";
+ /**
+ *
+ *
+ *
+ * Project ID for this request.
+ *
+ *
+ *
+ * string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"];
+ *
+ *
+ * @return The project.
+ */
+ @java.lang.Override
+ public java.lang.String getProject() {
+ java.lang.Object ref = project_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ project_ = s;
+ return s;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * Project ID for this request.
+ *
+ *
+ *
+ * string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"];
+ *
+ *
+ * @return The bytes for project.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString getProjectBytes() {
+ java.lang.Object ref = project_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ project_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int REQUEST_ID_FIELD_NUMBER = 37109963;
+
+ @SuppressWarnings("serial")
+ private volatile java.lang.Object requestId_ = "";
+ /**
+ *
+ *
+ *
+ * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
+ *
+ *
+ * optional string request_id = 37109963;
+ *
+ * @return Whether the requestId field is set.
+ */
+ @java.lang.Override
+ public boolean hasRequestId() {
+ return ((bitField0_ & 0x00000001) != 0);
+ }
+ /**
+ *
+ *
+ *
+ * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
+ *
+ *
+ * optional string request_id = 37109963;
+ *
+ * @return The requestId.
+ */
+ @java.lang.Override
+ public java.lang.String getRequestId() {
+ java.lang.Object ref = requestId_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ requestId_ = s;
+ return s;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
+ *
+ *
+ * optional string request_id = 37109963;
+ *
+ * @return The bytes for requestId.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString getRequestIdBytes() {
+ java.lang.Object ref = requestId_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ requestId_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int ZONE_FIELD_NUMBER = 3744684;
+
+ @SuppressWarnings("serial")
+ private volatile java.lang.Object zone_ = "";
+ /**
+ *
+ *
+ *
+ * The name of the zone for this request.
+ *
+ *
+ *
+ * string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"];
+ *
+ *
+ * @return The zone.
+ */
+ @java.lang.Override
+ public java.lang.String getZone() {
+ java.lang.Object ref = zone_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ zone_ = s;
+ return s;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * The name of the zone for this request.
+ *
+ *
+ *
+ * string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"];
+ *
+ *
+ * @return The bytes for zone.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString getZoneBytes() {
+ java.lang.Object ref = zone_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ zone_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ private byte memoizedIsInitialized = -1;
+
+ @java.lang.Override
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ @java.lang.Override
+ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(zone_)) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 3744684, zone_);
+ }
+ if (((bitField0_ & 0x00000001) != 0)) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 37109963, requestId_);
+ }
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(project_)) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 227560217, project_);
+ }
+ if (nodeGroupsSimulateMaintenanceEventRequestResource_ != null) {
+ output.writeMessage(351468764, getNodeGroupsSimulateMaintenanceEventRequestResource());
+ }
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nodeGroup_)) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 469958146, nodeGroup_);
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(zone_)) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3744684, zone_);
+ }
+ if (((bitField0_ & 0x00000001) != 0)) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(37109963, requestId_);
+ }
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(project_)) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(227560217, project_);
+ }
+ if (nodeGroupsSimulateMaintenanceEventRequestResource_ != null) {
+ size +=
+ com.google.protobuf.CodedOutputStream.computeMessageSize(
+ 351468764, getNodeGroupsSimulateMaintenanceEventRequestResource());
+ }
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nodeGroup_)) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(469958146, nodeGroup_);
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof com.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest)) {
+ return super.equals(obj);
+ }
+ com.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest other =
+ (com.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest) obj;
+
+ if (!getNodeGroup().equals(other.getNodeGroup())) return false;
+ if (hasNodeGroupsSimulateMaintenanceEventRequestResource()
+ != other.hasNodeGroupsSimulateMaintenanceEventRequestResource()) return false;
+ if (hasNodeGroupsSimulateMaintenanceEventRequestResource()) {
+ if (!getNodeGroupsSimulateMaintenanceEventRequestResource()
+ .equals(other.getNodeGroupsSimulateMaintenanceEventRequestResource())) return false;
+ }
+ if (!getProject().equals(other.getProject())) return false;
+ if (hasRequestId() != other.hasRequestId()) return false;
+ if (hasRequestId()) {
+ if (!getRequestId().equals(other.getRequestId())) return false;
+ }
+ if (!getZone().equals(other.getZone())) return false;
+ if (!getUnknownFields().equals(other.getUnknownFields())) return false;
+ return true;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ hash = (37 * hash) + NODE_GROUP_FIELD_NUMBER;
+ hash = (53 * hash) + getNodeGroup().hashCode();
+ if (hasNodeGroupsSimulateMaintenanceEventRequestResource()) {
+ hash = (37 * hash) + NODE_GROUPS_SIMULATE_MAINTENANCE_EVENT_REQUEST_RESOURCE_FIELD_NUMBER;
+ hash = (53 * hash) + getNodeGroupsSimulateMaintenanceEventRequestResource().hashCode();
+ }
+ hash = (37 * hash) + PROJECT_FIELD_NUMBER;
+ hash = (53 * hash) + getProject().hashCode();
+ if (hasRequestId()) {
+ hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER;
+ hash = (53 * hash) + getRequestId().hashCode();
+ }
+ hash = (37 * hash) + ZONE_FIELD_NUMBER;
+ hash = (53 * hash) + getZone().hashCode();
+ hash = (29 * hash) + getUnknownFields().hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest parseFrom(
+ java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest parseFrom(
+ java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest parseFrom(
+ byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest parseFrom(
+ byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest parseFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest parseFrom(
+ java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
+ PARSER, input, extensionRegistry);
+ }
+
+ public static com.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest
+ parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
+ }
+
+ public static com.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest
+ parseDelimitedFrom(
+ java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
+ PARSER, input, extensionRegistry);
+ }
+
+ public static com.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest parseFrom(
+ com.google.protobuf.CodedInputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
+ PARSER, input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() {
+ return newBuilder();
+ }
+
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+
+ public static Builder newBuilder(
+ com.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+
+ @java.lang.Override
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ *
+ *
+ *
+ * A request message for NodeGroups.SimulateMaintenanceEvent. See the method description for details.
+ *
+ *
+ * Protobuf type {@code google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest}
+ */
+ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
+ implements
+ // @@protoc_insertion_point(builder_implements:google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest)
+ com.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequestOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
+ return com.google.cloud.compute.v1.Compute
+ .internal_static_google_cloud_compute_v1_SimulateMaintenanceEventNodeGroupRequest_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.cloud.compute.v1.Compute
+ .internal_static_google_cloud_compute_v1_SimulateMaintenanceEventNodeGroupRequest_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest.class,
+ com.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest.Builder.class);
+ }
+
+ // Construct using
+ // com.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest.newBuilder()
+ private Builder() {}
+
+ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ super(parent);
+ }
+
+ @java.lang.Override
+ public Builder clear() {
+ super.clear();
+ bitField0_ = 0;
+ nodeGroup_ = "";
+ nodeGroupsSimulateMaintenanceEventRequestResource_ = null;
+ if (nodeGroupsSimulateMaintenanceEventRequestResourceBuilder_ != null) {
+ nodeGroupsSimulateMaintenanceEventRequestResourceBuilder_.dispose();
+ nodeGroupsSimulateMaintenanceEventRequestResourceBuilder_ = null;
+ }
+ project_ = "";
+ requestId_ = "";
+ zone_ = "";
+ return this;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
+ return com.google.cloud.compute.v1.Compute
+ .internal_static_google_cloud_compute_v1_SimulateMaintenanceEventNodeGroupRequest_descriptor;
+ }
+
+ @java.lang.Override
+ public com.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest
+ getDefaultInstanceForType() {
+ return com.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest
+ .getDefaultInstance();
+ }
+
+ @java.lang.Override
+ public com.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest build() {
+ com.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ @java.lang.Override
+ public com.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest buildPartial() {
+ com.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest result =
+ new com.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest(this);
+ if (bitField0_ != 0) {
+ buildPartial0(result);
+ }
+ onBuilt();
+ return result;
+ }
+
+ private void buildPartial0(
+ com.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest result) {
+ int from_bitField0_ = bitField0_;
+ if (((from_bitField0_ & 0x00000001) != 0)) {
+ result.nodeGroup_ = nodeGroup_;
+ }
+ if (((from_bitField0_ & 0x00000002) != 0)) {
+ result.nodeGroupsSimulateMaintenanceEventRequestResource_ =
+ nodeGroupsSimulateMaintenanceEventRequestResourceBuilder_ == null
+ ? nodeGroupsSimulateMaintenanceEventRequestResource_
+ : nodeGroupsSimulateMaintenanceEventRequestResourceBuilder_.build();
+ }
+ if (((from_bitField0_ & 0x00000004) != 0)) {
+ result.project_ = project_;
+ }
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000008) != 0)) {
+ result.requestId_ = requestId_;
+ to_bitField0_ |= 0x00000001;
+ }
+ if (((from_bitField0_ & 0x00000010) != 0)) {
+ result.zone_ = zone_;
+ }
+ result.bitField0_ |= to_bitField0_;
+ }
+
+ @java.lang.Override
+ public Builder clone() {
+ return super.clone();
+ }
+
+ @java.lang.Override
+ public Builder setField(
+ com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
+ return super.setField(field, value);
+ }
+
+ @java.lang.Override
+ public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
+ return super.clearField(field);
+ }
+
+ @java.lang.Override
+ public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
+ return super.clearOneof(oneof);
+ }
+
+ @java.lang.Override
+ public Builder setRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
+ return super.setRepeatedField(field, index, value);
+ }
+
+ @java.lang.Override
+ public Builder addRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
+ return super.addRepeatedField(field, value);
+ }
+
+ @java.lang.Override
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof com.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest) {
+ return mergeFrom(
+ (com.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest) other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(
+ com.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest other) {
+ if (other
+ == com.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest
+ .getDefaultInstance()) return this;
+ if (!other.getNodeGroup().isEmpty()) {
+ nodeGroup_ = other.nodeGroup_;
+ bitField0_ |= 0x00000001;
+ onChanged();
+ }
+ if (other.hasNodeGroupsSimulateMaintenanceEventRequestResource()) {
+ mergeNodeGroupsSimulateMaintenanceEventRequestResource(
+ other.getNodeGroupsSimulateMaintenanceEventRequestResource());
+ }
+ if (!other.getProject().isEmpty()) {
+ project_ = other.project_;
+ bitField0_ |= 0x00000004;
+ onChanged();
+ }
+ if (other.hasRequestId()) {
+ requestId_ = other.requestId_;
+ bitField0_ |= 0x00000008;
+ onChanged();
+ }
+ if (!other.getZone().isEmpty()) {
+ zone_ = other.zone_;
+ bitField0_ |= 0x00000010;
+ onChanged();
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ onChanged();
+ return this;
+ }
+
+ @java.lang.Override
+ public final boolean isInitialized() {
+ return true;
+ }
+
+ @java.lang.Override
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ if (extensionRegistry == null) {
+ throw new java.lang.NullPointerException();
+ }
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ case 29957474:
+ {
+ zone_ = input.readStringRequireUtf8();
+ bitField0_ |= 0x00000010;
+ break;
+ } // case 29957474
+ case 296879706:
+ {
+ requestId_ = input.readStringRequireUtf8();
+ bitField0_ |= 0x00000008;
+ break;
+ } // case 296879706
+ case 1820481738:
+ {
+ project_ = input.readStringRequireUtf8();
+ bitField0_ |= 0x00000004;
+ break;
+ } // case 1820481738
+ case -1483217182:
+ {
+ input.readMessage(
+ getNodeGroupsSimulateMaintenanceEventRequestResourceFieldBuilder().getBuilder(),
+ extensionRegistry);
+ bitField0_ |= 0x00000002;
+ break;
+ } // case -1483217182
+ case -535302126:
+ {
+ nodeGroup_ = input.readStringRequireUtf8();
+ bitField0_ |= 0x00000001;
+ break;
+ } // case -535302126
+ default:
+ {
+ if (!super.parseUnknownField(input, extensionRegistry, tag)) {
+ done = true; // was an endgroup tag
+ }
+ break;
+ } // default:
+ } // switch (tag)
+ } // while (!done)
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.unwrapIOException();
+ } finally {
+ onChanged();
+ } // finally
+ return this;
+ }
+
+ private int bitField0_;
+
+ private java.lang.Object nodeGroup_ = "";
+ /**
+ *
+ *
+ *
+ * Name of the NodeGroup resource whose nodes will go under maintenance simulation.
+ *
+ *
+ * string node_group = 469958146 [(.google.api.field_behavior) = REQUIRED];
+ *
+ * @return The nodeGroup.
+ */
+ public java.lang.String getNodeGroup() {
+ java.lang.Object ref = nodeGroup_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ nodeGroup_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * Name of the NodeGroup resource whose nodes will go under maintenance simulation.
+ *
+ *
+ * string node_group = 469958146 [(.google.api.field_behavior) = REQUIRED];
+ *
+ * @return The bytes for nodeGroup.
+ */
+ public com.google.protobuf.ByteString getNodeGroupBytes() {
+ java.lang.Object ref = nodeGroup_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ nodeGroup_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * Name of the NodeGroup resource whose nodes will go under maintenance simulation.
+ *
+ *
+ * string node_group = 469958146 [(.google.api.field_behavior) = REQUIRED];
+ *
+ * @param value The nodeGroup to set.
+ * @return This builder for chaining.
+ */
+ public Builder setNodeGroup(java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ nodeGroup_ = value;
+ bitField0_ |= 0x00000001;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * Name of the NodeGroup resource whose nodes will go under maintenance simulation.
+ *
+ *
+ * string node_group = 469958146 [(.google.api.field_behavior) = REQUIRED];
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearNodeGroup() {
+ nodeGroup_ = getDefaultInstance().getNodeGroup();
+ bitField0_ = (bitField0_ & ~0x00000001);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * Name of the NodeGroup resource whose nodes will go under maintenance simulation.
+ *
+ *
+ * string node_group = 469958146 [(.google.api.field_behavior) = REQUIRED];
+ *
+ * @param value The bytes for nodeGroup to set.
+ * @return This builder for chaining.
+ */
+ public Builder setNodeGroupBytes(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+ nodeGroup_ = value;
+ bitField0_ |= 0x00000001;
+ onChanged();
+ return this;
+ }
+
+ private com.google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest
+ nodeGroupsSimulateMaintenanceEventRequestResource_;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest,
+ com.google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest.Builder,
+ com.google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequestOrBuilder>
+ nodeGroupsSimulateMaintenanceEventRequestResourceBuilder_;
+ /**
+ *
+ *
+ *
+ * The body resource for this request
+ *
+ *
+ *
+ * .google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest node_groups_simulate_maintenance_event_request_resource = 351468764 [(.google.api.field_behavior) = REQUIRED];
+ *
+ *
+ * @return Whether the nodeGroupsSimulateMaintenanceEventRequestResource field is set.
+ */
+ public boolean hasNodeGroupsSimulateMaintenanceEventRequestResource() {
+ return ((bitField0_ & 0x00000002) != 0);
+ }
+ /**
+ *
+ *
+ *
+ * The body resource for this request
+ *
+ *
+ *
+ * .google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest node_groups_simulate_maintenance_event_request_resource = 351468764 [(.google.api.field_behavior) = REQUIRED];
+ *
+ *
+ * @return The nodeGroupsSimulateMaintenanceEventRequestResource.
+ */
+ public com.google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest
+ getNodeGroupsSimulateMaintenanceEventRequestResource() {
+ if (nodeGroupsSimulateMaintenanceEventRequestResourceBuilder_ == null) {
+ return nodeGroupsSimulateMaintenanceEventRequestResource_ == null
+ ? com.google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest
+ .getDefaultInstance()
+ : nodeGroupsSimulateMaintenanceEventRequestResource_;
+ } else {
+ return nodeGroupsSimulateMaintenanceEventRequestResourceBuilder_.getMessage();
+ }
+ }
+ /**
+ *
+ *
+ *
+ * The body resource for this request
+ *
+ *
+ *
+ * .google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest node_groups_simulate_maintenance_event_request_resource = 351468764 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public Builder setNodeGroupsSimulateMaintenanceEventRequestResource(
+ com.google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest value) {
+ if (nodeGroupsSimulateMaintenanceEventRequestResourceBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ nodeGroupsSimulateMaintenanceEventRequestResource_ = value;
+ } else {
+ nodeGroupsSimulateMaintenanceEventRequestResourceBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000002;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * The body resource for this request
+ *
+ *
+ *
+ * .google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest node_groups_simulate_maintenance_event_request_resource = 351468764 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public Builder setNodeGroupsSimulateMaintenanceEventRequestResource(
+ com.google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest.Builder
+ builderForValue) {
+ if (nodeGroupsSimulateMaintenanceEventRequestResourceBuilder_ == null) {
+ nodeGroupsSimulateMaintenanceEventRequestResource_ = builderForValue.build();
+ } else {
+ nodeGroupsSimulateMaintenanceEventRequestResourceBuilder_.setMessage(
+ builderForValue.build());
+ }
+ bitField0_ |= 0x00000002;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * The body resource for this request
+ *
+ *
+ *
+ * .google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest node_groups_simulate_maintenance_event_request_resource = 351468764 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public Builder mergeNodeGroupsSimulateMaintenanceEventRequestResource(
+ com.google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest value) {
+ if (nodeGroupsSimulateMaintenanceEventRequestResourceBuilder_ == null) {
+ if (((bitField0_ & 0x00000002) != 0)
+ && nodeGroupsSimulateMaintenanceEventRequestResource_ != null
+ && nodeGroupsSimulateMaintenanceEventRequestResource_
+ != com.google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest
+ .getDefaultInstance()) {
+ getNodeGroupsSimulateMaintenanceEventRequestResourceBuilder().mergeFrom(value);
+ } else {
+ nodeGroupsSimulateMaintenanceEventRequestResource_ = value;
+ }
+ } else {
+ nodeGroupsSimulateMaintenanceEventRequestResourceBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000002;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * The body resource for this request
+ *
+ *
+ *
+ * .google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest node_groups_simulate_maintenance_event_request_resource = 351468764 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public Builder clearNodeGroupsSimulateMaintenanceEventRequestResource() {
+ bitField0_ = (bitField0_ & ~0x00000002);
+ nodeGroupsSimulateMaintenanceEventRequestResource_ = null;
+ if (nodeGroupsSimulateMaintenanceEventRequestResourceBuilder_ != null) {
+ nodeGroupsSimulateMaintenanceEventRequestResourceBuilder_.dispose();
+ nodeGroupsSimulateMaintenanceEventRequestResourceBuilder_ = null;
+ }
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * The body resource for this request
+ *
+ *
+ *
+ * .google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest node_groups_simulate_maintenance_event_request_resource = 351468764 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public com.google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest.Builder
+ getNodeGroupsSimulateMaintenanceEventRequestResourceBuilder() {
+ bitField0_ |= 0x00000002;
+ onChanged();
+ return getNodeGroupsSimulateMaintenanceEventRequestResourceFieldBuilder().getBuilder();
+ }
+ /**
+ *
+ *
+ *
+ * The body resource for this request
+ *
+ *
+ *
+ * .google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest node_groups_simulate_maintenance_event_request_resource = 351468764 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public com.google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequestOrBuilder
+ getNodeGroupsSimulateMaintenanceEventRequestResourceOrBuilder() {
+ if (nodeGroupsSimulateMaintenanceEventRequestResourceBuilder_ != null) {
+ return nodeGroupsSimulateMaintenanceEventRequestResourceBuilder_.getMessageOrBuilder();
+ } else {
+ return nodeGroupsSimulateMaintenanceEventRequestResource_ == null
+ ? com.google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest
+ .getDefaultInstance()
+ : nodeGroupsSimulateMaintenanceEventRequestResource_;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * The body resource for this request
+ *
+ *
+ *
+ * .google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest node_groups_simulate_maintenance_event_request_resource = 351468764 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest,
+ com.google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest.Builder,
+ com.google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequestOrBuilder>
+ getNodeGroupsSimulateMaintenanceEventRequestResourceFieldBuilder() {
+ if (nodeGroupsSimulateMaintenanceEventRequestResourceBuilder_ == null) {
+ nodeGroupsSimulateMaintenanceEventRequestResourceBuilder_ =
+ new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest,
+ com.google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest.Builder,
+ com.google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequestOrBuilder>(
+ getNodeGroupsSimulateMaintenanceEventRequestResource(),
+ getParentForChildren(),
+ isClean());
+ nodeGroupsSimulateMaintenanceEventRequestResource_ = null;
+ }
+ return nodeGroupsSimulateMaintenanceEventRequestResourceBuilder_;
+ }
+
+ private java.lang.Object project_ = "";
+ /**
+ *
+ *
+ *
+ * Project ID for this request.
+ *
+ *
+ *
+ * string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"];
+ *
+ *
+ * @return The project.
+ */
+ public java.lang.String getProject() {
+ java.lang.Object ref = project_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ project_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * Project ID for this request.
+ *
+ *
+ *
+ * string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"];
+ *
+ *
+ * @return The bytes for project.
+ */
+ public com.google.protobuf.ByteString getProjectBytes() {
+ java.lang.Object ref = project_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ project_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * Project ID for this request.
+ *
+ *
+ *
+ * string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"];
+ *
+ *
+ * @param value The project to set.
+ * @return This builder for chaining.
+ */
+ public Builder setProject(java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ project_ = value;
+ bitField0_ |= 0x00000004;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * Project ID for this request.
+ *
+ *
+ *
+ * string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"];
+ *
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearProject() {
+ project_ = getDefaultInstance().getProject();
+ bitField0_ = (bitField0_ & ~0x00000004);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * Project ID for this request.
+ *
+ *
+ *
+ * string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"];
+ *
+ *
+ * @param value The bytes for project to set.
+ * @return This builder for chaining.
+ */
+ public Builder setProjectBytes(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+ project_ = value;
+ bitField0_ |= 0x00000004;
+ onChanged();
+ return this;
+ }
+
+ private java.lang.Object requestId_ = "";
+ /**
+ *
+ *
+ *
+ * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
+ *
+ *
+ * optional string request_id = 37109963;
+ *
+ * @return Whether the requestId field is set.
+ */
+ public boolean hasRequestId() {
+ return ((bitField0_ & 0x00000008) != 0);
+ }
+ /**
+ *
+ *
+ *
+ * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
+ *
+ *
+ * optional string request_id = 37109963;
+ *
+ * @return The requestId.
+ */
+ public java.lang.String getRequestId() {
+ java.lang.Object ref = requestId_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ requestId_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
+ *
+ *
+ * optional string request_id = 37109963;
+ *
+ * @return The bytes for requestId.
+ */
+ public com.google.protobuf.ByteString getRequestIdBytes() {
+ java.lang.Object ref = requestId_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ requestId_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
+ *
+ *
+ * optional string request_id = 37109963;
+ *
+ * @param value The requestId to set.
+ * @return This builder for chaining.
+ */
+ public Builder setRequestId(java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ requestId_ = value;
+ bitField0_ |= 0x00000008;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
+ *
+ *
+ * optional string request_id = 37109963;
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearRequestId() {
+ requestId_ = getDefaultInstance().getRequestId();
+ bitField0_ = (bitField0_ & ~0x00000008);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
+ *
+ *
+ * optional string request_id = 37109963;
+ *
+ * @param value The bytes for requestId to set.
+ * @return This builder for chaining.
+ */
+ public Builder setRequestIdBytes(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+ requestId_ = value;
+ bitField0_ |= 0x00000008;
+ onChanged();
+ return this;
+ }
+
+ private java.lang.Object zone_ = "";
+ /**
+ *
+ *
+ *
+ * The name of the zone for this request.
+ *
+ *
+ *
+ * string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"];
+ *
+ *
+ * @return The zone.
+ */
+ public java.lang.String getZone() {
+ java.lang.Object ref = zone_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ zone_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * The name of the zone for this request.
+ *
+ *
+ *
+ * string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"];
+ *
+ *
+ * @return The bytes for zone.
+ */
+ public com.google.protobuf.ByteString getZoneBytes() {
+ java.lang.Object ref = zone_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ zone_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * The name of the zone for this request.
+ *
+ *
+ *
+ * string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"];
+ *
+ *
+ * @param value The zone to set.
+ * @return This builder for chaining.
+ */
+ public Builder setZone(java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ zone_ = value;
+ bitField0_ |= 0x00000010;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * The name of the zone for this request.
+ *
+ *
+ *
+ * string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"];
+ *
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearZone() {
+ zone_ = getDefaultInstance().getZone();
+ bitField0_ = (bitField0_ & ~0x00000010);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * The name of the zone for this request.
+ *
+ *
+ *
+ * string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"];
+ *
+ *
+ * @param value The bytes for zone to set.
+ * @return This builder for chaining.
+ */
+ public Builder setZoneBytes(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+ zone_ = value;
+ bitField0_ |= 0x00000010;
+ onChanged();
+ return this;
+ }
+
+ @java.lang.Override
+ public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFields(unknownFields);
+ }
+
+ @java.lang.Override
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+ // @@protoc_insertion_point(builder_scope:google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest)
+ private static final com.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest
+ DEFAULT_INSTANCE;
+
+ static {
+ DEFAULT_INSTANCE = new com.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest();
+ }
+
+ public static com.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest
+ getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser PARSER =
+ new com.google.protobuf.AbstractParser() {
+ @java.lang.Override
+ public SimulateMaintenanceEventNodeGroupRequest parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ Builder builder = newBuilder();
+ try {
+ builder.mergeFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(builder.buildPartial());
+ } catch (com.google.protobuf.UninitializedMessageException e) {
+ throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(e)
+ .setUnfinishedMessage(builder.buildPartial());
+ }
+ return builder.buildPartial();
+ }
+ };
+
+ public static com.google.protobuf.Parser parser() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Parser getParserForType() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest
+ getDefaultInstanceForType() {
+ return DEFAULT_INSTANCE;
+ }
+}
diff --git a/java-compute/proto-google-cloud-compute-v1/src/main/java/com/google/cloud/compute/v1/SimulateMaintenanceEventNodeGroupRequestOrBuilder.java b/java-compute/proto-google-cloud-compute-v1/src/main/java/com/google/cloud/compute/v1/SimulateMaintenanceEventNodeGroupRequestOrBuilder.java
new file mode 100644
index 000000000000..273cfbfbda0c
--- /dev/null
+++ b/java-compute/proto-google-cloud-compute-v1/src/main/java/com/google/cloud/compute/v1/SimulateMaintenanceEventNodeGroupRequestOrBuilder.java
@@ -0,0 +1,188 @@
+/*
+ * Copyright 2020 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.
+ */
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: google/cloud/compute/v1/compute.proto
+
+package com.google.cloud.compute.v1;
+
+public interface SimulateMaintenanceEventNodeGroupRequestOrBuilder
+ extends
+ // @@protoc_insertion_point(interface_extends:google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest)
+ com.google.protobuf.MessageOrBuilder {
+
+ /**
+ *
+ *
+ *
+ * Name of the NodeGroup resource whose nodes will go under maintenance simulation.
+ *
+ *
+ * string node_group = 469958146 [(.google.api.field_behavior) = REQUIRED];
+ *
+ * @return The nodeGroup.
+ */
+ java.lang.String getNodeGroup();
+ /**
+ *
+ *
+ *
+ * Name of the NodeGroup resource whose nodes will go under maintenance simulation.
+ *
+ *
+ * string node_group = 469958146 [(.google.api.field_behavior) = REQUIRED];
+ *
+ * @return The bytes for nodeGroup.
+ */
+ com.google.protobuf.ByteString getNodeGroupBytes();
+
+ /**
+ *
+ *
+ *
+ * The body resource for this request
+ *
+ *
+ *
+ * .google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest node_groups_simulate_maintenance_event_request_resource = 351468764 [(.google.api.field_behavior) = REQUIRED];
+ *
+ *
+ * @return Whether the nodeGroupsSimulateMaintenanceEventRequestResource field is set.
+ */
+ boolean hasNodeGroupsSimulateMaintenanceEventRequestResource();
+ /**
+ *
+ *
+ *
+ * The body resource for this request
+ *
+ *
+ *
+ * .google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest node_groups_simulate_maintenance_event_request_resource = 351468764 [(.google.api.field_behavior) = REQUIRED];
+ *
+ *
+ * @return The nodeGroupsSimulateMaintenanceEventRequestResource.
+ */
+ com.google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest
+ getNodeGroupsSimulateMaintenanceEventRequestResource();
+ /**
+ *
+ *
+ *
+ * The body resource for this request
+ *
+ *
+ *
+ * .google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest node_groups_simulate_maintenance_event_request_resource = 351468764 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ com.google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequestOrBuilder
+ getNodeGroupsSimulateMaintenanceEventRequestResourceOrBuilder();
+
+ /**
+ *
+ *
+ *
+ * Project ID for this request.
+ *
+ *
+ *
+ * string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"];
+ *
+ *
+ * @return The project.
+ */
+ java.lang.String getProject();
+ /**
+ *
+ *
+ *
+ * Project ID for this request.
+ *
+ *
+ *
+ * string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"];
+ *
+ *
+ * @return The bytes for project.
+ */
+ com.google.protobuf.ByteString getProjectBytes();
+
+ /**
+ *
+ *
+ *
+ * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
+ *
+ *
+ * optional string request_id = 37109963;
+ *
+ * @return Whether the requestId field is set.
+ */
+ boolean hasRequestId();
+ /**
+ *
+ *
+ *
+ * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
+ *
+ *
+ * optional string request_id = 37109963;
+ *
+ * @return The requestId.
+ */
+ java.lang.String getRequestId();
+ /**
+ *
+ *
+ *
+ * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
+ *
+ *
+ * optional string request_id = 37109963;
+ *
+ * @return The bytes for requestId.
+ */
+ com.google.protobuf.ByteString getRequestIdBytes();
+
+ /**
+ *
+ *
+ *
+ * The name of the zone for this request.
+ *
+ *
+ *
+ * string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"];
+ *
+ *
+ * @return The zone.
+ */
+ java.lang.String getZone();
+ /**
+ *
+ *
+ *
+ * The name of the zone for this request.
+ *
+ *
+ *
+ * string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"];
+ *
+ *
+ * @return The bytes for zone.
+ */
+ com.google.protobuf.ByteString getZoneBytes();
+}
diff --git a/java-compute/proto-google-cloud-compute-v1/src/main/proto/google/cloud/compute/v1/compute.proto b/java-compute/proto-google-cloud-compute-v1/src/main/proto/google/cloud/compute/v1/compute.proto
index 7f2d79b4d577..dc2e066fc37d 100644
--- a/java-compute/proto-google-cloud-compute-v1/src/main/proto/google/cloud/compute/v1/compute.proto
+++ b/java-compute/proto-google-cloud-compute-v1/src/main/proto/google/cloud/compute/v1/compute.proto
@@ -9421,6 +9421,8 @@ message GuestOsFeature {
SEV_CAPABLE = 87083793;
+ SEV_LIVE_MIGRATABLE = 392039820;
+
SEV_SNP_CAPABLE = 426919;
UEFI_COMPATIBLE = 195865408;
@@ -9897,12 +9899,16 @@ message HealthStatusForNetworkEndpoint {
// A value indicating that the enum field is not set.
UNDEFINED_HEALTH_STATE = 0;
+ // Endpoint is being drained.
DRAINING = 480455402;
+ // Endpoint is healthy.
HEALTHY = 439801213;
+ // Endpoint is unhealthy.
UNHEALTHY = 462118084;
+ // Health status of the endpoint is unknown.
UNKNOWN = 433141802;
}
@@ -18682,6 +18688,13 @@ message NodeGroupsSetNodeTemplateRequest {
}
+//
+message NodeGroupsSimulateMaintenanceEventRequest {
+ // Names of the nodes to go under maintenance simulation.
+ repeated string nodes = 104993457;
+
+}
+
// Represent a sole-tenant Node Template resource. You can use a template to define properties for nodes in a node group. For more information, read Creating node groups and instances.
message NodeTemplate {
// CPU overcommit.
@@ -26603,6 +26616,31 @@ message SimulateMaintenanceEventInstanceRequest {
}
+// A request message for NodeGroups.SimulateMaintenanceEvent. See the method description for details.
+message SimulateMaintenanceEventNodeGroupRequest {
+ // Name of the NodeGroup resource whose nodes will go under maintenance simulation.
+ string node_group = 469958146 [(google.api.field_behavior) = REQUIRED];
+
+ // The body resource for this request
+ NodeGroupsSimulateMaintenanceEventRequest node_groups_simulate_maintenance_event_request_resource = 351468764 [(google.api.field_behavior) = REQUIRED];
+
+ // Project ID for this request.
+ string project = 227560217 [
+ (google.api.field_behavior) = REQUIRED,
+ (google.cloud.operation_request_field) = "project"
+ ];
+
+ // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
+ optional string request_id = 37109963;
+
+ // The name of the zone for this request.
+ string zone = 3744684 [
+ (google.api.field_behavior) = REQUIRED,
+ (google.cloud.operation_request_field) = "zone"
+ ];
+
+}
+
// Represents a Persistent Disk Snapshot resource. You can use snapshots to back up data on a regular interval. For more information, read Creating persistent disk snapshots.
message Snapshot {
// [Output Only] The architecture of the snapshot. Valid values are ARM64 or X86_64.
@@ -34205,6 +34243,16 @@ service NodeGroups {
option (google.cloud.operation_service) = "ZoneOperations";
}
+ // Simulates maintenance event on specified nodes from the node group.
+ rpc SimulateMaintenanceEvent(SimulateMaintenanceEventNodeGroupRequest) returns (Operation) {
+ option (google.api.http) = {
+ body: "node_groups_simulate_maintenance_event_request_resource"
+ post: "/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{node_group}/simulateMaintenanceEvent"
+ };
+ option (google.api.method_signature) = "project,zone,node_group,node_groups_simulate_maintenance_event_request_resource";
+ option (google.cloud.operation_service) = "ZoneOperations";
+ }
+
// Returns permissions that a caller has on the specified resource.
rpc TestIamPermissions(TestIamPermissionsNodeGroupRequest) returns (TestPermissionsResponse) {
option (google.api.http) = {
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/acceleratortypes/aggregatedlist/AsyncAggregatedList.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/acceleratortypes/aggregatedlist/AsyncAggregatedList.java
new file mode 100644
index 000000000000..6f9f9b437c86
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/acceleratortypes/aggregatedlist/AsyncAggregatedList.java
@@ -0,0 +1,58 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_AcceleratorTypes_AggregatedList_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.AcceleratorTypesClient;
+import com.google.cloud.compute.v1.AcceleratorTypesScopedList;
+import com.google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest;
+import java.util.Map;
+
+public class AsyncAggregatedList {
+
+ public static void main(String[] args) throws Exception {
+ asyncAggregatedList();
+ }
+
+ public static void asyncAggregatedList() 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 (AcceleratorTypesClient acceleratorTypesClient = AcceleratorTypesClient.create()) {
+ AggregatedListAcceleratorTypesRequest request =
+ AggregatedListAcceleratorTypesRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setIncludeAllScopes(true)
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .build();
+ ApiFuture> future =
+ acceleratorTypesClient.aggregatedListPagedCallable().futureCall(request);
+ // Do something.
+ for (Map.Entry element : future.get().iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_AcceleratorTypes_AggregatedList_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/acceleratortypes/aggregatedlist/AsyncAggregatedListPaged.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/acceleratortypes/aggregatedlist/AsyncAggregatedListPaged.java
new file mode 100644
index 000000000000..af8eb0e3b82f
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/acceleratortypes/aggregatedlist/AsyncAggregatedListPaged.java
@@ -0,0 +1,66 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_AcceleratorTypes_AggregatedList_Paged_async]
+import com.google.cloud.compute.v1.AcceleratorTypeAggregatedList;
+import com.google.cloud.compute.v1.AcceleratorTypesClient;
+import com.google.cloud.compute.v1.AcceleratorTypesScopedList;
+import com.google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest;
+import com.google.common.base.Strings;
+import java.util.Map;
+
+public class AsyncAggregatedListPaged {
+
+ public static void main(String[] args) throws Exception {
+ asyncAggregatedListPaged();
+ }
+
+ public static void asyncAggregatedListPaged() 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 (AcceleratorTypesClient acceleratorTypesClient = AcceleratorTypesClient.create()) {
+ AggregatedListAcceleratorTypesRequest request =
+ AggregatedListAcceleratorTypesRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setIncludeAllScopes(true)
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .build();
+ while (true) {
+ AcceleratorTypeAggregatedList response =
+ acceleratorTypesClient.aggregatedListCallable().call(request);
+ for (Map.Entry element : response.getItemsList()) {
+ // doThingsWith(element);
+ }
+ String nextPageToken = response.getNextPageToken();
+ if (!Strings.isNullOrEmpty(nextPageToken)) {
+ request = request.toBuilder().setPageToken(nextPageToken).build();
+ } else {
+ break;
+ }
+ }
+ }
+ }
+}
+// [END compute_v1_generated_AcceleratorTypes_AggregatedList_Paged_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/acceleratortypes/aggregatedlist/SyncAggregatedList.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/acceleratortypes/aggregatedlist/SyncAggregatedList.java
new file mode 100644
index 000000000000..85286b613909
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/acceleratortypes/aggregatedlist/SyncAggregatedList.java
@@ -0,0 +1,55 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_AcceleratorTypes_AggregatedList_sync]
+import com.google.cloud.compute.v1.AcceleratorTypesClient;
+import com.google.cloud.compute.v1.AcceleratorTypesScopedList;
+import com.google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest;
+import java.util.Map;
+
+public class SyncAggregatedList {
+
+ public static void main(String[] args) throws Exception {
+ syncAggregatedList();
+ }
+
+ public static void syncAggregatedList() 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 (AcceleratorTypesClient acceleratorTypesClient = AcceleratorTypesClient.create()) {
+ AggregatedListAcceleratorTypesRequest request =
+ AggregatedListAcceleratorTypesRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setIncludeAllScopes(true)
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .build();
+ for (Map.Entry element :
+ acceleratorTypesClient.aggregatedList(request).iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_AcceleratorTypes_AggregatedList_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/acceleratortypes/aggregatedlist/SyncAggregatedListString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/acceleratortypes/aggregatedlist/SyncAggregatedListString.java
new file mode 100644
index 000000000000..f7354c926676
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/acceleratortypes/aggregatedlist/SyncAggregatedListString.java
@@ -0,0 +1,45 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_AcceleratorTypes_AggregatedList_String_sync]
+import com.google.cloud.compute.v1.AcceleratorTypesClient;
+import com.google.cloud.compute.v1.AcceleratorTypesScopedList;
+import java.util.Map;
+
+public class SyncAggregatedListString {
+
+ public static void main(String[] args) throws Exception {
+ syncAggregatedListString();
+ }
+
+ public static void syncAggregatedListString() 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 (AcceleratorTypesClient acceleratorTypesClient = AcceleratorTypesClient.create()) {
+ String project = "project-309310695";
+ for (Map.Entry element :
+ acceleratorTypesClient.aggregatedList(project).iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_AcceleratorTypes_AggregatedList_String_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/acceleratortypes/create/SyncCreateSetCredentialsProvider.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/acceleratortypes/create/SyncCreateSetCredentialsProvider.java
new file mode 100644
index 000000000000..2543333f622f
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/acceleratortypes/create/SyncCreateSetCredentialsProvider.java
@@ -0,0 +1,45 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_AcceleratorTypes_Create_SetCredentialsProvider_sync]
+import com.google.api.gax.core.FixedCredentialsProvider;
+import com.google.cloud.compute.v1.AcceleratorTypesClient;
+import com.google.cloud.compute.v1.AcceleratorTypesSettings;
+import com.google.cloud.compute.v1.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
+ AcceleratorTypesSettings acceleratorTypesSettings =
+ AcceleratorTypesSettings.newBuilder()
+ .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ .build();
+ AcceleratorTypesClient acceleratorTypesClient =
+ AcceleratorTypesClient.create(acceleratorTypesSettings);
+ }
+}
+// [END compute_v1_generated_AcceleratorTypes_Create_SetCredentialsProvider_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/acceleratortypes/create/SyncCreateSetEndpoint.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/acceleratortypes/create/SyncCreateSetEndpoint.java
new file mode 100644
index 000000000000..04f7bc666d17
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/acceleratortypes/create/SyncCreateSetEndpoint.java
@@ -0,0 +1,42 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_AcceleratorTypes_Create_SetEndpoint_sync]
+import com.google.cloud.compute.v1.AcceleratorTypesClient;
+import com.google.cloud.compute.v1.AcceleratorTypesSettings;
+import com.google.cloud.compute.v1.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
+ AcceleratorTypesSettings acceleratorTypesSettings =
+ AcceleratorTypesSettings.newBuilder().setEndpoint(myEndpoint).build();
+ AcceleratorTypesClient acceleratorTypesClient =
+ AcceleratorTypesClient.create(acceleratorTypesSettings);
+ }
+}
+// [END compute_v1_generated_AcceleratorTypes_Create_SetEndpoint_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/acceleratortypes/get/AsyncGet.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/acceleratortypes/get/AsyncGet.java
new file mode 100644
index 000000000000..2a73f0d8f889
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/acceleratortypes/get/AsyncGet.java
@@ -0,0 +1,50 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_AcceleratorTypes_Get_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.AcceleratorType;
+import com.google.cloud.compute.v1.AcceleratorTypesClient;
+import com.google.cloud.compute.v1.GetAcceleratorTypeRequest;
+
+public class AsyncGet {
+
+ public static void main(String[] args) throws Exception {
+ asyncGet();
+ }
+
+ public static void asyncGet() 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 (AcceleratorTypesClient acceleratorTypesClient = AcceleratorTypesClient.create()) {
+ GetAcceleratorTypeRequest request =
+ GetAcceleratorTypeRequest.newBuilder()
+ .setAcceleratorType("acceleratorType-82462651")
+ .setProject("project-309310695")
+ .setZone("zone3744684")
+ .build();
+ ApiFuture future = acceleratorTypesClient.getCallable().futureCall(request);
+ // Do something.
+ AcceleratorType response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_AcceleratorTypes_Get_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/acceleratortypes/get/SyncGet.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/acceleratortypes/get/SyncGet.java
new file mode 100644
index 000000000000..04856b5386ae
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/acceleratortypes/get/SyncGet.java
@@ -0,0 +1,47 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_AcceleratorTypes_Get_sync]
+import com.google.cloud.compute.v1.AcceleratorType;
+import com.google.cloud.compute.v1.AcceleratorTypesClient;
+import com.google.cloud.compute.v1.GetAcceleratorTypeRequest;
+
+public class SyncGet {
+
+ public static void main(String[] args) throws Exception {
+ syncGet();
+ }
+
+ public static void syncGet() 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 (AcceleratorTypesClient acceleratorTypesClient = AcceleratorTypesClient.create()) {
+ GetAcceleratorTypeRequest request =
+ GetAcceleratorTypeRequest.newBuilder()
+ .setAcceleratorType("acceleratorType-82462651")
+ .setProject("project-309310695")
+ .setZone("zone3744684")
+ .build();
+ AcceleratorType response = acceleratorTypesClient.get(request);
+ }
+ }
+}
+// [END compute_v1_generated_AcceleratorTypes_Get_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/acceleratortypes/get/SyncGetStringStringString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/acceleratortypes/get/SyncGetStringStringString.java
new file mode 100644
index 000000000000..0e17a982d493
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/acceleratortypes/get/SyncGetStringStringString.java
@@ -0,0 +1,43 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_AcceleratorTypes_Get_StringStringString_sync]
+import com.google.cloud.compute.v1.AcceleratorType;
+import com.google.cloud.compute.v1.AcceleratorTypesClient;
+
+public class SyncGetStringStringString {
+
+ public static void main(String[] args) throws Exception {
+ syncGetStringStringString();
+ }
+
+ public static void syncGetStringStringString() 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 (AcceleratorTypesClient acceleratorTypesClient = AcceleratorTypesClient.create()) {
+ String project = "project-309310695";
+ String zone = "zone3744684";
+ String acceleratorType = "acceleratorType-82462651";
+ AcceleratorType response = acceleratorTypesClient.get(project, zone, acceleratorType);
+ }
+ }
+}
+// [END compute_v1_generated_AcceleratorTypes_Get_StringStringString_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/acceleratortypes/list/AsyncList.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/acceleratortypes/list/AsyncList.java
new file mode 100644
index 000000000000..b5e835477e37
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/acceleratortypes/list/AsyncList.java
@@ -0,0 +1,57 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_AcceleratorTypes_List_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.AcceleratorType;
+import com.google.cloud.compute.v1.AcceleratorTypesClient;
+import com.google.cloud.compute.v1.ListAcceleratorTypesRequest;
+
+public class AsyncList {
+
+ public static void main(String[] args) throws Exception {
+ asyncList();
+ }
+
+ public static void asyncList() 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 (AcceleratorTypesClient acceleratorTypesClient = AcceleratorTypesClient.create()) {
+ ListAcceleratorTypesRequest request =
+ ListAcceleratorTypesRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .setZone("zone3744684")
+ .build();
+ ApiFuture future =
+ acceleratorTypesClient.listPagedCallable().futureCall(request);
+ // Do something.
+ for (AcceleratorType element : future.get().iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_AcceleratorTypes_List_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/acceleratortypes/list/AsyncListPaged.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/acceleratortypes/list/AsyncListPaged.java
new file mode 100644
index 000000000000..03873b6d5a5d
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/acceleratortypes/list/AsyncListPaged.java
@@ -0,0 +1,64 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_AcceleratorTypes_List_Paged_async]
+import com.google.cloud.compute.v1.AcceleratorType;
+import com.google.cloud.compute.v1.AcceleratorTypeList;
+import com.google.cloud.compute.v1.AcceleratorTypesClient;
+import com.google.cloud.compute.v1.ListAcceleratorTypesRequest;
+import com.google.common.base.Strings;
+
+public class AsyncListPaged {
+
+ public static void main(String[] args) throws Exception {
+ asyncListPaged();
+ }
+
+ public static void asyncListPaged() 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 (AcceleratorTypesClient acceleratorTypesClient = AcceleratorTypesClient.create()) {
+ ListAcceleratorTypesRequest request =
+ ListAcceleratorTypesRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .setZone("zone3744684")
+ .build();
+ while (true) {
+ AcceleratorTypeList response = acceleratorTypesClient.listCallable().call(request);
+ for (AcceleratorType element : response.getItemsList()) {
+ // doThingsWith(element);
+ }
+ String nextPageToken = response.getNextPageToken();
+ if (!Strings.isNullOrEmpty(nextPageToken)) {
+ request = request.toBuilder().setPageToken(nextPageToken).build();
+ } else {
+ break;
+ }
+ }
+ }
+ }
+}
+// [END compute_v1_generated_AcceleratorTypes_List_Paged_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/acceleratortypes/list/SyncList.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/acceleratortypes/list/SyncList.java
new file mode 100644
index 000000000000..aec05bd83cd9
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/acceleratortypes/list/SyncList.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.compute.v1.samples;
+
+// [START compute_v1_generated_AcceleratorTypes_List_sync]
+import com.google.cloud.compute.v1.AcceleratorType;
+import com.google.cloud.compute.v1.AcceleratorTypesClient;
+import com.google.cloud.compute.v1.ListAcceleratorTypesRequest;
+
+public class SyncList {
+
+ public static void main(String[] args) throws Exception {
+ syncList();
+ }
+
+ public static void syncList() 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 (AcceleratorTypesClient acceleratorTypesClient = AcceleratorTypesClient.create()) {
+ ListAcceleratorTypesRequest request =
+ ListAcceleratorTypesRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .setZone("zone3744684")
+ .build();
+ for (AcceleratorType element : acceleratorTypesClient.list(request).iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_AcceleratorTypes_List_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/acceleratortypes/list/SyncListStringString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/acceleratortypes/list/SyncListStringString.java
new file mode 100644
index 000000000000..068a8fde614a
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/acceleratortypes/list/SyncListStringString.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.compute.v1.samples;
+
+// [START compute_v1_generated_AcceleratorTypes_List_StringString_sync]
+import com.google.cloud.compute.v1.AcceleratorType;
+import com.google.cloud.compute.v1.AcceleratorTypesClient;
+
+public class SyncListStringString {
+
+ public static void main(String[] args) throws Exception {
+ syncListStringString();
+ }
+
+ public static void syncListStringString() 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 (AcceleratorTypesClient acceleratorTypesClient = AcceleratorTypesClient.create()) {
+ String project = "project-309310695";
+ String zone = "zone3744684";
+ for (AcceleratorType element : acceleratorTypesClient.list(project, zone).iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_AcceleratorTypes_List_StringString_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/acceleratortypessettings/get/SyncGet.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/acceleratortypessettings/get/SyncGet.java
new file mode 100644
index 000000000000..c6e2ff0e4835
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/acceleratortypessettings/get/SyncGet.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.compute.v1.samples;
+
+// [START compute_v1_generated_AcceleratorTypesSettings_Get_sync]
+import com.google.cloud.compute.v1.AcceleratorTypesSettings;
+import java.time.Duration;
+
+public class SyncGet {
+
+ public static void main(String[] args) throws Exception {
+ syncGet();
+ }
+
+ public static void syncGet() 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
+ AcceleratorTypesSettings.Builder acceleratorTypesSettingsBuilder =
+ AcceleratorTypesSettings.newBuilder();
+ acceleratorTypesSettingsBuilder
+ .getSettings()
+ .setRetrySettings(
+ acceleratorTypesSettingsBuilder
+ .getSettings()
+ .getRetrySettings()
+ .toBuilder()
+ .setTotalTimeout(Duration.ofSeconds(30))
+ .build());
+ AcceleratorTypesSettings acceleratorTypesSettings = acceleratorTypesSettingsBuilder.build();
+ }
+}
+// [END compute_v1_generated_AcceleratorTypesSettings_Get_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/aggregatedlist/AsyncAggregatedList.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/aggregatedlist/AsyncAggregatedList.java
new file mode 100644
index 000000000000..42a7291d2634
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/aggregatedlist/AsyncAggregatedList.java
@@ -0,0 +1,58 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Addresses_AggregatedList_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.AddressesClient;
+import com.google.cloud.compute.v1.AddressesScopedList;
+import com.google.cloud.compute.v1.AggregatedListAddressesRequest;
+import java.util.Map;
+
+public class AsyncAggregatedList {
+
+ public static void main(String[] args) throws Exception {
+ asyncAggregatedList();
+ }
+
+ public static void asyncAggregatedList() 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 (AddressesClient addressesClient = AddressesClient.create()) {
+ AggregatedListAddressesRequest request =
+ AggregatedListAddressesRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setIncludeAllScopes(true)
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .build();
+ ApiFuture> future =
+ addressesClient.aggregatedListPagedCallable().futureCall(request);
+ // Do something.
+ for (Map.Entry element : future.get().iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_Addresses_AggregatedList_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/aggregatedlist/AsyncAggregatedListPaged.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/aggregatedlist/AsyncAggregatedListPaged.java
new file mode 100644
index 000000000000..741f724138ab
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/aggregatedlist/AsyncAggregatedListPaged.java
@@ -0,0 +1,65 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Addresses_AggregatedList_Paged_async]
+import com.google.cloud.compute.v1.AddressAggregatedList;
+import com.google.cloud.compute.v1.AddressesClient;
+import com.google.cloud.compute.v1.AddressesScopedList;
+import com.google.cloud.compute.v1.AggregatedListAddressesRequest;
+import com.google.common.base.Strings;
+import java.util.Map;
+
+public class AsyncAggregatedListPaged {
+
+ public static void main(String[] args) throws Exception {
+ asyncAggregatedListPaged();
+ }
+
+ public static void asyncAggregatedListPaged() 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 (AddressesClient addressesClient = AddressesClient.create()) {
+ AggregatedListAddressesRequest request =
+ AggregatedListAddressesRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setIncludeAllScopes(true)
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .build();
+ while (true) {
+ AddressAggregatedList response = addressesClient.aggregatedListCallable().call(request);
+ for (Map.Entry element : response.getItemsList()) {
+ // doThingsWith(element);
+ }
+ String nextPageToken = response.getNextPageToken();
+ if (!Strings.isNullOrEmpty(nextPageToken)) {
+ request = request.toBuilder().setPageToken(nextPageToken).build();
+ } else {
+ break;
+ }
+ }
+ }
+ }
+}
+// [END compute_v1_generated_Addresses_AggregatedList_Paged_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/aggregatedlist/SyncAggregatedList.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/aggregatedlist/SyncAggregatedList.java
new file mode 100644
index 000000000000..9e2708d2ccaf
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/aggregatedlist/SyncAggregatedList.java
@@ -0,0 +1,55 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Addresses_AggregatedList_sync]
+import com.google.cloud.compute.v1.AddressesClient;
+import com.google.cloud.compute.v1.AddressesScopedList;
+import com.google.cloud.compute.v1.AggregatedListAddressesRequest;
+import java.util.Map;
+
+public class SyncAggregatedList {
+
+ public static void main(String[] args) throws Exception {
+ syncAggregatedList();
+ }
+
+ public static void syncAggregatedList() 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 (AddressesClient addressesClient = AddressesClient.create()) {
+ AggregatedListAddressesRequest request =
+ AggregatedListAddressesRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setIncludeAllScopes(true)
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .build();
+ for (Map.Entry element :
+ addressesClient.aggregatedList(request).iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_Addresses_AggregatedList_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/aggregatedlist/SyncAggregatedListString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/aggregatedlist/SyncAggregatedListString.java
new file mode 100644
index 000000000000..f4a3a5d11c22
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/aggregatedlist/SyncAggregatedListString.java
@@ -0,0 +1,45 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Addresses_AggregatedList_String_sync]
+import com.google.cloud.compute.v1.AddressesClient;
+import com.google.cloud.compute.v1.AddressesScopedList;
+import java.util.Map;
+
+public class SyncAggregatedListString {
+
+ public static void main(String[] args) throws Exception {
+ syncAggregatedListString();
+ }
+
+ public static void syncAggregatedListString() 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 (AddressesClient addressesClient = AddressesClient.create()) {
+ String project = "project-309310695";
+ for (Map.Entry element :
+ addressesClient.aggregatedList(project).iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_Addresses_AggregatedList_String_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/create/SyncCreateSetCredentialsProvider.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/create/SyncCreateSetCredentialsProvider.java
new file mode 100644
index 000000000000..9241b67dd815
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/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.compute.v1.samples;
+
+// [START compute_v1_generated_Addresses_Create_SetCredentialsProvider_sync]
+import com.google.api.gax.core.FixedCredentialsProvider;
+import com.google.cloud.compute.v1.AddressesClient;
+import com.google.cloud.compute.v1.AddressesSettings;
+import com.google.cloud.compute.v1.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
+ AddressesSettings addressesSettings =
+ AddressesSettings.newBuilder()
+ .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ .build();
+ AddressesClient addressesClient = AddressesClient.create(addressesSettings);
+ }
+}
+// [END compute_v1_generated_Addresses_Create_SetCredentialsProvider_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/create/SyncCreateSetEndpoint.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/create/SyncCreateSetEndpoint.java
new file mode 100644
index 000000000000..7899512b8519
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/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.compute.v1.samples;
+
+// [START compute_v1_generated_Addresses_Create_SetEndpoint_sync]
+import com.google.cloud.compute.v1.AddressesClient;
+import com.google.cloud.compute.v1.AddressesSettings;
+import com.google.cloud.compute.v1.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
+ AddressesSettings addressesSettings =
+ AddressesSettings.newBuilder().setEndpoint(myEndpoint).build();
+ AddressesClient addressesClient = AddressesClient.create(addressesSettings);
+ }
+}
+// [END compute_v1_generated_Addresses_Create_SetEndpoint_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/delete/AsyncDelete.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/delete/AsyncDelete.java
new file mode 100644
index 000000000000..0fc22b9ccc58
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/delete/AsyncDelete.java
@@ -0,0 +1,51 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Addresses_Delete_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.AddressesClient;
+import com.google.cloud.compute.v1.DeleteAddressRequest;
+import com.google.longrunning.Operation;
+
+public class AsyncDelete {
+
+ public static void main(String[] args) throws Exception {
+ asyncDelete();
+ }
+
+ public static void asyncDelete() 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 (AddressesClient addressesClient = AddressesClient.create()) {
+ DeleteAddressRequest request =
+ DeleteAddressRequest.newBuilder()
+ .setAddress("address-1147692044")
+ .setProject("project-309310695")
+ .setRegion("region-934795532")
+ .setRequestId("requestId693933066")
+ .build();
+ ApiFuture future = addressesClient.deleteCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Addresses_Delete_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/delete/AsyncDeleteLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/delete/AsyncDeleteLRO.java
new file mode 100644
index 000000000000..e0798a2b33f0
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/delete/AsyncDeleteLRO.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.compute.v1.samples;
+
+// [START compute_v1_generated_Addresses_Delete_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.AddressesClient;
+import com.google.cloud.compute.v1.DeleteAddressRequest;
+import com.google.cloud.compute.v1.Operation;
+
+public class AsyncDeleteLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncDeleteLRO();
+ }
+
+ public static void asyncDeleteLRO() 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 (AddressesClient addressesClient = AddressesClient.create()) {
+ DeleteAddressRequest request =
+ DeleteAddressRequest.newBuilder()
+ .setAddress("address-1147692044")
+ .setProject("project-309310695")
+ .setRegion("region-934795532")
+ .setRequestId("requestId693933066")
+ .build();
+ OperationFuture future =
+ addressesClient.deleteOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Addresses_Delete_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/delete/SyncDelete.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/delete/SyncDelete.java
new file mode 100644
index 000000000000..e1e2e94eb519
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/delete/SyncDelete.java
@@ -0,0 +1,48 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Addresses_Delete_sync]
+import com.google.cloud.compute.v1.AddressesClient;
+import com.google.cloud.compute.v1.DeleteAddressRequest;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncDelete {
+
+ public static void main(String[] args) throws Exception {
+ syncDelete();
+ }
+
+ public static void syncDelete() 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 (AddressesClient addressesClient = AddressesClient.create()) {
+ DeleteAddressRequest request =
+ DeleteAddressRequest.newBuilder()
+ .setAddress("address-1147692044")
+ .setProject("project-309310695")
+ .setRegion("region-934795532")
+ .setRequestId("requestId693933066")
+ .build();
+ Operation response = addressesClient.deleteAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_Addresses_Delete_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/delete/SyncDeleteStringStringString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/delete/SyncDeleteStringStringString.java
new file mode 100644
index 000000000000..0d4d341ff948
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/delete/SyncDeleteStringStringString.java
@@ -0,0 +1,43 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Addresses_Delete_StringStringString_sync]
+import com.google.cloud.compute.v1.AddressesClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncDeleteStringStringString {
+
+ public static void main(String[] args) throws Exception {
+ syncDeleteStringStringString();
+ }
+
+ public static void syncDeleteStringStringString() 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 (AddressesClient addressesClient = AddressesClient.create()) {
+ String project = "project-309310695";
+ String region = "region-934795532";
+ String address = "address-1147692044";
+ Operation response = addressesClient.deleteAsync(project, region, address).get();
+ }
+ }
+}
+// [END compute_v1_generated_Addresses_Delete_StringStringString_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/get/AsyncGet.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/get/AsyncGet.java
new file mode 100644
index 000000000000..150d635b47f9
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/get/AsyncGet.java
@@ -0,0 +1,50 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Addresses_Get_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.Address;
+import com.google.cloud.compute.v1.AddressesClient;
+import com.google.cloud.compute.v1.GetAddressRequest;
+
+public class AsyncGet {
+
+ public static void main(String[] args) throws Exception {
+ asyncGet();
+ }
+
+ public static void asyncGet() 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 (AddressesClient addressesClient = AddressesClient.create()) {
+ GetAddressRequest request =
+ GetAddressRequest.newBuilder()
+ .setAddress("address-1147692044")
+ .setProject("project-309310695")
+ .setRegion("region-934795532")
+ .build();
+ ApiFuture future = addressesClient.getCallable().futureCall(request);
+ // Do something.
+ Address response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Addresses_Get_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/get/SyncGet.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/get/SyncGet.java
new file mode 100644
index 000000000000..ff3306968e84
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/get/SyncGet.java
@@ -0,0 +1,47 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Addresses_Get_sync]
+import com.google.cloud.compute.v1.Address;
+import com.google.cloud.compute.v1.AddressesClient;
+import com.google.cloud.compute.v1.GetAddressRequest;
+
+public class SyncGet {
+
+ public static void main(String[] args) throws Exception {
+ syncGet();
+ }
+
+ public static void syncGet() 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 (AddressesClient addressesClient = AddressesClient.create()) {
+ GetAddressRequest request =
+ GetAddressRequest.newBuilder()
+ .setAddress("address-1147692044")
+ .setProject("project-309310695")
+ .setRegion("region-934795532")
+ .build();
+ Address response = addressesClient.get(request);
+ }
+ }
+}
+// [END compute_v1_generated_Addresses_Get_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/get/SyncGetStringStringString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/get/SyncGetStringStringString.java
new file mode 100644
index 000000000000..121afb9614c9
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/get/SyncGetStringStringString.java
@@ -0,0 +1,43 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Addresses_Get_StringStringString_sync]
+import com.google.cloud.compute.v1.Address;
+import com.google.cloud.compute.v1.AddressesClient;
+
+public class SyncGetStringStringString {
+
+ public static void main(String[] args) throws Exception {
+ syncGetStringStringString();
+ }
+
+ public static void syncGetStringStringString() 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 (AddressesClient addressesClient = AddressesClient.create()) {
+ String project = "project-309310695";
+ String region = "region-934795532";
+ String address = "address-1147692044";
+ Address response = addressesClient.get(project, region, address);
+ }
+ }
+}
+// [END compute_v1_generated_Addresses_Get_StringStringString_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/insert/AsyncInsert.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/insert/AsyncInsert.java
new file mode 100644
index 000000000000..b518911fe6ba
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/insert/AsyncInsert.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.compute.v1.samples;
+
+// [START compute_v1_generated_Addresses_Insert_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.Address;
+import com.google.cloud.compute.v1.AddressesClient;
+import com.google.cloud.compute.v1.InsertAddressRequest;
+import com.google.longrunning.Operation;
+
+public class AsyncInsert {
+
+ public static void main(String[] args) throws Exception {
+ asyncInsert();
+ }
+
+ public static void asyncInsert() 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 (AddressesClient addressesClient = AddressesClient.create()) {
+ InsertAddressRequest request =
+ InsertAddressRequest.newBuilder()
+ .setAddressResource(Address.newBuilder().build())
+ .setProject("project-309310695")
+ .setRegion("region-934795532")
+ .setRequestId("requestId693933066")
+ .build();
+ ApiFuture future = addressesClient.insertCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Addresses_Insert_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/insert/AsyncInsertLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/insert/AsyncInsertLRO.java
new file mode 100644
index 000000000000..da378c2fe46b
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/insert/AsyncInsertLRO.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.compute.v1.samples;
+
+// [START compute_v1_generated_Addresses_Insert_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.Address;
+import com.google.cloud.compute.v1.AddressesClient;
+import com.google.cloud.compute.v1.InsertAddressRequest;
+import com.google.cloud.compute.v1.Operation;
+
+public class AsyncInsertLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncInsertLRO();
+ }
+
+ public static void asyncInsertLRO() 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 (AddressesClient addressesClient = AddressesClient.create()) {
+ InsertAddressRequest request =
+ InsertAddressRequest.newBuilder()
+ .setAddressResource(Address.newBuilder().build())
+ .setProject("project-309310695")
+ .setRegion("region-934795532")
+ .setRequestId("requestId693933066")
+ .build();
+ OperationFuture future =
+ addressesClient.insertOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Addresses_Insert_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/insert/SyncInsert.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/insert/SyncInsert.java
new file mode 100644
index 000000000000..bc17ef2327d1
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/insert/SyncInsert.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.compute.v1.samples;
+
+// [START compute_v1_generated_Addresses_Insert_sync]
+import com.google.cloud.compute.v1.Address;
+import com.google.cloud.compute.v1.AddressesClient;
+import com.google.cloud.compute.v1.InsertAddressRequest;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncInsert {
+
+ public static void main(String[] args) throws Exception {
+ syncInsert();
+ }
+
+ public static void syncInsert() 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 (AddressesClient addressesClient = AddressesClient.create()) {
+ InsertAddressRequest request =
+ InsertAddressRequest.newBuilder()
+ .setAddressResource(Address.newBuilder().build())
+ .setProject("project-309310695")
+ .setRegion("region-934795532")
+ .setRequestId("requestId693933066")
+ .build();
+ Operation response = addressesClient.insertAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_Addresses_Insert_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/insert/SyncInsertStringStringAddress.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/insert/SyncInsertStringStringAddress.java
new file mode 100644
index 000000000000..80028f4b417e
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/insert/SyncInsertStringStringAddress.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.compute.v1.samples;
+
+// [START compute_v1_generated_Addresses_Insert_StringStringAddress_sync]
+import com.google.cloud.compute.v1.Address;
+import com.google.cloud.compute.v1.AddressesClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncInsertStringStringAddress {
+
+ public static void main(String[] args) throws Exception {
+ syncInsertStringStringAddress();
+ }
+
+ public static void syncInsertStringStringAddress() 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 (AddressesClient addressesClient = AddressesClient.create()) {
+ String project = "project-309310695";
+ String region = "region-934795532";
+ Address addressResource = Address.newBuilder().build();
+ Operation response = addressesClient.insertAsync(project, region, addressResource).get();
+ }
+ }
+}
+// [END compute_v1_generated_Addresses_Insert_StringStringAddress_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/list/AsyncList.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/list/AsyncList.java
new file mode 100644
index 000000000000..42c7671d461f
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/list/AsyncList.java
@@ -0,0 +1,56 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Addresses_List_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.Address;
+import com.google.cloud.compute.v1.AddressesClient;
+import com.google.cloud.compute.v1.ListAddressesRequest;
+
+public class AsyncList {
+
+ public static void main(String[] args) throws Exception {
+ asyncList();
+ }
+
+ public static void asyncList() 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 (AddressesClient addressesClient = AddressesClient.create()) {
+ ListAddressesRequest request =
+ ListAddressesRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setRegion("region-934795532")
+ .setReturnPartialSuccess(true)
+ .build();
+ ApiFuture future = addressesClient.listPagedCallable().futureCall(request);
+ // Do something.
+ for (Address element : future.get().iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_Addresses_List_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/list/AsyncListPaged.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/list/AsyncListPaged.java
new file mode 100644
index 000000000000..7bcc2d7b62bb
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/list/AsyncListPaged.java
@@ -0,0 +1,64 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Addresses_List_Paged_async]
+import com.google.cloud.compute.v1.Address;
+import com.google.cloud.compute.v1.AddressList;
+import com.google.cloud.compute.v1.AddressesClient;
+import com.google.cloud.compute.v1.ListAddressesRequest;
+import com.google.common.base.Strings;
+
+public class AsyncListPaged {
+
+ public static void main(String[] args) throws Exception {
+ asyncListPaged();
+ }
+
+ public static void asyncListPaged() 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 (AddressesClient addressesClient = AddressesClient.create()) {
+ ListAddressesRequest request =
+ ListAddressesRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setRegion("region-934795532")
+ .setReturnPartialSuccess(true)
+ .build();
+ while (true) {
+ AddressList response = addressesClient.listCallable().call(request);
+ for (Address element : response.getItemsList()) {
+ // doThingsWith(element);
+ }
+ String nextPageToken = response.getNextPageToken();
+ if (!Strings.isNullOrEmpty(nextPageToken)) {
+ request = request.toBuilder().setPageToken(nextPageToken).build();
+ } else {
+ break;
+ }
+ }
+ }
+ }
+}
+// [END compute_v1_generated_Addresses_List_Paged_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/list/SyncList.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/list/SyncList.java
new file mode 100644
index 000000000000..27e67b62d4ed
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/list/SyncList.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.compute.v1.samples;
+
+// [START compute_v1_generated_Addresses_List_sync]
+import com.google.cloud.compute.v1.Address;
+import com.google.cloud.compute.v1.AddressesClient;
+import com.google.cloud.compute.v1.ListAddressesRequest;
+
+public class SyncList {
+
+ public static void main(String[] args) throws Exception {
+ syncList();
+ }
+
+ public static void syncList() 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 (AddressesClient addressesClient = AddressesClient.create()) {
+ ListAddressesRequest request =
+ ListAddressesRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setRegion("region-934795532")
+ .setReturnPartialSuccess(true)
+ .build();
+ for (Address element : addressesClient.list(request).iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_Addresses_List_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/list/SyncListStringString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/list/SyncListStringString.java
new file mode 100644
index 000000000000..015d7cf8c672
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/list/SyncListStringString.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.compute.v1.samples;
+
+// [START compute_v1_generated_Addresses_List_StringString_sync]
+import com.google.cloud.compute.v1.Address;
+import com.google.cloud.compute.v1.AddressesClient;
+
+public class SyncListStringString {
+
+ public static void main(String[] args) throws Exception {
+ syncListStringString();
+ }
+
+ public static void syncListStringString() 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 (AddressesClient addressesClient = AddressesClient.create()) {
+ String project = "project-309310695";
+ String region = "region-934795532";
+ for (Address element : addressesClient.list(project, region).iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_Addresses_List_StringString_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/setlabels/AsyncSetLabels.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/setlabels/AsyncSetLabels.java
new file mode 100644
index 000000000000..3c7c9d9e2881
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/setlabels/AsyncSetLabels.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.compute.v1.samples;
+
+// [START compute_v1_generated_Addresses_SetLabels_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.AddressesClient;
+import com.google.cloud.compute.v1.RegionSetLabelsRequest;
+import com.google.cloud.compute.v1.SetLabelsAddressRequest;
+import com.google.longrunning.Operation;
+
+public class AsyncSetLabels {
+
+ public static void main(String[] args) throws Exception {
+ asyncSetLabels();
+ }
+
+ public static void asyncSetLabels() 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 (AddressesClient addressesClient = AddressesClient.create()) {
+ SetLabelsAddressRequest request =
+ SetLabelsAddressRequest.newBuilder()
+ .setProject("project-309310695")
+ .setRegion("region-934795532")
+ .setRegionSetLabelsRequestResource(RegionSetLabelsRequest.newBuilder().build())
+ .setRequestId("requestId693933066")
+ .setResource("resource-341064690")
+ .build();
+ ApiFuture future = addressesClient.setLabelsCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Addresses_SetLabels_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/setlabels/AsyncSetLabelsLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/setlabels/AsyncSetLabelsLRO.java
new file mode 100644
index 000000000000..e3c8ec6b43ed
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/setlabels/AsyncSetLabelsLRO.java
@@ -0,0 +1,54 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Addresses_SetLabels_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.AddressesClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.RegionSetLabelsRequest;
+import com.google.cloud.compute.v1.SetLabelsAddressRequest;
+
+public class AsyncSetLabelsLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncSetLabelsLRO();
+ }
+
+ public static void asyncSetLabelsLRO() 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 (AddressesClient addressesClient = AddressesClient.create()) {
+ SetLabelsAddressRequest request =
+ SetLabelsAddressRequest.newBuilder()
+ .setProject("project-309310695")
+ .setRegion("region-934795532")
+ .setRegionSetLabelsRequestResource(RegionSetLabelsRequest.newBuilder().build())
+ .setRequestId("requestId693933066")
+ .setResource("resource-341064690")
+ .build();
+ OperationFuture future =
+ addressesClient.setLabelsOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Addresses_SetLabels_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/setlabels/SyncSetLabels.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/setlabels/SyncSetLabels.java
new file mode 100644
index 000000000000..06d53bbaa7f1
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/setlabels/SyncSetLabels.java
@@ -0,0 +1,50 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Addresses_SetLabels_sync]
+import com.google.cloud.compute.v1.AddressesClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.RegionSetLabelsRequest;
+import com.google.cloud.compute.v1.SetLabelsAddressRequest;
+
+public class SyncSetLabels {
+
+ public static void main(String[] args) throws Exception {
+ syncSetLabels();
+ }
+
+ public static void syncSetLabels() 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 (AddressesClient addressesClient = AddressesClient.create()) {
+ SetLabelsAddressRequest request =
+ SetLabelsAddressRequest.newBuilder()
+ .setProject("project-309310695")
+ .setRegion("region-934795532")
+ .setRegionSetLabelsRequestResource(RegionSetLabelsRequest.newBuilder().build())
+ .setRequestId("requestId693933066")
+ .setResource("resource-341064690")
+ .build();
+ Operation response = addressesClient.setLabelsAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_Addresses_SetLabels_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/setlabels/SyncSetLabelsStringStringStringRegionsetlabelsrequest.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/setlabels/SyncSetLabelsStringStringStringRegionsetlabelsrequest.java
new file mode 100644
index 000000000000..dfcdc14d76ed
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addresses/setlabels/SyncSetLabelsStringStringStringRegionsetlabelsrequest.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.compute.v1.samples;
+
+// [START compute_v1_generated_Addresses_SetLabels_StringStringStringRegionsetlabelsrequest_sync]
+import com.google.cloud.compute.v1.AddressesClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.RegionSetLabelsRequest;
+
+public class SyncSetLabelsStringStringStringRegionsetlabelsrequest {
+
+ public static void main(String[] args) throws Exception {
+ syncSetLabelsStringStringStringRegionsetlabelsrequest();
+ }
+
+ public static void syncSetLabelsStringStringStringRegionsetlabelsrequest() 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 (AddressesClient addressesClient = AddressesClient.create()) {
+ String project = "project-309310695";
+ String region = "region-934795532";
+ String resource = "resource-341064690";
+ RegionSetLabelsRequest regionSetLabelsRequestResource =
+ RegionSetLabelsRequest.newBuilder().build();
+ Operation response =
+ addressesClient
+ .setLabelsAsync(project, region, resource, regionSetLabelsRequestResource)
+ .get();
+ }
+ }
+}
+// [END compute_v1_generated_Addresses_SetLabels_StringStringStringRegionsetlabelsrequest_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addressessettings/get/SyncGet.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addressessettings/get/SyncGet.java
new file mode 100644
index 000000000000..f7ef757afe19
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/addressessettings/get/SyncGet.java
@@ -0,0 +1,48 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_AddressesSettings_Get_sync]
+import com.google.cloud.compute.v1.AddressesSettings;
+import java.time.Duration;
+
+public class SyncGet {
+
+ public static void main(String[] args) throws Exception {
+ syncGet();
+ }
+
+ public static void syncGet() 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
+ AddressesSettings.Builder addressesSettingsBuilder = AddressesSettings.newBuilder();
+ addressesSettingsBuilder
+ .getSettings()
+ .setRetrySettings(
+ addressesSettingsBuilder
+ .getSettings()
+ .getRetrySettings()
+ .toBuilder()
+ .setTotalTimeout(Duration.ofSeconds(30))
+ .build());
+ AddressesSettings addressesSettings = addressesSettingsBuilder.build();
+ }
+}
+// [END compute_v1_generated_AddressesSettings_Get_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/aggregatedlist/AsyncAggregatedList.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/aggregatedlist/AsyncAggregatedList.java
new file mode 100644
index 000000000000..6e192762d498
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/aggregatedlist/AsyncAggregatedList.java
@@ -0,0 +1,58 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Autoscalers_AggregatedList_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.AggregatedListAutoscalersRequest;
+import com.google.cloud.compute.v1.AutoscalersClient;
+import com.google.cloud.compute.v1.AutoscalersScopedList;
+import java.util.Map;
+
+public class AsyncAggregatedList {
+
+ public static void main(String[] args) throws Exception {
+ asyncAggregatedList();
+ }
+
+ public static void asyncAggregatedList() 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 (AutoscalersClient autoscalersClient = AutoscalersClient.create()) {
+ AggregatedListAutoscalersRequest request =
+ AggregatedListAutoscalersRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setIncludeAllScopes(true)
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .build();
+ ApiFuture> future =
+ autoscalersClient.aggregatedListPagedCallable().futureCall(request);
+ // Do something.
+ for (Map.Entry element : future.get().iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_Autoscalers_AggregatedList_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/aggregatedlist/AsyncAggregatedListPaged.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/aggregatedlist/AsyncAggregatedListPaged.java
new file mode 100644
index 000000000000..f1fe721603dd
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/aggregatedlist/AsyncAggregatedListPaged.java
@@ -0,0 +1,66 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Autoscalers_AggregatedList_Paged_async]
+import com.google.cloud.compute.v1.AggregatedListAutoscalersRequest;
+import com.google.cloud.compute.v1.AutoscalerAggregatedList;
+import com.google.cloud.compute.v1.AutoscalersClient;
+import com.google.cloud.compute.v1.AutoscalersScopedList;
+import com.google.common.base.Strings;
+import java.util.Map;
+
+public class AsyncAggregatedListPaged {
+
+ public static void main(String[] args) throws Exception {
+ asyncAggregatedListPaged();
+ }
+
+ public static void asyncAggregatedListPaged() 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 (AutoscalersClient autoscalersClient = AutoscalersClient.create()) {
+ AggregatedListAutoscalersRequest request =
+ AggregatedListAutoscalersRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setIncludeAllScopes(true)
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .build();
+ while (true) {
+ AutoscalerAggregatedList response =
+ autoscalersClient.aggregatedListCallable().call(request);
+ for (Map.Entry element : response.getItemsList()) {
+ // doThingsWith(element);
+ }
+ String nextPageToken = response.getNextPageToken();
+ if (!Strings.isNullOrEmpty(nextPageToken)) {
+ request = request.toBuilder().setPageToken(nextPageToken).build();
+ } else {
+ break;
+ }
+ }
+ }
+ }
+}
+// [END compute_v1_generated_Autoscalers_AggregatedList_Paged_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/aggregatedlist/SyncAggregatedList.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/aggregatedlist/SyncAggregatedList.java
new file mode 100644
index 000000000000..0213940d14cc
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/aggregatedlist/SyncAggregatedList.java
@@ -0,0 +1,55 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Autoscalers_AggregatedList_sync]
+import com.google.cloud.compute.v1.AggregatedListAutoscalersRequest;
+import com.google.cloud.compute.v1.AutoscalersClient;
+import com.google.cloud.compute.v1.AutoscalersScopedList;
+import java.util.Map;
+
+public class SyncAggregatedList {
+
+ public static void main(String[] args) throws Exception {
+ syncAggregatedList();
+ }
+
+ public static void syncAggregatedList() 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 (AutoscalersClient autoscalersClient = AutoscalersClient.create()) {
+ AggregatedListAutoscalersRequest request =
+ AggregatedListAutoscalersRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setIncludeAllScopes(true)
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .build();
+ for (Map.Entry element :
+ autoscalersClient.aggregatedList(request).iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_Autoscalers_AggregatedList_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/aggregatedlist/SyncAggregatedListString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/aggregatedlist/SyncAggregatedListString.java
new file mode 100644
index 000000000000..8c900ed26b77
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/aggregatedlist/SyncAggregatedListString.java
@@ -0,0 +1,45 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Autoscalers_AggregatedList_String_sync]
+import com.google.cloud.compute.v1.AutoscalersClient;
+import com.google.cloud.compute.v1.AutoscalersScopedList;
+import java.util.Map;
+
+public class SyncAggregatedListString {
+
+ public static void main(String[] args) throws Exception {
+ syncAggregatedListString();
+ }
+
+ public static void syncAggregatedListString() 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 (AutoscalersClient autoscalersClient = AutoscalersClient.create()) {
+ String project = "project-309310695";
+ for (Map.Entry element :
+ autoscalersClient.aggregatedList(project).iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_Autoscalers_AggregatedList_String_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/create/SyncCreateSetCredentialsProvider.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/create/SyncCreateSetCredentialsProvider.java
new file mode 100644
index 000000000000..3dc3f6e47115
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/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.compute.v1.samples;
+
+// [START compute_v1_generated_Autoscalers_Create_SetCredentialsProvider_sync]
+import com.google.api.gax.core.FixedCredentialsProvider;
+import com.google.cloud.compute.v1.AutoscalersClient;
+import com.google.cloud.compute.v1.AutoscalersSettings;
+import com.google.cloud.compute.v1.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
+ AutoscalersSettings autoscalersSettings =
+ AutoscalersSettings.newBuilder()
+ .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ .build();
+ AutoscalersClient autoscalersClient = AutoscalersClient.create(autoscalersSettings);
+ }
+}
+// [END compute_v1_generated_Autoscalers_Create_SetCredentialsProvider_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/create/SyncCreateSetEndpoint.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/create/SyncCreateSetEndpoint.java
new file mode 100644
index 000000000000..7d27a0c37561
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/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.compute.v1.samples;
+
+// [START compute_v1_generated_Autoscalers_Create_SetEndpoint_sync]
+import com.google.cloud.compute.v1.AutoscalersClient;
+import com.google.cloud.compute.v1.AutoscalersSettings;
+import com.google.cloud.compute.v1.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
+ AutoscalersSettings autoscalersSettings =
+ AutoscalersSettings.newBuilder().setEndpoint(myEndpoint).build();
+ AutoscalersClient autoscalersClient = AutoscalersClient.create(autoscalersSettings);
+ }
+}
+// [END compute_v1_generated_Autoscalers_Create_SetEndpoint_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/delete/AsyncDelete.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/delete/AsyncDelete.java
new file mode 100644
index 000000000000..c30538342711
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/delete/AsyncDelete.java
@@ -0,0 +1,51 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Autoscalers_Delete_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.AutoscalersClient;
+import com.google.cloud.compute.v1.DeleteAutoscalerRequest;
+import com.google.longrunning.Operation;
+
+public class AsyncDelete {
+
+ public static void main(String[] args) throws Exception {
+ asyncDelete();
+ }
+
+ public static void asyncDelete() 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 (AutoscalersClient autoscalersClient = AutoscalersClient.create()) {
+ DeleteAutoscalerRequest request =
+ DeleteAutoscalerRequest.newBuilder()
+ .setAutoscaler("autoscaler517258967")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setZone("zone3744684")
+ .build();
+ ApiFuture future = autoscalersClient.deleteCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Autoscalers_Delete_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/delete/AsyncDeleteLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/delete/AsyncDeleteLRO.java
new file mode 100644
index 000000000000..1b416d823fac
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/delete/AsyncDeleteLRO.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.compute.v1.samples;
+
+// [START compute_v1_generated_Autoscalers_Delete_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.AutoscalersClient;
+import com.google.cloud.compute.v1.DeleteAutoscalerRequest;
+import com.google.cloud.compute.v1.Operation;
+
+public class AsyncDeleteLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncDeleteLRO();
+ }
+
+ public static void asyncDeleteLRO() 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 (AutoscalersClient autoscalersClient = AutoscalersClient.create()) {
+ DeleteAutoscalerRequest request =
+ DeleteAutoscalerRequest.newBuilder()
+ .setAutoscaler("autoscaler517258967")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setZone("zone3744684")
+ .build();
+ OperationFuture future =
+ autoscalersClient.deleteOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Autoscalers_Delete_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/delete/SyncDelete.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/delete/SyncDelete.java
new file mode 100644
index 000000000000..afe8dc17433a
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/delete/SyncDelete.java
@@ -0,0 +1,48 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Autoscalers_Delete_sync]
+import com.google.cloud.compute.v1.AutoscalersClient;
+import com.google.cloud.compute.v1.DeleteAutoscalerRequest;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncDelete {
+
+ public static void main(String[] args) throws Exception {
+ syncDelete();
+ }
+
+ public static void syncDelete() 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 (AutoscalersClient autoscalersClient = AutoscalersClient.create()) {
+ DeleteAutoscalerRequest request =
+ DeleteAutoscalerRequest.newBuilder()
+ .setAutoscaler("autoscaler517258967")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setZone("zone3744684")
+ .build();
+ Operation response = autoscalersClient.deleteAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_Autoscalers_Delete_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/delete/SyncDeleteStringStringString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/delete/SyncDeleteStringStringString.java
new file mode 100644
index 000000000000..e64c317255bc
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/delete/SyncDeleteStringStringString.java
@@ -0,0 +1,43 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Autoscalers_Delete_StringStringString_sync]
+import com.google.cloud.compute.v1.AutoscalersClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncDeleteStringStringString {
+
+ public static void main(String[] args) throws Exception {
+ syncDeleteStringStringString();
+ }
+
+ public static void syncDeleteStringStringString() 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 (AutoscalersClient autoscalersClient = AutoscalersClient.create()) {
+ String project = "project-309310695";
+ String zone = "zone3744684";
+ String autoscaler = "autoscaler517258967";
+ Operation response = autoscalersClient.deleteAsync(project, zone, autoscaler).get();
+ }
+ }
+}
+// [END compute_v1_generated_Autoscalers_Delete_StringStringString_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/get/AsyncGet.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/get/AsyncGet.java
new file mode 100644
index 000000000000..7507f5cf9688
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/get/AsyncGet.java
@@ -0,0 +1,50 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Autoscalers_Get_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.Autoscaler;
+import com.google.cloud.compute.v1.AutoscalersClient;
+import com.google.cloud.compute.v1.GetAutoscalerRequest;
+
+public class AsyncGet {
+
+ public static void main(String[] args) throws Exception {
+ asyncGet();
+ }
+
+ public static void asyncGet() 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 (AutoscalersClient autoscalersClient = AutoscalersClient.create()) {
+ GetAutoscalerRequest request =
+ GetAutoscalerRequest.newBuilder()
+ .setAutoscaler("autoscaler517258967")
+ .setProject("project-309310695")
+ .setZone("zone3744684")
+ .build();
+ ApiFuture future = autoscalersClient.getCallable().futureCall(request);
+ // Do something.
+ Autoscaler response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Autoscalers_Get_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/get/SyncGet.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/get/SyncGet.java
new file mode 100644
index 000000000000..955263404b84
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/get/SyncGet.java
@@ -0,0 +1,47 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Autoscalers_Get_sync]
+import com.google.cloud.compute.v1.Autoscaler;
+import com.google.cloud.compute.v1.AutoscalersClient;
+import com.google.cloud.compute.v1.GetAutoscalerRequest;
+
+public class SyncGet {
+
+ public static void main(String[] args) throws Exception {
+ syncGet();
+ }
+
+ public static void syncGet() 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 (AutoscalersClient autoscalersClient = AutoscalersClient.create()) {
+ GetAutoscalerRequest request =
+ GetAutoscalerRequest.newBuilder()
+ .setAutoscaler("autoscaler517258967")
+ .setProject("project-309310695")
+ .setZone("zone3744684")
+ .build();
+ Autoscaler response = autoscalersClient.get(request);
+ }
+ }
+}
+// [END compute_v1_generated_Autoscalers_Get_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/get/SyncGetStringStringString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/get/SyncGetStringStringString.java
new file mode 100644
index 000000000000..4d21952c5dde
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/get/SyncGetStringStringString.java
@@ -0,0 +1,43 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Autoscalers_Get_StringStringString_sync]
+import com.google.cloud.compute.v1.Autoscaler;
+import com.google.cloud.compute.v1.AutoscalersClient;
+
+public class SyncGetStringStringString {
+
+ public static void main(String[] args) throws Exception {
+ syncGetStringStringString();
+ }
+
+ public static void syncGetStringStringString() 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 (AutoscalersClient autoscalersClient = AutoscalersClient.create()) {
+ String project = "project-309310695";
+ String zone = "zone3744684";
+ String autoscaler = "autoscaler517258967";
+ Autoscaler response = autoscalersClient.get(project, zone, autoscaler);
+ }
+ }
+}
+// [END compute_v1_generated_Autoscalers_Get_StringStringString_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/insert/AsyncInsert.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/insert/AsyncInsert.java
new file mode 100644
index 000000000000..95c1fac9a8dd
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/insert/AsyncInsert.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.compute.v1.samples;
+
+// [START compute_v1_generated_Autoscalers_Insert_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.Autoscaler;
+import com.google.cloud.compute.v1.AutoscalersClient;
+import com.google.cloud.compute.v1.InsertAutoscalerRequest;
+import com.google.longrunning.Operation;
+
+public class AsyncInsert {
+
+ public static void main(String[] args) throws Exception {
+ asyncInsert();
+ }
+
+ public static void asyncInsert() 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 (AutoscalersClient autoscalersClient = AutoscalersClient.create()) {
+ InsertAutoscalerRequest request =
+ InsertAutoscalerRequest.newBuilder()
+ .setAutoscalerResource(Autoscaler.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setZone("zone3744684")
+ .build();
+ ApiFuture future = autoscalersClient.insertCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Autoscalers_Insert_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/insert/AsyncInsertLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/insert/AsyncInsertLRO.java
new file mode 100644
index 000000000000..dfc81b63cade
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/insert/AsyncInsertLRO.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.compute.v1.samples;
+
+// [START compute_v1_generated_Autoscalers_Insert_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.Autoscaler;
+import com.google.cloud.compute.v1.AutoscalersClient;
+import com.google.cloud.compute.v1.InsertAutoscalerRequest;
+import com.google.cloud.compute.v1.Operation;
+
+public class AsyncInsertLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncInsertLRO();
+ }
+
+ public static void asyncInsertLRO() 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 (AutoscalersClient autoscalersClient = AutoscalersClient.create()) {
+ InsertAutoscalerRequest request =
+ InsertAutoscalerRequest.newBuilder()
+ .setAutoscalerResource(Autoscaler.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setZone("zone3744684")
+ .build();
+ OperationFuture future =
+ autoscalersClient.insertOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Autoscalers_Insert_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/insert/SyncInsert.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/insert/SyncInsert.java
new file mode 100644
index 000000000000..d52597b06c38
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/insert/SyncInsert.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.compute.v1.samples;
+
+// [START compute_v1_generated_Autoscalers_Insert_sync]
+import com.google.cloud.compute.v1.Autoscaler;
+import com.google.cloud.compute.v1.AutoscalersClient;
+import com.google.cloud.compute.v1.InsertAutoscalerRequest;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncInsert {
+
+ public static void main(String[] args) throws Exception {
+ syncInsert();
+ }
+
+ public static void syncInsert() 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 (AutoscalersClient autoscalersClient = AutoscalersClient.create()) {
+ InsertAutoscalerRequest request =
+ InsertAutoscalerRequest.newBuilder()
+ .setAutoscalerResource(Autoscaler.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setZone("zone3744684")
+ .build();
+ Operation response = autoscalersClient.insertAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_Autoscalers_Insert_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/insert/SyncInsertStringStringAutoscaler.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/insert/SyncInsertStringStringAutoscaler.java
new file mode 100644
index 000000000000..64d9344c01e1
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/insert/SyncInsertStringStringAutoscaler.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.compute.v1.samples;
+
+// [START compute_v1_generated_Autoscalers_Insert_StringStringAutoscaler_sync]
+import com.google.cloud.compute.v1.Autoscaler;
+import com.google.cloud.compute.v1.AutoscalersClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncInsertStringStringAutoscaler {
+
+ public static void main(String[] args) throws Exception {
+ syncInsertStringStringAutoscaler();
+ }
+
+ public static void syncInsertStringStringAutoscaler() 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 (AutoscalersClient autoscalersClient = AutoscalersClient.create()) {
+ String project = "project-309310695";
+ String zone = "zone3744684";
+ Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
+ Operation response = autoscalersClient.insertAsync(project, zone, autoscalerResource).get();
+ }
+ }
+}
+// [END compute_v1_generated_Autoscalers_Insert_StringStringAutoscaler_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/list/AsyncList.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/list/AsyncList.java
new file mode 100644
index 000000000000..1872f89d93aa
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/list/AsyncList.java
@@ -0,0 +1,56 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Autoscalers_List_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.Autoscaler;
+import com.google.cloud.compute.v1.AutoscalersClient;
+import com.google.cloud.compute.v1.ListAutoscalersRequest;
+
+public class AsyncList {
+
+ public static void main(String[] args) throws Exception {
+ asyncList();
+ }
+
+ public static void asyncList() 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 (AutoscalersClient autoscalersClient = AutoscalersClient.create()) {
+ ListAutoscalersRequest request =
+ ListAutoscalersRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .setZone("zone3744684")
+ .build();
+ ApiFuture future = autoscalersClient.listPagedCallable().futureCall(request);
+ // Do something.
+ for (Autoscaler element : future.get().iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_Autoscalers_List_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/list/AsyncListPaged.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/list/AsyncListPaged.java
new file mode 100644
index 000000000000..68f0b9fc6e9e
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/list/AsyncListPaged.java
@@ -0,0 +1,64 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Autoscalers_List_Paged_async]
+import com.google.cloud.compute.v1.Autoscaler;
+import com.google.cloud.compute.v1.AutoscalerList;
+import com.google.cloud.compute.v1.AutoscalersClient;
+import com.google.cloud.compute.v1.ListAutoscalersRequest;
+import com.google.common.base.Strings;
+
+public class AsyncListPaged {
+
+ public static void main(String[] args) throws Exception {
+ asyncListPaged();
+ }
+
+ public static void asyncListPaged() 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 (AutoscalersClient autoscalersClient = AutoscalersClient.create()) {
+ ListAutoscalersRequest request =
+ ListAutoscalersRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .setZone("zone3744684")
+ .build();
+ while (true) {
+ AutoscalerList response = autoscalersClient.listCallable().call(request);
+ for (Autoscaler element : response.getItemsList()) {
+ // doThingsWith(element);
+ }
+ String nextPageToken = response.getNextPageToken();
+ if (!Strings.isNullOrEmpty(nextPageToken)) {
+ request = request.toBuilder().setPageToken(nextPageToken).build();
+ } else {
+ break;
+ }
+ }
+ }
+ }
+}
+// [END compute_v1_generated_Autoscalers_List_Paged_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/list/SyncList.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/list/SyncList.java
new file mode 100644
index 000000000000..fc93bd6bad65
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/list/SyncList.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.compute.v1.samples;
+
+// [START compute_v1_generated_Autoscalers_List_sync]
+import com.google.cloud.compute.v1.Autoscaler;
+import com.google.cloud.compute.v1.AutoscalersClient;
+import com.google.cloud.compute.v1.ListAutoscalersRequest;
+
+public class SyncList {
+
+ public static void main(String[] args) throws Exception {
+ syncList();
+ }
+
+ public static void syncList() 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 (AutoscalersClient autoscalersClient = AutoscalersClient.create()) {
+ ListAutoscalersRequest request =
+ ListAutoscalersRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .setZone("zone3744684")
+ .build();
+ for (Autoscaler element : autoscalersClient.list(request).iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_Autoscalers_List_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/list/SyncListStringString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/list/SyncListStringString.java
new file mode 100644
index 000000000000..1bd761b6186b
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/list/SyncListStringString.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.compute.v1.samples;
+
+// [START compute_v1_generated_Autoscalers_List_StringString_sync]
+import com.google.cloud.compute.v1.Autoscaler;
+import com.google.cloud.compute.v1.AutoscalersClient;
+
+public class SyncListStringString {
+
+ public static void main(String[] args) throws Exception {
+ syncListStringString();
+ }
+
+ public static void syncListStringString() 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 (AutoscalersClient autoscalersClient = AutoscalersClient.create()) {
+ String project = "project-309310695";
+ String zone = "zone3744684";
+ for (Autoscaler element : autoscalersClient.list(project, zone).iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_Autoscalers_List_StringString_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/patch/AsyncPatch.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/patch/AsyncPatch.java
new file mode 100644
index 000000000000..681e93d47662
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/patch/AsyncPatch.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.compute.v1.samples;
+
+// [START compute_v1_generated_Autoscalers_Patch_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.Autoscaler;
+import com.google.cloud.compute.v1.AutoscalersClient;
+import com.google.cloud.compute.v1.PatchAutoscalerRequest;
+import com.google.longrunning.Operation;
+
+public class AsyncPatch {
+
+ public static void main(String[] args) throws Exception {
+ asyncPatch();
+ }
+
+ public static void asyncPatch() 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 (AutoscalersClient autoscalersClient = AutoscalersClient.create()) {
+ PatchAutoscalerRequest request =
+ PatchAutoscalerRequest.newBuilder()
+ .setAutoscaler("autoscaler517258967")
+ .setAutoscalerResource(Autoscaler.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setZone("zone3744684")
+ .build();
+ ApiFuture future = autoscalersClient.patchCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Autoscalers_Patch_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/patch/AsyncPatchLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/patch/AsyncPatchLRO.java
new file mode 100644
index 000000000000..f52367a5eb49
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/patch/AsyncPatchLRO.java
@@ -0,0 +1,54 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Autoscalers_Patch_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.Autoscaler;
+import com.google.cloud.compute.v1.AutoscalersClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.PatchAutoscalerRequest;
+
+public class AsyncPatchLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncPatchLRO();
+ }
+
+ public static void asyncPatchLRO() 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 (AutoscalersClient autoscalersClient = AutoscalersClient.create()) {
+ PatchAutoscalerRequest request =
+ PatchAutoscalerRequest.newBuilder()
+ .setAutoscaler("autoscaler517258967")
+ .setAutoscalerResource(Autoscaler.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setZone("zone3744684")
+ .build();
+ OperationFuture future =
+ autoscalersClient.patchOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Autoscalers_Patch_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/patch/SyncPatch.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/patch/SyncPatch.java
new file mode 100644
index 000000000000..b09f84dd7163
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/patch/SyncPatch.java
@@ -0,0 +1,50 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Autoscalers_Patch_sync]
+import com.google.cloud.compute.v1.Autoscaler;
+import com.google.cloud.compute.v1.AutoscalersClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.PatchAutoscalerRequest;
+
+public class SyncPatch {
+
+ public static void main(String[] args) throws Exception {
+ syncPatch();
+ }
+
+ public static void syncPatch() 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 (AutoscalersClient autoscalersClient = AutoscalersClient.create()) {
+ PatchAutoscalerRequest request =
+ PatchAutoscalerRequest.newBuilder()
+ .setAutoscaler("autoscaler517258967")
+ .setAutoscalerResource(Autoscaler.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setZone("zone3744684")
+ .build();
+ Operation response = autoscalersClient.patchAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_Autoscalers_Patch_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/patch/SyncPatchStringStringAutoscaler.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/patch/SyncPatchStringStringAutoscaler.java
new file mode 100644
index 000000000000..4e4b8da7d335
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/patch/SyncPatchStringStringAutoscaler.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.compute.v1.samples;
+
+// [START compute_v1_generated_Autoscalers_Patch_StringStringAutoscaler_sync]
+import com.google.cloud.compute.v1.Autoscaler;
+import com.google.cloud.compute.v1.AutoscalersClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncPatchStringStringAutoscaler {
+
+ public static void main(String[] args) throws Exception {
+ syncPatchStringStringAutoscaler();
+ }
+
+ public static void syncPatchStringStringAutoscaler() 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 (AutoscalersClient autoscalersClient = AutoscalersClient.create()) {
+ String project = "project-309310695";
+ String zone = "zone3744684";
+ Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
+ Operation response = autoscalersClient.patchAsync(project, zone, autoscalerResource).get();
+ }
+ }
+}
+// [END compute_v1_generated_Autoscalers_Patch_StringStringAutoscaler_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/update/AsyncUpdate.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/update/AsyncUpdate.java
new file mode 100644
index 000000000000..e77564b8981c
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/update/AsyncUpdate.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.compute.v1.samples;
+
+// [START compute_v1_generated_Autoscalers_Update_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.Autoscaler;
+import com.google.cloud.compute.v1.AutoscalersClient;
+import com.google.cloud.compute.v1.UpdateAutoscalerRequest;
+import com.google.longrunning.Operation;
+
+public class AsyncUpdate {
+
+ public static void main(String[] args) throws Exception {
+ asyncUpdate();
+ }
+
+ public static void asyncUpdate() 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 (AutoscalersClient autoscalersClient = AutoscalersClient.create()) {
+ UpdateAutoscalerRequest request =
+ UpdateAutoscalerRequest.newBuilder()
+ .setAutoscaler("autoscaler517258967")
+ .setAutoscalerResource(Autoscaler.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setZone("zone3744684")
+ .build();
+ ApiFuture future = autoscalersClient.updateCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Autoscalers_Update_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/update/AsyncUpdateLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/update/AsyncUpdateLRO.java
new file mode 100644
index 000000000000..8d5088c1b0d3
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/update/AsyncUpdateLRO.java
@@ -0,0 +1,54 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Autoscalers_Update_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.Autoscaler;
+import com.google.cloud.compute.v1.AutoscalersClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.UpdateAutoscalerRequest;
+
+public class AsyncUpdateLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncUpdateLRO();
+ }
+
+ public static void asyncUpdateLRO() 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 (AutoscalersClient autoscalersClient = AutoscalersClient.create()) {
+ UpdateAutoscalerRequest request =
+ UpdateAutoscalerRequest.newBuilder()
+ .setAutoscaler("autoscaler517258967")
+ .setAutoscalerResource(Autoscaler.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setZone("zone3744684")
+ .build();
+ OperationFuture future =
+ autoscalersClient.updateOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Autoscalers_Update_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/update/SyncUpdate.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/update/SyncUpdate.java
new file mode 100644
index 000000000000..a4141d282945
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/update/SyncUpdate.java
@@ -0,0 +1,50 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Autoscalers_Update_sync]
+import com.google.cloud.compute.v1.Autoscaler;
+import com.google.cloud.compute.v1.AutoscalersClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.UpdateAutoscalerRequest;
+
+public class SyncUpdate {
+
+ public static void main(String[] args) throws Exception {
+ syncUpdate();
+ }
+
+ public static void syncUpdate() 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 (AutoscalersClient autoscalersClient = AutoscalersClient.create()) {
+ UpdateAutoscalerRequest request =
+ UpdateAutoscalerRequest.newBuilder()
+ .setAutoscaler("autoscaler517258967")
+ .setAutoscalerResource(Autoscaler.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setZone("zone3744684")
+ .build();
+ Operation response = autoscalersClient.updateAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_Autoscalers_Update_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/update/SyncUpdateStringStringAutoscaler.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/update/SyncUpdateStringStringAutoscaler.java
new file mode 100644
index 000000000000..c364f7376c47
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalers/update/SyncUpdateStringStringAutoscaler.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.compute.v1.samples;
+
+// [START compute_v1_generated_Autoscalers_Update_StringStringAutoscaler_sync]
+import com.google.cloud.compute.v1.Autoscaler;
+import com.google.cloud.compute.v1.AutoscalersClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncUpdateStringStringAutoscaler {
+
+ public static void main(String[] args) throws Exception {
+ syncUpdateStringStringAutoscaler();
+ }
+
+ public static void syncUpdateStringStringAutoscaler() 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 (AutoscalersClient autoscalersClient = AutoscalersClient.create()) {
+ String project = "project-309310695";
+ String zone = "zone3744684";
+ Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
+ Operation response = autoscalersClient.updateAsync(project, zone, autoscalerResource).get();
+ }
+ }
+}
+// [END compute_v1_generated_Autoscalers_Update_StringStringAutoscaler_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalerssettings/get/SyncGet.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalerssettings/get/SyncGet.java
new file mode 100644
index 000000000000..2cc6965e32e0
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/autoscalerssettings/get/SyncGet.java
@@ -0,0 +1,48 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_AutoscalersSettings_Get_sync]
+import com.google.cloud.compute.v1.AutoscalersSettings;
+import java.time.Duration;
+
+public class SyncGet {
+
+ public static void main(String[] args) throws Exception {
+ syncGet();
+ }
+
+ public static void syncGet() 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
+ AutoscalersSettings.Builder autoscalersSettingsBuilder = AutoscalersSettings.newBuilder();
+ autoscalersSettingsBuilder
+ .getSettings()
+ .setRetrySettings(
+ autoscalersSettingsBuilder
+ .getSettings()
+ .getRetrySettings()
+ .toBuilder()
+ .setTotalTimeout(Duration.ofSeconds(30))
+ .build());
+ AutoscalersSettings autoscalersSettings = autoscalersSettingsBuilder.build();
+ }
+}
+// [END compute_v1_generated_AutoscalersSettings_Get_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/addsignedurlkey/AsyncAddSignedUrlKey.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/addsignedurlkey/AsyncAddSignedUrlKey.java
new file mode 100644
index 000000000000..781f8122d130
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/addsignedurlkey/AsyncAddSignedUrlKey.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendBuckets_AddSignedUrlKey_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.AddSignedUrlKeyBackendBucketRequest;
+import com.google.cloud.compute.v1.BackendBucketsClient;
+import com.google.cloud.compute.v1.SignedUrlKey;
+import com.google.longrunning.Operation;
+
+public class AsyncAddSignedUrlKey {
+
+ public static void main(String[] args) throws Exception {
+ asyncAddSignedUrlKey();
+ }
+
+ public static void asyncAddSignedUrlKey() 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 (BackendBucketsClient backendBucketsClient = BackendBucketsClient.create()) {
+ AddSignedUrlKeyBackendBucketRequest request =
+ AddSignedUrlKeyBackendBucketRequest.newBuilder()
+ .setBackendBucket("backendBucket713751966")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setSignedUrlKeyResource(SignedUrlKey.newBuilder().build())
+ .build();
+ ApiFuture future =
+ backendBucketsClient.addSignedUrlKeyCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendBuckets_AddSignedUrlKey_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/addsignedurlkey/AsyncAddSignedUrlKeyLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/addsignedurlkey/AsyncAddSignedUrlKeyLRO.java
new file mode 100644
index 000000000000..193677b5214e
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/addsignedurlkey/AsyncAddSignedUrlKeyLRO.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendBuckets_AddSignedUrlKey_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.AddSignedUrlKeyBackendBucketRequest;
+import com.google.cloud.compute.v1.BackendBucketsClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.SignedUrlKey;
+
+public class AsyncAddSignedUrlKeyLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncAddSignedUrlKeyLRO();
+ }
+
+ public static void asyncAddSignedUrlKeyLRO() 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 (BackendBucketsClient backendBucketsClient = BackendBucketsClient.create()) {
+ AddSignedUrlKeyBackendBucketRequest request =
+ AddSignedUrlKeyBackendBucketRequest.newBuilder()
+ .setBackendBucket("backendBucket713751966")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setSignedUrlKeyResource(SignedUrlKey.newBuilder().build())
+ .build();
+ OperationFuture future =
+ backendBucketsClient.addSignedUrlKeyOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendBuckets_AddSignedUrlKey_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/addsignedurlkey/SyncAddSignedUrlKey.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/addsignedurlkey/SyncAddSignedUrlKey.java
new file mode 100644
index 000000000000..0a4be75e1037
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/addsignedurlkey/SyncAddSignedUrlKey.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendBuckets_AddSignedUrlKey_sync]
+import com.google.cloud.compute.v1.AddSignedUrlKeyBackendBucketRequest;
+import com.google.cloud.compute.v1.BackendBucketsClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.SignedUrlKey;
+
+public class SyncAddSignedUrlKey {
+
+ public static void main(String[] args) throws Exception {
+ syncAddSignedUrlKey();
+ }
+
+ public static void syncAddSignedUrlKey() 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 (BackendBucketsClient backendBucketsClient = BackendBucketsClient.create()) {
+ AddSignedUrlKeyBackendBucketRequest request =
+ AddSignedUrlKeyBackendBucketRequest.newBuilder()
+ .setBackendBucket("backendBucket713751966")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setSignedUrlKeyResource(SignedUrlKey.newBuilder().build())
+ .build();
+ Operation response = backendBucketsClient.addSignedUrlKeyAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendBuckets_AddSignedUrlKey_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/addsignedurlkey/SyncAddSignedUrlKeyStringStringSignedurlkey.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/addsignedurlkey/SyncAddSignedUrlKeyStringStringSignedurlkey.java
new file mode 100644
index 000000000000..3d6e2c7a2d47
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/addsignedurlkey/SyncAddSignedUrlKeyStringStringSignedurlkey.java
@@ -0,0 +1,47 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendBuckets_AddSignedUrlKey_StringStringSignedurlkey_sync]
+import com.google.cloud.compute.v1.BackendBucketsClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.SignedUrlKey;
+
+public class SyncAddSignedUrlKeyStringStringSignedurlkey {
+
+ public static void main(String[] args) throws Exception {
+ syncAddSignedUrlKeyStringStringSignedurlkey();
+ }
+
+ public static void syncAddSignedUrlKeyStringStringSignedurlkey() 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 (BackendBucketsClient backendBucketsClient = BackendBucketsClient.create()) {
+ String project = "project-309310695";
+ String backendBucket = "backendBucket713751966";
+ SignedUrlKey signedUrlKeyResource = SignedUrlKey.newBuilder().build();
+ Operation response =
+ backendBucketsClient
+ .addSignedUrlKeyAsync(project, backendBucket, signedUrlKeyResource)
+ .get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendBuckets_AddSignedUrlKey_StringStringSignedurlkey_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/create/SyncCreateSetCredentialsProvider.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/create/SyncCreateSetCredentialsProvider.java
new file mode 100644
index 000000000000..8eea0fb2fa05
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendBuckets_Create_SetCredentialsProvider_sync]
+import com.google.api.gax.core.FixedCredentialsProvider;
+import com.google.cloud.compute.v1.BackendBucketsClient;
+import com.google.cloud.compute.v1.BackendBucketsSettings;
+import com.google.cloud.compute.v1.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
+ BackendBucketsSettings backendBucketsSettings =
+ BackendBucketsSettings.newBuilder()
+ .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ .build();
+ BackendBucketsClient backendBucketsClient = BackendBucketsClient.create(backendBucketsSettings);
+ }
+}
+// [END compute_v1_generated_BackendBuckets_Create_SetCredentialsProvider_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/create/SyncCreateSetEndpoint.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/create/SyncCreateSetEndpoint.java
new file mode 100644
index 000000000000..a8edb46b27c5
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendBuckets_Create_SetEndpoint_sync]
+import com.google.cloud.compute.v1.BackendBucketsClient;
+import com.google.cloud.compute.v1.BackendBucketsSettings;
+import com.google.cloud.compute.v1.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
+ BackendBucketsSettings backendBucketsSettings =
+ BackendBucketsSettings.newBuilder().setEndpoint(myEndpoint).build();
+ BackendBucketsClient backendBucketsClient = BackendBucketsClient.create(backendBucketsSettings);
+ }
+}
+// [END compute_v1_generated_BackendBuckets_Create_SetEndpoint_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/delete/AsyncDelete.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/delete/AsyncDelete.java
new file mode 100644
index 000000000000..b388122780e4
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/delete/AsyncDelete.java
@@ -0,0 +1,50 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendBuckets_Delete_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.BackendBucketsClient;
+import com.google.cloud.compute.v1.DeleteBackendBucketRequest;
+import com.google.longrunning.Operation;
+
+public class AsyncDelete {
+
+ public static void main(String[] args) throws Exception {
+ asyncDelete();
+ }
+
+ public static void asyncDelete() 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 (BackendBucketsClient backendBucketsClient = BackendBucketsClient.create()) {
+ DeleteBackendBucketRequest request =
+ DeleteBackendBucketRequest.newBuilder()
+ .setBackendBucket("backendBucket713751966")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ ApiFuture future = backendBucketsClient.deleteCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendBuckets_Delete_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/delete/AsyncDeleteLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/delete/AsyncDeleteLRO.java
new file mode 100644
index 000000000000..ce9fc59bfb89
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/delete/AsyncDeleteLRO.java
@@ -0,0 +1,51 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendBuckets_Delete_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.BackendBucketsClient;
+import com.google.cloud.compute.v1.DeleteBackendBucketRequest;
+import com.google.cloud.compute.v1.Operation;
+
+public class AsyncDeleteLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncDeleteLRO();
+ }
+
+ public static void asyncDeleteLRO() 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 (BackendBucketsClient backendBucketsClient = BackendBucketsClient.create()) {
+ DeleteBackendBucketRequest request =
+ DeleteBackendBucketRequest.newBuilder()
+ .setBackendBucket("backendBucket713751966")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ OperationFuture future =
+ backendBucketsClient.deleteOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendBuckets_Delete_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/delete/SyncDelete.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/delete/SyncDelete.java
new file mode 100644
index 000000000000..d69007fa8a4a
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/delete/SyncDelete.java
@@ -0,0 +1,47 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendBuckets_Delete_sync]
+import com.google.cloud.compute.v1.BackendBucketsClient;
+import com.google.cloud.compute.v1.DeleteBackendBucketRequest;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncDelete {
+
+ public static void main(String[] args) throws Exception {
+ syncDelete();
+ }
+
+ public static void syncDelete() 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 (BackendBucketsClient backendBucketsClient = BackendBucketsClient.create()) {
+ DeleteBackendBucketRequest request =
+ DeleteBackendBucketRequest.newBuilder()
+ .setBackendBucket("backendBucket713751966")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ Operation response = backendBucketsClient.deleteAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendBuckets_Delete_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/delete/SyncDeleteStringString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/delete/SyncDeleteStringString.java
new file mode 100644
index 000000000000..1ccb7ab10442
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/delete/SyncDeleteStringString.java
@@ -0,0 +1,42 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendBuckets_Delete_StringString_sync]
+import com.google.cloud.compute.v1.BackendBucketsClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncDeleteStringString {
+
+ public static void main(String[] args) throws Exception {
+ syncDeleteStringString();
+ }
+
+ public static void syncDeleteStringString() 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 (BackendBucketsClient backendBucketsClient = BackendBucketsClient.create()) {
+ String project = "project-309310695";
+ String backendBucket = "backendBucket713751966";
+ Operation response = backendBucketsClient.deleteAsync(project, backendBucket).get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendBuckets_Delete_StringString_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/deletesignedurlkey/AsyncDeleteSignedUrlKey.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/deletesignedurlkey/AsyncDeleteSignedUrlKey.java
new file mode 100644
index 000000000000..dc4c7e049241
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/deletesignedurlkey/AsyncDeleteSignedUrlKey.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendBuckets_DeleteSignedUrlKey_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.BackendBucketsClient;
+import com.google.cloud.compute.v1.DeleteSignedUrlKeyBackendBucketRequest;
+import com.google.longrunning.Operation;
+
+public class AsyncDeleteSignedUrlKey {
+
+ public static void main(String[] args) throws Exception {
+ asyncDeleteSignedUrlKey();
+ }
+
+ public static void asyncDeleteSignedUrlKey() 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 (BackendBucketsClient backendBucketsClient = BackendBucketsClient.create()) {
+ DeleteSignedUrlKeyBackendBucketRequest request =
+ DeleteSignedUrlKeyBackendBucketRequest.newBuilder()
+ .setBackendBucket("backendBucket713751966")
+ .setKeyName("keyName-815643254")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ ApiFuture future =
+ backendBucketsClient.deleteSignedUrlKeyCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendBuckets_DeleteSignedUrlKey_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/deletesignedurlkey/AsyncDeleteSignedUrlKeyLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/deletesignedurlkey/AsyncDeleteSignedUrlKeyLRO.java
new file mode 100644
index 000000000000..18cf7209bf28
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/deletesignedurlkey/AsyncDeleteSignedUrlKeyLRO.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendBuckets_DeleteSignedUrlKey_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.BackendBucketsClient;
+import com.google.cloud.compute.v1.DeleteSignedUrlKeyBackendBucketRequest;
+import com.google.cloud.compute.v1.Operation;
+
+public class AsyncDeleteSignedUrlKeyLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncDeleteSignedUrlKeyLRO();
+ }
+
+ public static void asyncDeleteSignedUrlKeyLRO() 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 (BackendBucketsClient backendBucketsClient = BackendBucketsClient.create()) {
+ DeleteSignedUrlKeyBackendBucketRequest request =
+ DeleteSignedUrlKeyBackendBucketRequest.newBuilder()
+ .setBackendBucket("backendBucket713751966")
+ .setKeyName("keyName-815643254")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ OperationFuture future =
+ backendBucketsClient.deleteSignedUrlKeyOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendBuckets_DeleteSignedUrlKey_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/deletesignedurlkey/SyncDeleteSignedUrlKey.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/deletesignedurlkey/SyncDeleteSignedUrlKey.java
new file mode 100644
index 000000000000..9b75b7d6a4f5
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/deletesignedurlkey/SyncDeleteSignedUrlKey.java
@@ -0,0 +1,48 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendBuckets_DeleteSignedUrlKey_sync]
+import com.google.cloud.compute.v1.BackendBucketsClient;
+import com.google.cloud.compute.v1.DeleteSignedUrlKeyBackendBucketRequest;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncDeleteSignedUrlKey {
+
+ public static void main(String[] args) throws Exception {
+ syncDeleteSignedUrlKey();
+ }
+
+ public static void syncDeleteSignedUrlKey() 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 (BackendBucketsClient backendBucketsClient = BackendBucketsClient.create()) {
+ DeleteSignedUrlKeyBackendBucketRequest request =
+ DeleteSignedUrlKeyBackendBucketRequest.newBuilder()
+ .setBackendBucket("backendBucket713751966")
+ .setKeyName("keyName-815643254")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ Operation response = backendBucketsClient.deleteSignedUrlKeyAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendBuckets_DeleteSignedUrlKey_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/deletesignedurlkey/SyncDeleteSignedUrlKeyStringStringString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/deletesignedurlkey/SyncDeleteSignedUrlKeyStringStringString.java
new file mode 100644
index 000000000000..0d492201f4bb
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/deletesignedurlkey/SyncDeleteSignedUrlKeyStringStringString.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendBuckets_DeleteSignedUrlKey_StringStringString_sync]
+import com.google.cloud.compute.v1.BackendBucketsClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncDeleteSignedUrlKeyStringStringString {
+
+ public static void main(String[] args) throws Exception {
+ syncDeleteSignedUrlKeyStringStringString();
+ }
+
+ public static void syncDeleteSignedUrlKeyStringStringString() 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 (BackendBucketsClient backendBucketsClient = BackendBucketsClient.create()) {
+ String project = "project-309310695";
+ String backendBucket = "backendBucket713751966";
+ String keyName = "keyName-815643254";
+ Operation response =
+ backendBucketsClient.deleteSignedUrlKeyAsync(project, backendBucket, keyName).get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendBuckets_DeleteSignedUrlKey_StringStringString_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/get/AsyncGet.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/get/AsyncGet.java
new file mode 100644
index 000000000000..9a0b60738ad9
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/get/AsyncGet.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendBuckets_Get_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.BackendBucket;
+import com.google.cloud.compute.v1.BackendBucketsClient;
+import com.google.cloud.compute.v1.GetBackendBucketRequest;
+
+public class AsyncGet {
+
+ public static void main(String[] args) throws Exception {
+ asyncGet();
+ }
+
+ public static void asyncGet() 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 (BackendBucketsClient backendBucketsClient = BackendBucketsClient.create()) {
+ GetBackendBucketRequest request =
+ GetBackendBucketRequest.newBuilder()
+ .setBackendBucket("backendBucket713751966")
+ .setProject("project-309310695")
+ .build();
+ ApiFuture future = backendBucketsClient.getCallable().futureCall(request);
+ // Do something.
+ BackendBucket response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendBuckets_Get_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/get/SyncGet.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/get/SyncGet.java
new file mode 100644
index 000000000000..034a70e4e13c
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/get/SyncGet.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendBuckets_Get_sync]
+import com.google.cloud.compute.v1.BackendBucket;
+import com.google.cloud.compute.v1.BackendBucketsClient;
+import com.google.cloud.compute.v1.GetBackendBucketRequest;
+
+public class SyncGet {
+
+ public static void main(String[] args) throws Exception {
+ syncGet();
+ }
+
+ public static void syncGet() 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 (BackendBucketsClient backendBucketsClient = BackendBucketsClient.create()) {
+ GetBackendBucketRequest request =
+ GetBackendBucketRequest.newBuilder()
+ .setBackendBucket("backendBucket713751966")
+ .setProject("project-309310695")
+ .build();
+ BackendBucket response = backendBucketsClient.get(request);
+ }
+ }
+}
+// [END compute_v1_generated_BackendBuckets_Get_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/get/SyncGetStringString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/get/SyncGetStringString.java
new file mode 100644
index 000000000000..7a90c483697c
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/get/SyncGetStringString.java
@@ -0,0 +1,42 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendBuckets_Get_StringString_sync]
+import com.google.cloud.compute.v1.BackendBucket;
+import com.google.cloud.compute.v1.BackendBucketsClient;
+
+public class SyncGetStringString {
+
+ public static void main(String[] args) throws Exception {
+ syncGetStringString();
+ }
+
+ public static void syncGetStringString() 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 (BackendBucketsClient backendBucketsClient = BackendBucketsClient.create()) {
+ String project = "project-309310695";
+ String backendBucket = "backendBucket713751966";
+ BackendBucket response = backendBucketsClient.get(project, backendBucket);
+ }
+ }
+}
+// [END compute_v1_generated_BackendBuckets_Get_StringString_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/insert/AsyncInsert.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/insert/AsyncInsert.java
new file mode 100644
index 000000000000..6bf859c8486a
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/insert/AsyncInsert.java
@@ -0,0 +1,51 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendBuckets_Insert_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.BackendBucket;
+import com.google.cloud.compute.v1.BackendBucketsClient;
+import com.google.cloud.compute.v1.InsertBackendBucketRequest;
+import com.google.longrunning.Operation;
+
+public class AsyncInsert {
+
+ public static void main(String[] args) throws Exception {
+ asyncInsert();
+ }
+
+ public static void asyncInsert() 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 (BackendBucketsClient backendBucketsClient = BackendBucketsClient.create()) {
+ InsertBackendBucketRequest request =
+ InsertBackendBucketRequest.newBuilder()
+ .setBackendBucketResource(BackendBucket.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ ApiFuture future = backendBucketsClient.insertCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendBuckets_Insert_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/insert/AsyncInsertLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/insert/AsyncInsertLRO.java
new file mode 100644
index 000000000000..31b636a90a9c
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/insert/AsyncInsertLRO.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendBuckets_Insert_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.BackendBucket;
+import com.google.cloud.compute.v1.BackendBucketsClient;
+import com.google.cloud.compute.v1.InsertBackendBucketRequest;
+import com.google.cloud.compute.v1.Operation;
+
+public class AsyncInsertLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncInsertLRO();
+ }
+
+ public static void asyncInsertLRO() 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 (BackendBucketsClient backendBucketsClient = BackendBucketsClient.create()) {
+ InsertBackendBucketRequest request =
+ InsertBackendBucketRequest.newBuilder()
+ .setBackendBucketResource(BackendBucket.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ OperationFuture future =
+ backendBucketsClient.insertOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendBuckets_Insert_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/insert/SyncInsert.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/insert/SyncInsert.java
new file mode 100644
index 000000000000..381ff86c6e86
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/insert/SyncInsert.java
@@ -0,0 +1,48 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendBuckets_Insert_sync]
+import com.google.cloud.compute.v1.BackendBucket;
+import com.google.cloud.compute.v1.BackendBucketsClient;
+import com.google.cloud.compute.v1.InsertBackendBucketRequest;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncInsert {
+
+ public static void main(String[] args) throws Exception {
+ syncInsert();
+ }
+
+ public static void syncInsert() 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 (BackendBucketsClient backendBucketsClient = BackendBucketsClient.create()) {
+ InsertBackendBucketRequest request =
+ InsertBackendBucketRequest.newBuilder()
+ .setBackendBucketResource(BackendBucket.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ Operation response = backendBucketsClient.insertAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendBuckets_Insert_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/insert/SyncInsertStringBackendbucket.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/insert/SyncInsertStringBackendbucket.java
new file mode 100644
index 000000000000..a0d173c27aa4
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/insert/SyncInsertStringBackendbucket.java
@@ -0,0 +1,43 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendBuckets_Insert_StringBackendbucket_sync]
+import com.google.cloud.compute.v1.BackendBucket;
+import com.google.cloud.compute.v1.BackendBucketsClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncInsertStringBackendbucket {
+
+ public static void main(String[] args) throws Exception {
+ syncInsertStringBackendbucket();
+ }
+
+ public static void syncInsertStringBackendbucket() 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 (BackendBucketsClient backendBucketsClient = BackendBucketsClient.create()) {
+ String project = "project-309310695";
+ BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
+ Operation response = backendBucketsClient.insertAsync(project, backendBucketResource).get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendBuckets_Insert_StringBackendbucket_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/list/AsyncList.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/list/AsyncList.java
new file mode 100644
index 000000000000..d9bc856c79c1
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/list/AsyncList.java
@@ -0,0 +1,56 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendBuckets_List_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.BackendBucket;
+import com.google.cloud.compute.v1.BackendBucketsClient;
+import com.google.cloud.compute.v1.ListBackendBucketsRequest;
+
+public class AsyncList {
+
+ public static void main(String[] args) throws Exception {
+ asyncList();
+ }
+
+ public static void asyncList() 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 (BackendBucketsClient backendBucketsClient = BackendBucketsClient.create()) {
+ ListBackendBucketsRequest request =
+ ListBackendBucketsRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .build();
+ ApiFuture future =
+ backendBucketsClient.listPagedCallable().futureCall(request);
+ // Do something.
+ for (BackendBucket element : future.get().iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_BackendBuckets_List_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/list/AsyncListPaged.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/list/AsyncListPaged.java
new file mode 100644
index 000000000000..1d393f68fab2
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/list/AsyncListPaged.java
@@ -0,0 +1,63 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendBuckets_List_Paged_async]
+import com.google.cloud.compute.v1.BackendBucket;
+import com.google.cloud.compute.v1.BackendBucketList;
+import com.google.cloud.compute.v1.BackendBucketsClient;
+import com.google.cloud.compute.v1.ListBackendBucketsRequest;
+import com.google.common.base.Strings;
+
+public class AsyncListPaged {
+
+ public static void main(String[] args) throws Exception {
+ asyncListPaged();
+ }
+
+ public static void asyncListPaged() 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 (BackendBucketsClient backendBucketsClient = BackendBucketsClient.create()) {
+ ListBackendBucketsRequest request =
+ ListBackendBucketsRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .build();
+ while (true) {
+ BackendBucketList response = backendBucketsClient.listCallable().call(request);
+ for (BackendBucket element : response.getItemsList()) {
+ // doThingsWith(element);
+ }
+ String nextPageToken = response.getNextPageToken();
+ if (!Strings.isNullOrEmpty(nextPageToken)) {
+ request = request.toBuilder().setPageToken(nextPageToken).build();
+ } else {
+ break;
+ }
+ }
+ }
+ }
+}
+// [END compute_v1_generated_BackendBuckets_List_Paged_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/list/SyncList.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/list/SyncList.java
new file mode 100644
index 000000000000..91a1010f6df2
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/list/SyncList.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendBuckets_List_sync]
+import com.google.cloud.compute.v1.BackendBucket;
+import com.google.cloud.compute.v1.BackendBucketsClient;
+import com.google.cloud.compute.v1.ListBackendBucketsRequest;
+
+public class SyncList {
+
+ public static void main(String[] args) throws Exception {
+ syncList();
+ }
+
+ public static void syncList() 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 (BackendBucketsClient backendBucketsClient = BackendBucketsClient.create()) {
+ ListBackendBucketsRequest request =
+ ListBackendBucketsRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .build();
+ for (BackendBucket element : backendBucketsClient.list(request).iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_BackendBuckets_List_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/list/SyncListString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/list/SyncListString.java
new file mode 100644
index 000000000000..c4a79fcb4210
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/list/SyncListString.java
@@ -0,0 +1,43 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendBuckets_List_String_sync]
+import com.google.cloud.compute.v1.BackendBucket;
+import com.google.cloud.compute.v1.BackendBucketsClient;
+
+public class SyncListString {
+
+ public static void main(String[] args) throws Exception {
+ syncListString();
+ }
+
+ public static void syncListString() 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 (BackendBucketsClient backendBucketsClient = BackendBucketsClient.create()) {
+ String project = "project-309310695";
+ for (BackendBucket element : backendBucketsClient.list(project).iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_BackendBuckets_List_String_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/patch/AsyncPatch.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/patch/AsyncPatch.java
new file mode 100644
index 000000000000..c19c1f0f342c
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/patch/AsyncPatch.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendBuckets_Patch_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.BackendBucket;
+import com.google.cloud.compute.v1.BackendBucketsClient;
+import com.google.cloud.compute.v1.PatchBackendBucketRequest;
+import com.google.longrunning.Operation;
+
+public class AsyncPatch {
+
+ public static void main(String[] args) throws Exception {
+ asyncPatch();
+ }
+
+ public static void asyncPatch() 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 (BackendBucketsClient backendBucketsClient = BackendBucketsClient.create()) {
+ PatchBackendBucketRequest request =
+ PatchBackendBucketRequest.newBuilder()
+ .setBackendBucket("backendBucket713751966")
+ .setBackendBucketResource(BackendBucket.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ ApiFuture future = backendBucketsClient.patchCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendBuckets_Patch_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/patch/AsyncPatchLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/patch/AsyncPatchLRO.java
new file mode 100644
index 000000000000..b6b4afc2bc6c
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/patch/AsyncPatchLRO.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendBuckets_Patch_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.BackendBucket;
+import com.google.cloud.compute.v1.BackendBucketsClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.PatchBackendBucketRequest;
+
+public class AsyncPatchLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncPatchLRO();
+ }
+
+ public static void asyncPatchLRO() 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 (BackendBucketsClient backendBucketsClient = BackendBucketsClient.create()) {
+ PatchBackendBucketRequest request =
+ PatchBackendBucketRequest.newBuilder()
+ .setBackendBucket("backendBucket713751966")
+ .setBackendBucketResource(BackendBucket.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ OperationFuture future =
+ backendBucketsClient.patchOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendBuckets_Patch_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/patch/SyncPatch.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/patch/SyncPatch.java
new file mode 100644
index 000000000000..1056859c7caf
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/patch/SyncPatch.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendBuckets_Patch_sync]
+import com.google.cloud.compute.v1.BackendBucket;
+import com.google.cloud.compute.v1.BackendBucketsClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.PatchBackendBucketRequest;
+
+public class SyncPatch {
+
+ public static void main(String[] args) throws Exception {
+ syncPatch();
+ }
+
+ public static void syncPatch() 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 (BackendBucketsClient backendBucketsClient = BackendBucketsClient.create()) {
+ PatchBackendBucketRequest request =
+ PatchBackendBucketRequest.newBuilder()
+ .setBackendBucket("backendBucket713751966")
+ .setBackendBucketResource(BackendBucket.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ Operation response = backendBucketsClient.patchAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendBuckets_Patch_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/patch/SyncPatchStringStringBackendbucket.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/patch/SyncPatchStringStringBackendbucket.java
new file mode 100644
index 000000000000..148753f0a831
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/patch/SyncPatchStringStringBackendbucket.java
@@ -0,0 +1,45 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendBuckets_Patch_StringStringBackendbucket_sync]
+import com.google.cloud.compute.v1.BackendBucket;
+import com.google.cloud.compute.v1.BackendBucketsClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncPatchStringStringBackendbucket {
+
+ public static void main(String[] args) throws Exception {
+ syncPatchStringStringBackendbucket();
+ }
+
+ public static void syncPatchStringStringBackendbucket() 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 (BackendBucketsClient backendBucketsClient = BackendBucketsClient.create()) {
+ String project = "project-309310695";
+ String backendBucket = "backendBucket713751966";
+ BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
+ Operation response =
+ backendBucketsClient.patchAsync(project, backendBucket, backendBucketResource).get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendBuckets_Patch_StringStringBackendbucket_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/setedgesecuritypolicy/AsyncSetEdgeSecurityPolicy.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/setedgesecuritypolicy/AsyncSetEdgeSecurityPolicy.java
new file mode 100644
index 000000000000..891c0bd700dc
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/setedgesecuritypolicy/AsyncSetEdgeSecurityPolicy.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendBuckets_SetEdgeSecurityPolicy_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.BackendBucketsClient;
+import com.google.cloud.compute.v1.SecurityPolicyReference;
+import com.google.cloud.compute.v1.SetEdgeSecurityPolicyBackendBucketRequest;
+import com.google.longrunning.Operation;
+
+public class AsyncSetEdgeSecurityPolicy {
+
+ public static void main(String[] args) throws Exception {
+ asyncSetEdgeSecurityPolicy();
+ }
+
+ public static void asyncSetEdgeSecurityPolicy() 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 (BackendBucketsClient backendBucketsClient = BackendBucketsClient.create()) {
+ SetEdgeSecurityPolicyBackendBucketRequest request =
+ SetEdgeSecurityPolicyBackendBucketRequest.newBuilder()
+ .setBackendBucket("backendBucket713751966")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setSecurityPolicyReferenceResource(SecurityPolicyReference.newBuilder().build())
+ .build();
+ ApiFuture future =
+ backendBucketsClient.setEdgeSecurityPolicyCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendBuckets_SetEdgeSecurityPolicy_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/setedgesecuritypolicy/AsyncSetEdgeSecurityPolicyLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/setedgesecuritypolicy/AsyncSetEdgeSecurityPolicyLRO.java
new file mode 100644
index 000000000000..0728850adca3
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/setedgesecuritypolicy/AsyncSetEdgeSecurityPolicyLRO.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendBuckets_SetEdgeSecurityPolicy_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.BackendBucketsClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.SecurityPolicyReference;
+import com.google.cloud.compute.v1.SetEdgeSecurityPolicyBackendBucketRequest;
+
+public class AsyncSetEdgeSecurityPolicyLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncSetEdgeSecurityPolicyLRO();
+ }
+
+ public static void asyncSetEdgeSecurityPolicyLRO() 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 (BackendBucketsClient backendBucketsClient = BackendBucketsClient.create()) {
+ SetEdgeSecurityPolicyBackendBucketRequest request =
+ SetEdgeSecurityPolicyBackendBucketRequest.newBuilder()
+ .setBackendBucket("backendBucket713751966")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setSecurityPolicyReferenceResource(SecurityPolicyReference.newBuilder().build())
+ .build();
+ OperationFuture future =
+ backendBucketsClient.setEdgeSecurityPolicyOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendBuckets_SetEdgeSecurityPolicy_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/setedgesecuritypolicy/SyncSetEdgeSecurityPolicy.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/setedgesecuritypolicy/SyncSetEdgeSecurityPolicy.java
new file mode 100644
index 000000000000..7be792b5b6be
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/setedgesecuritypolicy/SyncSetEdgeSecurityPolicy.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendBuckets_SetEdgeSecurityPolicy_sync]
+import com.google.cloud.compute.v1.BackendBucketsClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.SecurityPolicyReference;
+import com.google.cloud.compute.v1.SetEdgeSecurityPolicyBackendBucketRequest;
+
+public class SyncSetEdgeSecurityPolicy {
+
+ public static void main(String[] args) throws Exception {
+ syncSetEdgeSecurityPolicy();
+ }
+
+ public static void syncSetEdgeSecurityPolicy() 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 (BackendBucketsClient backendBucketsClient = BackendBucketsClient.create()) {
+ SetEdgeSecurityPolicyBackendBucketRequest request =
+ SetEdgeSecurityPolicyBackendBucketRequest.newBuilder()
+ .setBackendBucket("backendBucket713751966")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setSecurityPolicyReferenceResource(SecurityPolicyReference.newBuilder().build())
+ .build();
+ Operation response = backendBucketsClient.setEdgeSecurityPolicyAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendBuckets_SetEdgeSecurityPolicy_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/setedgesecuritypolicy/SyncSetEdgeSecurityPolicyStringStringSecuritypolicyreference.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/setedgesecuritypolicy/SyncSetEdgeSecurityPolicyStringStringSecuritypolicyreference.java
new file mode 100644
index 000000000000..9de41b6e054d
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/setedgesecuritypolicy/SyncSetEdgeSecurityPolicyStringStringSecuritypolicyreference.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendBuckets_SetEdgeSecurityPolicy_StringStringSecuritypolicyreference_sync]
+import com.google.cloud.compute.v1.BackendBucketsClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.SecurityPolicyReference;
+
+public class SyncSetEdgeSecurityPolicyStringStringSecuritypolicyreference {
+
+ public static void main(String[] args) throws Exception {
+ syncSetEdgeSecurityPolicyStringStringSecuritypolicyreference();
+ }
+
+ public static void syncSetEdgeSecurityPolicyStringStringSecuritypolicyreference()
+ 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 (BackendBucketsClient backendBucketsClient = BackendBucketsClient.create()) {
+ String project = "project-309310695";
+ String backendBucket = "backendBucket713751966";
+ SecurityPolicyReference securityPolicyReferenceResource =
+ SecurityPolicyReference.newBuilder().build();
+ Operation response =
+ backendBucketsClient
+ .setEdgeSecurityPolicyAsync(project, backendBucket, securityPolicyReferenceResource)
+ .get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendBuckets_SetEdgeSecurityPolicy_StringStringSecuritypolicyreference_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/update/AsyncUpdate.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/update/AsyncUpdate.java
new file mode 100644
index 000000000000..0c8d06f1aaf6
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/update/AsyncUpdate.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendBuckets_Update_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.BackendBucket;
+import com.google.cloud.compute.v1.BackendBucketsClient;
+import com.google.cloud.compute.v1.UpdateBackendBucketRequest;
+import com.google.longrunning.Operation;
+
+public class AsyncUpdate {
+
+ public static void main(String[] args) throws Exception {
+ asyncUpdate();
+ }
+
+ public static void asyncUpdate() 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 (BackendBucketsClient backendBucketsClient = BackendBucketsClient.create()) {
+ UpdateBackendBucketRequest request =
+ UpdateBackendBucketRequest.newBuilder()
+ .setBackendBucket("backendBucket713751966")
+ .setBackendBucketResource(BackendBucket.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ ApiFuture future = backendBucketsClient.updateCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendBuckets_Update_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/update/AsyncUpdateLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/update/AsyncUpdateLRO.java
new file mode 100644
index 000000000000..380aba4df3d3
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/update/AsyncUpdateLRO.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendBuckets_Update_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.BackendBucket;
+import com.google.cloud.compute.v1.BackendBucketsClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.UpdateBackendBucketRequest;
+
+public class AsyncUpdateLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncUpdateLRO();
+ }
+
+ public static void asyncUpdateLRO() 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 (BackendBucketsClient backendBucketsClient = BackendBucketsClient.create()) {
+ UpdateBackendBucketRequest request =
+ UpdateBackendBucketRequest.newBuilder()
+ .setBackendBucket("backendBucket713751966")
+ .setBackendBucketResource(BackendBucket.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ OperationFuture future =
+ backendBucketsClient.updateOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendBuckets_Update_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/update/SyncUpdate.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/update/SyncUpdate.java
new file mode 100644
index 000000000000..7d63a721dd9f
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/update/SyncUpdate.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendBuckets_Update_sync]
+import com.google.cloud.compute.v1.BackendBucket;
+import com.google.cloud.compute.v1.BackendBucketsClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.UpdateBackendBucketRequest;
+
+public class SyncUpdate {
+
+ public static void main(String[] args) throws Exception {
+ syncUpdate();
+ }
+
+ public static void syncUpdate() 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 (BackendBucketsClient backendBucketsClient = BackendBucketsClient.create()) {
+ UpdateBackendBucketRequest request =
+ UpdateBackendBucketRequest.newBuilder()
+ .setBackendBucket("backendBucket713751966")
+ .setBackendBucketResource(BackendBucket.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ Operation response = backendBucketsClient.updateAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendBuckets_Update_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/update/SyncUpdateStringStringBackendbucket.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/update/SyncUpdateStringStringBackendbucket.java
new file mode 100644
index 000000000000..5d80bb91f366
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbuckets/update/SyncUpdateStringStringBackendbucket.java
@@ -0,0 +1,45 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendBuckets_Update_StringStringBackendbucket_sync]
+import com.google.cloud.compute.v1.BackendBucket;
+import com.google.cloud.compute.v1.BackendBucketsClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncUpdateStringStringBackendbucket {
+
+ public static void main(String[] args) throws Exception {
+ syncUpdateStringStringBackendbucket();
+ }
+
+ public static void syncUpdateStringStringBackendbucket() 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 (BackendBucketsClient backendBucketsClient = BackendBucketsClient.create()) {
+ String project = "project-309310695";
+ String backendBucket = "backendBucket713751966";
+ BackendBucket backendBucketResource = BackendBucket.newBuilder().build();
+ Operation response =
+ backendBucketsClient.updateAsync(project, backendBucket, backendBucketResource).get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendBuckets_Update_StringStringBackendbucket_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbucketssettings/get/SyncGet.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbucketssettings/get/SyncGet.java
new file mode 100644
index 000000000000..15a8ef6e9e67
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendbucketssettings/get/SyncGet.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendBucketsSettings_Get_sync]
+import com.google.cloud.compute.v1.BackendBucketsSettings;
+import java.time.Duration;
+
+public class SyncGet {
+
+ public static void main(String[] args) throws Exception {
+ syncGet();
+ }
+
+ public static void syncGet() 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
+ BackendBucketsSettings.Builder backendBucketsSettingsBuilder =
+ BackendBucketsSettings.newBuilder();
+ backendBucketsSettingsBuilder
+ .getSettings()
+ .setRetrySettings(
+ backendBucketsSettingsBuilder
+ .getSettings()
+ .getRetrySettings()
+ .toBuilder()
+ .setTotalTimeout(Duration.ofSeconds(30))
+ .build());
+ BackendBucketsSettings backendBucketsSettings = backendBucketsSettingsBuilder.build();
+ }
+}
+// [END compute_v1_generated_BackendBucketsSettings_Get_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/addsignedurlkey/AsyncAddSignedUrlKey.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/addsignedurlkey/AsyncAddSignedUrlKey.java
new file mode 100644
index 000000000000..d674567aa313
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/addsignedurlkey/AsyncAddSignedUrlKey.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_AddSignedUrlKey_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.AddSignedUrlKeyBackendServiceRequest;
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.SignedUrlKey;
+import com.google.longrunning.Operation;
+
+public class AsyncAddSignedUrlKey {
+
+ public static void main(String[] args) throws Exception {
+ asyncAddSignedUrlKey();
+ }
+
+ public static void asyncAddSignedUrlKey() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ AddSignedUrlKeyBackendServiceRequest request =
+ AddSignedUrlKeyBackendServiceRequest.newBuilder()
+ .setBackendService("backendService-1884714623")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setSignedUrlKeyResource(SignedUrlKey.newBuilder().build())
+ .build();
+ ApiFuture future =
+ backendServicesClient.addSignedUrlKeyCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_AddSignedUrlKey_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/addsignedurlkey/AsyncAddSignedUrlKeyLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/addsignedurlkey/AsyncAddSignedUrlKeyLRO.java
new file mode 100644
index 000000000000..904ed1b87e16
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/addsignedurlkey/AsyncAddSignedUrlKeyLRO.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_AddSignedUrlKey_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.AddSignedUrlKeyBackendServiceRequest;
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.SignedUrlKey;
+
+public class AsyncAddSignedUrlKeyLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncAddSignedUrlKeyLRO();
+ }
+
+ public static void asyncAddSignedUrlKeyLRO() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ AddSignedUrlKeyBackendServiceRequest request =
+ AddSignedUrlKeyBackendServiceRequest.newBuilder()
+ .setBackendService("backendService-1884714623")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setSignedUrlKeyResource(SignedUrlKey.newBuilder().build())
+ .build();
+ OperationFuture future =
+ backendServicesClient.addSignedUrlKeyOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_AddSignedUrlKey_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/addsignedurlkey/SyncAddSignedUrlKey.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/addsignedurlkey/SyncAddSignedUrlKey.java
new file mode 100644
index 000000000000..3da8a7647a3b
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/addsignedurlkey/SyncAddSignedUrlKey.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_AddSignedUrlKey_sync]
+import com.google.cloud.compute.v1.AddSignedUrlKeyBackendServiceRequest;
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.SignedUrlKey;
+
+public class SyncAddSignedUrlKey {
+
+ public static void main(String[] args) throws Exception {
+ syncAddSignedUrlKey();
+ }
+
+ public static void syncAddSignedUrlKey() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ AddSignedUrlKeyBackendServiceRequest request =
+ AddSignedUrlKeyBackendServiceRequest.newBuilder()
+ .setBackendService("backendService-1884714623")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setSignedUrlKeyResource(SignedUrlKey.newBuilder().build())
+ .build();
+ Operation response = backendServicesClient.addSignedUrlKeyAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_AddSignedUrlKey_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/addsignedurlkey/SyncAddSignedUrlKeyStringStringSignedurlkey.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/addsignedurlkey/SyncAddSignedUrlKeyStringStringSignedurlkey.java
new file mode 100644
index 000000000000..57dc696a2545
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/addsignedurlkey/SyncAddSignedUrlKeyStringStringSignedurlkey.java
@@ -0,0 +1,47 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_AddSignedUrlKey_StringStringSignedurlkey_sync]
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.SignedUrlKey;
+
+public class SyncAddSignedUrlKeyStringStringSignedurlkey {
+
+ public static void main(String[] args) throws Exception {
+ syncAddSignedUrlKeyStringStringSignedurlkey();
+ }
+
+ public static void syncAddSignedUrlKeyStringStringSignedurlkey() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ String project = "project-309310695";
+ String backendService = "backendService-1884714623";
+ SignedUrlKey signedUrlKeyResource = SignedUrlKey.newBuilder().build();
+ Operation response =
+ backendServicesClient
+ .addSignedUrlKeyAsync(project, backendService, signedUrlKeyResource)
+ .get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_AddSignedUrlKey_StringStringSignedurlkey_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/aggregatedlist/AsyncAggregatedList.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/aggregatedlist/AsyncAggregatedList.java
new file mode 100644
index 000000000000..5a9033302ab0
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/aggregatedlist/AsyncAggregatedList.java
@@ -0,0 +1,58 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_AggregatedList_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.AggregatedListBackendServicesRequest;
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.BackendServicesScopedList;
+import java.util.Map;
+
+public class AsyncAggregatedList {
+
+ public static void main(String[] args) throws Exception {
+ asyncAggregatedList();
+ }
+
+ public static void asyncAggregatedList() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ AggregatedListBackendServicesRequest request =
+ AggregatedListBackendServicesRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setIncludeAllScopes(true)
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .build();
+ ApiFuture> future =
+ backendServicesClient.aggregatedListPagedCallable().futureCall(request);
+ // Do something.
+ for (Map.Entry element : future.get().iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_AggregatedList_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/aggregatedlist/AsyncAggregatedListPaged.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/aggregatedlist/AsyncAggregatedListPaged.java
new file mode 100644
index 000000000000..50c9b94cc96c
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/aggregatedlist/AsyncAggregatedListPaged.java
@@ -0,0 +1,66 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_AggregatedList_Paged_async]
+import com.google.cloud.compute.v1.AggregatedListBackendServicesRequest;
+import com.google.cloud.compute.v1.BackendServiceAggregatedList;
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.BackendServicesScopedList;
+import com.google.common.base.Strings;
+import java.util.Map;
+
+public class AsyncAggregatedListPaged {
+
+ public static void main(String[] args) throws Exception {
+ asyncAggregatedListPaged();
+ }
+
+ public static void asyncAggregatedListPaged() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ AggregatedListBackendServicesRequest request =
+ AggregatedListBackendServicesRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setIncludeAllScopes(true)
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .build();
+ while (true) {
+ BackendServiceAggregatedList response =
+ backendServicesClient.aggregatedListCallable().call(request);
+ for (Map.Entry element : response.getItemsList()) {
+ // doThingsWith(element);
+ }
+ String nextPageToken = response.getNextPageToken();
+ if (!Strings.isNullOrEmpty(nextPageToken)) {
+ request = request.toBuilder().setPageToken(nextPageToken).build();
+ } else {
+ break;
+ }
+ }
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_AggregatedList_Paged_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/aggregatedlist/SyncAggregatedList.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/aggregatedlist/SyncAggregatedList.java
new file mode 100644
index 000000000000..0e15cd3e4ae5
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/aggregatedlist/SyncAggregatedList.java
@@ -0,0 +1,55 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_AggregatedList_sync]
+import com.google.cloud.compute.v1.AggregatedListBackendServicesRequest;
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.BackendServicesScopedList;
+import java.util.Map;
+
+public class SyncAggregatedList {
+
+ public static void main(String[] args) throws Exception {
+ syncAggregatedList();
+ }
+
+ public static void syncAggregatedList() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ AggregatedListBackendServicesRequest request =
+ AggregatedListBackendServicesRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setIncludeAllScopes(true)
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .build();
+ for (Map.Entry element :
+ backendServicesClient.aggregatedList(request).iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_AggregatedList_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/aggregatedlist/SyncAggregatedListString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/aggregatedlist/SyncAggregatedListString.java
new file mode 100644
index 000000000000..59893fe72a83
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/aggregatedlist/SyncAggregatedListString.java
@@ -0,0 +1,45 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_AggregatedList_String_sync]
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.BackendServicesScopedList;
+import java.util.Map;
+
+public class SyncAggregatedListString {
+
+ public static void main(String[] args) throws Exception {
+ syncAggregatedListString();
+ }
+
+ public static void syncAggregatedListString() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ String project = "project-309310695";
+ for (Map.Entry element :
+ backendServicesClient.aggregatedList(project).iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_AggregatedList_String_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/create/SyncCreateSetCredentialsProvider.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/create/SyncCreateSetCredentialsProvider.java
new file mode 100644
index 000000000000..b3b9153c35be
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/create/SyncCreateSetCredentialsProvider.java
@@ -0,0 +1,45 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_Create_SetCredentialsProvider_sync]
+import com.google.api.gax.core.FixedCredentialsProvider;
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.BackendServicesSettings;
+import com.google.cloud.compute.v1.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
+ BackendServicesSettings backendServicesSettings =
+ BackendServicesSettings.newBuilder()
+ .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ .build();
+ BackendServicesClient backendServicesClient =
+ BackendServicesClient.create(backendServicesSettings);
+ }
+}
+// [END compute_v1_generated_BackendServices_Create_SetCredentialsProvider_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/create/SyncCreateSetEndpoint.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/create/SyncCreateSetEndpoint.java
new file mode 100644
index 000000000000..03c4179de6b2
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/create/SyncCreateSetEndpoint.java
@@ -0,0 +1,42 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_Create_SetEndpoint_sync]
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.BackendServicesSettings;
+import com.google.cloud.compute.v1.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
+ BackendServicesSettings backendServicesSettings =
+ BackendServicesSettings.newBuilder().setEndpoint(myEndpoint).build();
+ BackendServicesClient backendServicesClient =
+ BackendServicesClient.create(backendServicesSettings);
+ }
+}
+// [END compute_v1_generated_BackendServices_Create_SetEndpoint_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/delete/AsyncDelete.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/delete/AsyncDelete.java
new file mode 100644
index 000000000000..722d33d01b79
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/delete/AsyncDelete.java
@@ -0,0 +1,50 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_Delete_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.DeleteBackendServiceRequest;
+import com.google.longrunning.Operation;
+
+public class AsyncDelete {
+
+ public static void main(String[] args) throws Exception {
+ asyncDelete();
+ }
+
+ public static void asyncDelete() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ DeleteBackendServiceRequest request =
+ DeleteBackendServiceRequest.newBuilder()
+ .setBackendService("backendService-1884714623")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ ApiFuture future = backendServicesClient.deleteCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_Delete_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/delete/AsyncDeleteLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/delete/AsyncDeleteLRO.java
new file mode 100644
index 000000000000..8842524efb68
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/delete/AsyncDeleteLRO.java
@@ -0,0 +1,51 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_Delete_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.DeleteBackendServiceRequest;
+import com.google.cloud.compute.v1.Operation;
+
+public class AsyncDeleteLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncDeleteLRO();
+ }
+
+ public static void asyncDeleteLRO() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ DeleteBackendServiceRequest request =
+ DeleteBackendServiceRequest.newBuilder()
+ .setBackendService("backendService-1884714623")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ OperationFuture future =
+ backendServicesClient.deleteOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_Delete_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/delete/SyncDelete.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/delete/SyncDelete.java
new file mode 100644
index 000000000000..cf5f95f21b88
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/delete/SyncDelete.java
@@ -0,0 +1,47 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_Delete_sync]
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.DeleteBackendServiceRequest;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncDelete {
+
+ public static void main(String[] args) throws Exception {
+ syncDelete();
+ }
+
+ public static void syncDelete() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ DeleteBackendServiceRequest request =
+ DeleteBackendServiceRequest.newBuilder()
+ .setBackendService("backendService-1884714623")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ Operation response = backendServicesClient.deleteAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_Delete_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/delete/SyncDeleteStringString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/delete/SyncDeleteStringString.java
new file mode 100644
index 000000000000..d4f361dbd06c
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/delete/SyncDeleteStringString.java
@@ -0,0 +1,42 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_Delete_StringString_sync]
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncDeleteStringString {
+
+ public static void main(String[] args) throws Exception {
+ syncDeleteStringString();
+ }
+
+ public static void syncDeleteStringString() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ String project = "project-309310695";
+ String backendService = "backendService-1884714623";
+ Operation response = backendServicesClient.deleteAsync(project, backendService).get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_Delete_StringString_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/deletesignedurlkey/AsyncDeleteSignedUrlKey.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/deletesignedurlkey/AsyncDeleteSignedUrlKey.java
new file mode 100644
index 000000000000..1c83456afd6d
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/deletesignedurlkey/AsyncDeleteSignedUrlKey.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_DeleteSignedUrlKey_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.DeleteSignedUrlKeyBackendServiceRequest;
+import com.google.longrunning.Operation;
+
+public class AsyncDeleteSignedUrlKey {
+
+ public static void main(String[] args) throws Exception {
+ asyncDeleteSignedUrlKey();
+ }
+
+ public static void asyncDeleteSignedUrlKey() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ DeleteSignedUrlKeyBackendServiceRequest request =
+ DeleteSignedUrlKeyBackendServiceRequest.newBuilder()
+ .setBackendService("backendService-1884714623")
+ .setKeyName("keyName-815643254")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ ApiFuture future =
+ backendServicesClient.deleteSignedUrlKeyCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_DeleteSignedUrlKey_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/deletesignedurlkey/AsyncDeleteSignedUrlKeyLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/deletesignedurlkey/AsyncDeleteSignedUrlKeyLRO.java
new file mode 100644
index 000000000000..eb12042dcb8f
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/deletesignedurlkey/AsyncDeleteSignedUrlKeyLRO.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_DeleteSignedUrlKey_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.DeleteSignedUrlKeyBackendServiceRequest;
+import com.google.cloud.compute.v1.Operation;
+
+public class AsyncDeleteSignedUrlKeyLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncDeleteSignedUrlKeyLRO();
+ }
+
+ public static void asyncDeleteSignedUrlKeyLRO() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ DeleteSignedUrlKeyBackendServiceRequest request =
+ DeleteSignedUrlKeyBackendServiceRequest.newBuilder()
+ .setBackendService("backendService-1884714623")
+ .setKeyName("keyName-815643254")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ OperationFuture future =
+ backendServicesClient.deleteSignedUrlKeyOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_DeleteSignedUrlKey_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/deletesignedurlkey/SyncDeleteSignedUrlKey.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/deletesignedurlkey/SyncDeleteSignedUrlKey.java
new file mode 100644
index 000000000000..0721d8222ce8
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/deletesignedurlkey/SyncDeleteSignedUrlKey.java
@@ -0,0 +1,48 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_DeleteSignedUrlKey_sync]
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.DeleteSignedUrlKeyBackendServiceRequest;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncDeleteSignedUrlKey {
+
+ public static void main(String[] args) throws Exception {
+ syncDeleteSignedUrlKey();
+ }
+
+ public static void syncDeleteSignedUrlKey() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ DeleteSignedUrlKeyBackendServiceRequest request =
+ DeleteSignedUrlKeyBackendServiceRequest.newBuilder()
+ .setBackendService("backendService-1884714623")
+ .setKeyName("keyName-815643254")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ Operation response = backendServicesClient.deleteSignedUrlKeyAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_DeleteSignedUrlKey_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/deletesignedurlkey/SyncDeleteSignedUrlKeyStringStringString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/deletesignedurlkey/SyncDeleteSignedUrlKeyStringStringString.java
new file mode 100644
index 000000000000..4e9b3b36c28d
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/deletesignedurlkey/SyncDeleteSignedUrlKeyStringStringString.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_DeleteSignedUrlKey_StringStringString_sync]
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncDeleteSignedUrlKeyStringStringString {
+
+ public static void main(String[] args) throws Exception {
+ syncDeleteSignedUrlKeyStringStringString();
+ }
+
+ public static void syncDeleteSignedUrlKeyStringStringString() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ String project = "project-309310695";
+ String backendService = "backendService-1884714623";
+ String keyName = "keyName-815643254";
+ Operation response =
+ backendServicesClient.deleteSignedUrlKeyAsync(project, backendService, keyName).get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_DeleteSignedUrlKey_StringStringString_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/get/AsyncGet.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/get/AsyncGet.java
new file mode 100644
index 000000000000..ef9c43d5d8e1
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/get/AsyncGet.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_Get_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.BackendService;
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.GetBackendServiceRequest;
+
+public class AsyncGet {
+
+ public static void main(String[] args) throws Exception {
+ asyncGet();
+ }
+
+ public static void asyncGet() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ GetBackendServiceRequest request =
+ GetBackendServiceRequest.newBuilder()
+ .setBackendService("backendService-1884714623")
+ .setProject("project-309310695")
+ .build();
+ ApiFuture future = backendServicesClient.getCallable().futureCall(request);
+ // Do something.
+ BackendService response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_Get_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/get/SyncGet.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/get/SyncGet.java
new file mode 100644
index 000000000000..98b7bf4be006
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/get/SyncGet.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_Get_sync]
+import com.google.cloud.compute.v1.BackendService;
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.GetBackendServiceRequest;
+
+public class SyncGet {
+
+ public static void main(String[] args) throws Exception {
+ syncGet();
+ }
+
+ public static void syncGet() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ GetBackendServiceRequest request =
+ GetBackendServiceRequest.newBuilder()
+ .setBackendService("backendService-1884714623")
+ .setProject("project-309310695")
+ .build();
+ BackendService response = backendServicesClient.get(request);
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_Get_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/get/SyncGetStringString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/get/SyncGetStringString.java
new file mode 100644
index 000000000000..46a775623d6a
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/get/SyncGetStringString.java
@@ -0,0 +1,42 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_Get_StringString_sync]
+import com.google.cloud.compute.v1.BackendService;
+import com.google.cloud.compute.v1.BackendServicesClient;
+
+public class SyncGetStringString {
+
+ public static void main(String[] args) throws Exception {
+ syncGetStringString();
+ }
+
+ public static void syncGetStringString() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ String project = "project-309310695";
+ String backendService = "backendService-1884714623";
+ BackendService response = backendServicesClient.get(project, backendService);
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_Get_StringString_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/gethealth/AsyncGetHealth.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/gethealth/AsyncGetHealth.java
new file mode 100644
index 000000000000..24b28a848b3e
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/gethealth/AsyncGetHealth.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_GetHealth_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.BackendServiceGroupHealth;
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.GetHealthBackendServiceRequest;
+import com.google.cloud.compute.v1.ResourceGroupReference;
+
+public class AsyncGetHealth {
+
+ public static void main(String[] args) throws Exception {
+ asyncGetHealth();
+ }
+
+ public static void asyncGetHealth() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ GetHealthBackendServiceRequest request =
+ GetHealthBackendServiceRequest.newBuilder()
+ .setBackendService("backendService-1884714623")
+ .setProject("project-309310695")
+ .setResourceGroupReferenceResource(ResourceGroupReference.newBuilder().build())
+ .build();
+ ApiFuture future =
+ backendServicesClient.getHealthCallable().futureCall(request);
+ // Do something.
+ BackendServiceGroupHealth response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_GetHealth_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/gethealth/SyncGetHealth.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/gethealth/SyncGetHealth.java
new file mode 100644
index 000000000000..b05db4becdfb
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/gethealth/SyncGetHealth.java
@@ -0,0 +1,48 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_GetHealth_sync]
+import com.google.cloud.compute.v1.BackendServiceGroupHealth;
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.GetHealthBackendServiceRequest;
+import com.google.cloud.compute.v1.ResourceGroupReference;
+
+public class SyncGetHealth {
+
+ public static void main(String[] args) throws Exception {
+ syncGetHealth();
+ }
+
+ public static void syncGetHealth() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ GetHealthBackendServiceRequest request =
+ GetHealthBackendServiceRequest.newBuilder()
+ .setBackendService("backendService-1884714623")
+ .setProject("project-309310695")
+ .setResourceGroupReferenceResource(ResourceGroupReference.newBuilder().build())
+ .build();
+ BackendServiceGroupHealth response = backendServicesClient.getHealth(request);
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_GetHealth_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/gethealth/SyncGetHealthStringStringResourcegroupreference.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/gethealth/SyncGetHealthStringStringResourcegroupreference.java
new file mode 100644
index 000000000000..80a2479d197d
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/gethealth/SyncGetHealthStringStringResourcegroupreference.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_GetHealth_StringStringResourcegroupreference_sync]
+import com.google.cloud.compute.v1.BackendServiceGroupHealth;
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.ResourceGroupReference;
+
+public class SyncGetHealthStringStringResourcegroupreference {
+
+ public static void main(String[] args) throws Exception {
+ syncGetHealthStringStringResourcegroupreference();
+ }
+
+ public static void syncGetHealthStringStringResourcegroupreference() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ String project = "project-309310695";
+ String backendService = "backendService-1884714623";
+ ResourceGroupReference resourceGroupReferenceResource =
+ ResourceGroupReference.newBuilder().build();
+ BackendServiceGroupHealth response =
+ backendServicesClient.getHealth(project, backendService, resourceGroupReferenceResource);
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_GetHealth_StringStringResourcegroupreference_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/getiampolicy/AsyncGetIamPolicy.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/getiampolicy/AsyncGetIamPolicy.java
new file mode 100644
index 000000000000..982974d5d237
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/getiampolicy/AsyncGetIamPolicy.java
@@ -0,0 +1,50 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_GetIamPolicy_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.GetIamPolicyBackendServiceRequest;
+import com.google.cloud.compute.v1.Policy;
+
+public class AsyncGetIamPolicy {
+
+ public static void main(String[] args) throws Exception {
+ asyncGetIamPolicy();
+ }
+
+ public static void asyncGetIamPolicy() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ GetIamPolicyBackendServiceRequest request =
+ GetIamPolicyBackendServiceRequest.newBuilder()
+ .setOptionsRequestedPolicyVersion(-574521795)
+ .setProject("project-309310695")
+ .setResource("resource-341064690")
+ .build();
+ ApiFuture future = backendServicesClient.getIamPolicyCallable().futureCall(request);
+ // Do something.
+ Policy response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_GetIamPolicy_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/getiampolicy/SyncGetIamPolicy.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/getiampolicy/SyncGetIamPolicy.java
new file mode 100644
index 000000000000..38c717948276
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/getiampolicy/SyncGetIamPolicy.java
@@ -0,0 +1,47 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_GetIamPolicy_sync]
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.GetIamPolicyBackendServiceRequest;
+import com.google.cloud.compute.v1.Policy;
+
+public class SyncGetIamPolicy {
+
+ public static void main(String[] args) throws Exception {
+ syncGetIamPolicy();
+ }
+
+ public static void syncGetIamPolicy() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ GetIamPolicyBackendServiceRequest request =
+ GetIamPolicyBackendServiceRequest.newBuilder()
+ .setOptionsRequestedPolicyVersion(-574521795)
+ .setProject("project-309310695")
+ .setResource("resource-341064690")
+ .build();
+ Policy response = backendServicesClient.getIamPolicy(request);
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_GetIamPolicy_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/getiampolicy/SyncGetIamPolicyStringString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/getiampolicy/SyncGetIamPolicyStringString.java
new file mode 100644
index 000000000000..0ab6975b18b8
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/getiampolicy/SyncGetIamPolicyStringString.java
@@ -0,0 +1,42 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_GetIamPolicy_StringString_sync]
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.Policy;
+
+public class SyncGetIamPolicyStringString {
+
+ public static void main(String[] args) throws Exception {
+ syncGetIamPolicyStringString();
+ }
+
+ public static void syncGetIamPolicyStringString() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ String project = "project-309310695";
+ String resource = "resource-341064690";
+ Policy response = backendServicesClient.getIamPolicy(project, resource);
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_GetIamPolicy_StringString_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/insert/AsyncInsert.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/insert/AsyncInsert.java
new file mode 100644
index 000000000000..be77e06105a2
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/insert/AsyncInsert.java
@@ -0,0 +1,51 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_Insert_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.BackendService;
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.InsertBackendServiceRequest;
+import com.google.longrunning.Operation;
+
+public class AsyncInsert {
+
+ public static void main(String[] args) throws Exception {
+ asyncInsert();
+ }
+
+ public static void asyncInsert() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ InsertBackendServiceRequest request =
+ InsertBackendServiceRequest.newBuilder()
+ .setBackendServiceResource(BackendService.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ ApiFuture future = backendServicesClient.insertCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_Insert_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/insert/AsyncInsertLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/insert/AsyncInsertLRO.java
new file mode 100644
index 000000000000..ac5d660b1000
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/insert/AsyncInsertLRO.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_Insert_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.BackendService;
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.InsertBackendServiceRequest;
+import com.google.cloud.compute.v1.Operation;
+
+public class AsyncInsertLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncInsertLRO();
+ }
+
+ public static void asyncInsertLRO() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ InsertBackendServiceRequest request =
+ InsertBackendServiceRequest.newBuilder()
+ .setBackendServiceResource(BackendService.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ OperationFuture future =
+ backendServicesClient.insertOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_Insert_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/insert/SyncInsert.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/insert/SyncInsert.java
new file mode 100644
index 000000000000..da71a00186b1
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/insert/SyncInsert.java
@@ -0,0 +1,48 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_Insert_sync]
+import com.google.cloud.compute.v1.BackendService;
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.InsertBackendServiceRequest;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncInsert {
+
+ public static void main(String[] args) throws Exception {
+ syncInsert();
+ }
+
+ public static void syncInsert() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ InsertBackendServiceRequest request =
+ InsertBackendServiceRequest.newBuilder()
+ .setBackendServiceResource(BackendService.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ Operation response = backendServicesClient.insertAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_Insert_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/insert/SyncInsertStringBackendservice.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/insert/SyncInsertStringBackendservice.java
new file mode 100644
index 000000000000..40d52acd9cab
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/insert/SyncInsertStringBackendservice.java
@@ -0,0 +1,43 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_Insert_StringBackendservice_sync]
+import com.google.cloud.compute.v1.BackendService;
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncInsertStringBackendservice {
+
+ public static void main(String[] args) throws Exception {
+ syncInsertStringBackendservice();
+ }
+
+ public static void syncInsertStringBackendservice() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ String project = "project-309310695";
+ BackendService backendServiceResource = BackendService.newBuilder().build();
+ Operation response = backendServicesClient.insertAsync(project, backendServiceResource).get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_Insert_StringBackendservice_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/list/AsyncList.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/list/AsyncList.java
new file mode 100644
index 000000000000..eb06d0a99a3c
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/list/AsyncList.java
@@ -0,0 +1,56 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_List_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.BackendService;
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.ListBackendServicesRequest;
+
+public class AsyncList {
+
+ public static void main(String[] args) throws Exception {
+ asyncList();
+ }
+
+ public static void asyncList() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ ListBackendServicesRequest request =
+ ListBackendServicesRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .build();
+ ApiFuture future =
+ backendServicesClient.listPagedCallable().futureCall(request);
+ // Do something.
+ for (BackendService element : future.get().iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_List_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/list/AsyncListPaged.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/list/AsyncListPaged.java
new file mode 100644
index 000000000000..d4ef7fca9036
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/list/AsyncListPaged.java
@@ -0,0 +1,63 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_List_Paged_async]
+import com.google.cloud.compute.v1.BackendService;
+import com.google.cloud.compute.v1.BackendServiceList;
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.ListBackendServicesRequest;
+import com.google.common.base.Strings;
+
+public class AsyncListPaged {
+
+ public static void main(String[] args) throws Exception {
+ asyncListPaged();
+ }
+
+ public static void asyncListPaged() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ ListBackendServicesRequest request =
+ ListBackendServicesRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .build();
+ while (true) {
+ BackendServiceList response = backendServicesClient.listCallable().call(request);
+ for (BackendService element : response.getItemsList()) {
+ // doThingsWith(element);
+ }
+ String nextPageToken = response.getNextPageToken();
+ if (!Strings.isNullOrEmpty(nextPageToken)) {
+ request = request.toBuilder().setPageToken(nextPageToken).build();
+ } else {
+ break;
+ }
+ }
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_List_Paged_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/list/SyncList.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/list/SyncList.java
new file mode 100644
index 000000000000..f8614c057bda
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/list/SyncList.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_List_sync]
+import com.google.cloud.compute.v1.BackendService;
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.ListBackendServicesRequest;
+
+public class SyncList {
+
+ public static void main(String[] args) throws Exception {
+ syncList();
+ }
+
+ public static void syncList() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ ListBackendServicesRequest request =
+ ListBackendServicesRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .build();
+ for (BackendService element : backendServicesClient.list(request).iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_List_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/list/SyncListString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/list/SyncListString.java
new file mode 100644
index 000000000000..d8c41e442e95
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/list/SyncListString.java
@@ -0,0 +1,43 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_List_String_sync]
+import com.google.cloud.compute.v1.BackendService;
+import com.google.cloud.compute.v1.BackendServicesClient;
+
+public class SyncListString {
+
+ public static void main(String[] args) throws Exception {
+ syncListString();
+ }
+
+ public static void syncListString() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ String project = "project-309310695";
+ for (BackendService element : backendServicesClient.list(project).iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_List_String_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/patch/AsyncPatch.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/patch/AsyncPatch.java
new file mode 100644
index 000000000000..413ff3fa01d7
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/patch/AsyncPatch.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_Patch_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.BackendService;
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.PatchBackendServiceRequest;
+import com.google.longrunning.Operation;
+
+public class AsyncPatch {
+
+ public static void main(String[] args) throws Exception {
+ asyncPatch();
+ }
+
+ public static void asyncPatch() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ PatchBackendServiceRequest request =
+ PatchBackendServiceRequest.newBuilder()
+ .setBackendService("backendService-1884714623")
+ .setBackendServiceResource(BackendService.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ ApiFuture future = backendServicesClient.patchCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_Patch_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/patch/AsyncPatchLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/patch/AsyncPatchLRO.java
new file mode 100644
index 000000000000..78ee68c3f640
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/patch/AsyncPatchLRO.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_Patch_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.BackendService;
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.PatchBackendServiceRequest;
+
+public class AsyncPatchLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncPatchLRO();
+ }
+
+ public static void asyncPatchLRO() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ PatchBackendServiceRequest request =
+ PatchBackendServiceRequest.newBuilder()
+ .setBackendService("backendService-1884714623")
+ .setBackendServiceResource(BackendService.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ OperationFuture future =
+ backendServicesClient.patchOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_Patch_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/patch/SyncPatch.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/patch/SyncPatch.java
new file mode 100644
index 000000000000..951dbdaf8cc4
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/patch/SyncPatch.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_Patch_sync]
+import com.google.cloud.compute.v1.BackendService;
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.PatchBackendServiceRequest;
+
+public class SyncPatch {
+
+ public static void main(String[] args) throws Exception {
+ syncPatch();
+ }
+
+ public static void syncPatch() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ PatchBackendServiceRequest request =
+ PatchBackendServiceRequest.newBuilder()
+ .setBackendService("backendService-1884714623")
+ .setBackendServiceResource(BackendService.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ Operation response = backendServicesClient.patchAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_Patch_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/patch/SyncPatchStringStringBackendservice.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/patch/SyncPatchStringStringBackendservice.java
new file mode 100644
index 000000000000..0112b950db75
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/patch/SyncPatchStringStringBackendservice.java
@@ -0,0 +1,45 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_Patch_StringStringBackendservice_sync]
+import com.google.cloud.compute.v1.BackendService;
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncPatchStringStringBackendservice {
+
+ public static void main(String[] args) throws Exception {
+ syncPatchStringStringBackendservice();
+ }
+
+ public static void syncPatchStringStringBackendservice() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ String project = "project-309310695";
+ String backendService = "backendService-1884714623";
+ BackendService backendServiceResource = BackendService.newBuilder().build();
+ Operation response =
+ backendServicesClient.patchAsync(project, backendService, backendServiceResource).get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_Patch_StringStringBackendservice_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/setedgesecuritypolicy/AsyncSetEdgeSecurityPolicy.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/setedgesecuritypolicy/AsyncSetEdgeSecurityPolicy.java
new file mode 100644
index 000000000000..ea46382618f9
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/setedgesecuritypolicy/AsyncSetEdgeSecurityPolicy.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_SetEdgeSecurityPolicy_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.SecurityPolicyReference;
+import com.google.cloud.compute.v1.SetEdgeSecurityPolicyBackendServiceRequest;
+import com.google.longrunning.Operation;
+
+public class AsyncSetEdgeSecurityPolicy {
+
+ public static void main(String[] args) throws Exception {
+ asyncSetEdgeSecurityPolicy();
+ }
+
+ public static void asyncSetEdgeSecurityPolicy() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ SetEdgeSecurityPolicyBackendServiceRequest request =
+ SetEdgeSecurityPolicyBackendServiceRequest.newBuilder()
+ .setBackendService("backendService-1884714623")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setSecurityPolicyReferenceResource(SecurityPolicyReference.newBuilder().build())
+ .build();
+ ApiFuture future =
+ backendServicesClient.setEdgeSecurityPolicyCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_SetEdgeSecurityPolicy_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/setedgesecuritypolicy/AsyncSetEdgeSecurityPolicyLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/setedgesecuritypolicy/AsyncSetEdgeSecurityPolicyLRO.java
new file mode 100644
index 000000000000..4be5ba6e6e72
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/setedgesecuritypolicy/AsyncSetEdgeSecurityPolicyLRO.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_SetEdgeSecurityPolicy_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.SecurityPolicyReference;
+import com.google.cloud.compute.v1.SetEdgeSecurityPolicyBackendServiceRequest;
+
+public class AsyncSetEdgeSecurityPolicyLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncSetEdgeSecurityPolicyLRO();
+ }
+
+ public static void asyncSetEdgeSecurityPolicyLRO() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ SetEdgeSecurityPolicyBackendServiceRequest request =
+ SetEdgeSecurityPolicyBackendServiceRequest.newBuilder()
+ .setBackendService("backendService-1884714623")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setSecurityPolicyReferenceResource(SecurityPolicyReference.newBuilder().build())
+ .build();
+ OperationFuture future =
+ backendServicesClient.setEdgeSecurityPolicyOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_SetEdgeSecurityPolicy_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/setedgesecuritypolicy/SyncSetEdgeSecurityPolicy.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/setedgesecuritypolicy/SyncSetEdgeSecurityPolicy.java
new file mode 100644
index 000000000000..24e1aadd9a50
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/setedgesecuritypolicy/SyncSetEdgeSecurityPolicy.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_SetEdgeSecurityPolicy_sync]
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.SecurityPolicyReference;
+import com.google.cloud.compute.v1.SetEdgeSecurityPolicyBackendServiceRequest;
+
+public class SyncSetEdgeSecurityPolicy {
+
+ public static void main(String[] args) throws Exception {
+ syncSetEdgeSecurityPolicy();
+ }
+
+ public static void syncSetEdgeSecurityPolicy() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ SetEdgeSecurityPolicyBackendServiceRequest request =
+ SetEdgeSecurityPolicyBackendServiceRequest.newBuilder()
+ .setBackendService("backendService-1884714623")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setSecurityPolicyReferenceResource(SecurityPolicyReference.newBuilder().build())
+ .build();
+ Operation response = backendServicesClient.setEdgeSecurityPolicyAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_SetEdgeSecurityPolicy_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/setedgesecuritypolicy/SyncSetEdgeSecurityPolicyStringStringSecuritypolicyreference.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/setedgesecuritypolicy/SyncSetEdgeSecurityPolicyStringStringSecuritypolicyreference.java
new file mode 100644
index 000000000000..1012ba1ac411
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/setedgesecuritypolicy/SyncSetEdgeSecurityPolicyStringStringSecuritypolicyreference.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_SetEdgeSecurityPolicy_StringStringSecuritypolicyreference_sync]
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.SecurityPolicyReference;
+
+public class SyncSetEdgeSecurityPolicyStringStringSecuritypolicyreference {
+
+ public static void main(String[] args) throws Exception {
+ syncSetEdgeSecurityPolicyStringStringSecuritypolicyreference();
+ }
+
+ public static void syncSetEdgeSecurityPolicyStringStringSecuritypolicyreference()
+ 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ String project = "project-309310695";
+ String backendService = "backendService-1884714623";
+ SecurityPolicyReference securityPolicyReferenceResource =
+ SecurityPolicyReference.newBuilder().build();
+ Operation response =
+ backendServicesClient
+ .setEdgeSecurityPolicyAsync(project, backendService, securityPolicyReferenceResource)
+ .get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_SetEdgeSecurityPolicy_StringStringSecuritypolicyreference_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/setiampolicy/AsyncSetIamPolicy.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/setiampolicy/AsyncSetIamPolicy.java
new file mode 100644
index 000000000000..407c3629cda2
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/setiampolicy/AsyncSetIamPolicy.java
@@ -0,0 +1,51 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_SetIamPolicy_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.GlobalSetPolicyRequest;
+import com.google.cloud.compute.v1.Policy;
+import com.google.cloud.compute.v1.SetIamPolicyBackendServiceRequest;
+
+public class AsyncSetIamPolicy {
+
+ public static void main(String[] args) throws Exception {
+ asyncSetIamPolicy();
+ }
+
+ public static void asyncSetIamPolicy() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ SetIamPolicyBackendServiceRequest request =
+ SetIamPolicyBackendServiceRequest.newBuilder()
+ .setGlobalSetPolicyRequestResource(GlobalSetPolicyRequest.newBuilder().build())
+ .setProject("project-309310695")
+ .setResource("resource-341064690")
+ .build();
+ ApiFuture future = backendServicesClient.setIamPolicyCallable().futureCall(request);
+ // Do something.
+ Policy response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_SetIamPolicy_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/setiampolicy/SyncSetIamPolicy.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/setiampolicy/SyncSetIamPolicy.java
new file mode 100644
index 000000000000..404eeeb9a1f2
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/setiampolicy/SyncSetIamPolicy.java
@@ -0,0 +1,48 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_SetIamPolicy_sync]
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.GlobalSetPolicyRequest;
+import com.google.cloud.compute.v1.Policy;
+import com.google.cloud.compute.v1.SetIamPolicyBackendServiceRequest;
+
+public class SyncSetIamPolicy {
+
+ public static void main(String[] args) throws Exception {
+ syncSetIamPolicy();
+ }
+
+ public static void syncSetIamPolicy() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ SetIamPolicyBackendServiceRequest request =
+ SetIamPolicyBackendServiceRequest.newBuilder()
+ .setGlobalSetPolicyRequestResource(GlobalSetPolicyRequest.newBuilder().build())
+ .setProject("project-309310695")
+ .setResource("resource-341064690")
+ .build();
+ Policy response = backendServicesClient.setIamPolicy(request);
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_SetIamPolicy_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/setiampolicy/SyncSetIamPolicyStringStringGlobalsetpolicyrequest.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/setiampolicy/SyncSetIamPolicyStringStringGlobalsetpolicyrequest.java
new file mode 100644
index 000000000000..0beac5c4e1c6
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/setiampolicy/SyncSetIamPolicyStringStringGlobalsetpolicyrequest.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_SetIamPolicy_StringStringGlobalsetpolicyrequest_sync]
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.GlobalSetPolicyRequest;
+import com.google.cloud.compute.v1.Policy;
+
+public class SyncSetIamPolicyStringStringGlobalsetpolicyrequest {
+
+ public static void main(String[] args) throws Exception {
+ syncSetIamPolicyStringStringGlobalsetpolicyrequest();
+ }
+
+ public static void syncSetIamPolicyStringStringGlobalsetpolicyrequest() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ String project = "project-309310695";
+ String resource = "resource-341064690";
+ GlobalSetPolicyRequest globalSetPolicyRequestResource =
+ GlobalSetPolicyRequest.newBuilder().build();
+ Policy response =
+ backendServicesClient.setIamPolicy(project, resource, globalSetPolicyRequestResource);
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_SetIamPolicy_StringStringGlobalsetpolicyrequest_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/setsecuritypolicy/AsyncSetSecurityPolicy.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/setsecuritypolicy/AsyncSetSecurityPolicy.java
new file mode 100644
index 000000000000..7db23692cc7a
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/setsecuritypolicy/AsyncSetSecurityPolicy.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_SetSecurityPolicy_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.SecurityPolicyReference;
+import com.google.cloud.compute.v1.SetSecurityPolicyBackendServiceRequest;
+import com.google.longrunning.Operation;
+
+public class AsyncSetSecurityPolicy {
+
+ public static void main(String[] args) throws Exception {
+ asyncSetSecurityPolicy();
+ }
+
+ public static void asyncSetSecurityPolicy() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ SetSecurityPolicyBackendServiceRequest request =
+ SetSecurityPolicyBackendServiceRequest.newBuilder()
+ .setBackendService("backendService-1884714623")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setSecurityPolicyReferenceResource(SecurityPolicyReference.newBuilder().build())
+ .build();
+ ApiFuture future =
+ backendServicesClient.setSecurityPolicyCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_SetSecurityPolicy_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/setsecuritypolicy/AsyncSetSecurityPolicyLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/setsecuritypolicy/AsyncSetSecurityPolicyLRO.java
new file mode 100644
index 000000000000..95ad87e72419
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/setsecuritypolicy/AsyncSetSecurityPolicyLRO.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_SetSecurityPolicy_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.SecurityPolicyReference;
+import com.google.cloud.compute.v1.SetSecurityPolicyBackendServiceRequest;
+
+public class AsyncSetSecurityPolicyLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncSetSecurityPolicyLRO();
+ }
+
+ public static void asyncSetSecurityPolicyLRO() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ SetSecurityPolicyBackendServiceRequest request =
+ SetSecurityPolicyBackendServiceRequest.newBuilder()
+ .setBackendService("backendService-1884714623")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setSecurityPolicyReferenceResource(SecurityPolicyReference.newBuilder().build())
+ .build();
+ OperationFuture future =
+ backendServicesClient.setSecurityPolicyOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_SetSecurityPolicy_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/setsecuritypolicy/SyncSetSecurityPolicy.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/setsecuritypolicy/SyncSetSecurityPolicy.java
new file mode 100644
index 000000000000..43e1a3e1d22e
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/setsecuritypolicy/SyncSetSecurityPolicy.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_SetSecurityPolicy_sync]
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.SecurityPolicyReference;
+import com.google.cloud.compute.v1.SetSecurityPolicyBackendServiceRequest;
+
+public class SyncSetSecurityPolicy {
+
+ public static void main(String[] args) throws Exception {
+ syncSetSecurityPolicy();
+ }
+
+ public static void syncSetSecurityPolicy() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ SetSecurityPolicyBackendServiceRequest request =
+ SetSecurityPolicyBackendServiceRequest.newBuilder()
+ .setBackendService("backendService-1884714623")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setSecurityPolicyReferenceResource(SecurityPolicyReference.newBuilder().build())
+ .build();
+ Operation response = backendServicesClient.setSecurityPolicyAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_SetSecurityPolicy_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/setsecuritypolicy/SyncSetSecurityPolicyStringStringSecuritypolicyreference.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/setsecuritypolicy/SyncSetSecurityPolicyStringStringSecuritypolicyreference.java
new file mode 100644
index 000000000000..dda1e59de919
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/setsecuritypolicy/SyncSetSecurityPolicyStringStringSecuritypolicyreference.java
@@ -0,0 +1,48 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_SetSecurityPolicy_StringStringSecuritypolicyreference_sync]
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.SecurityPolicyReference;
+
+public class SyncSetSecurityPolicyStringStringSecuritypolicyreference {
+
+ public static void main(String[] args) throws Exception {
+ syncSetSecurityPolicyStringStringSecuritypolicyreference();
+ }
+
+ public static void syncSetSecurityPolicyStringStringSecuritypolicyreference() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ String project = "project-309310695";
+ String backendService = "backendService-1884714623";
+ SecurityPolicyReference securityPolicyReferenceResource =
+ SecurityPolicyReference.newBuilder().build();
+ Operation response =
+ backendServicesClient
+ .setSecurityPolicyAsync(project, backendService, securityPolicyReferenceResource)
+ .get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_SetSecurityPolicy_StringStringSecuritypolicyreference_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/update/AsyncUpdate.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/update/AsyncUpdate.java
new file mode 100644
index 000000000000..b16fbb01402e
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/update/AsyncUpdate.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_Update_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.BackendService;
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.UpdateBackendServiceRequest;
+import com.google.longrunning.Operation;
+
+public class AsyncUpdate {
+
+ public static void main(String[] args) throws Exception {
+ asyncUpdate();
+ }
+
+ public static void asyncUpdate() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ UpdateBackendServiceRequest request =
+ UpdateBackendServiceRequest.newBuilder()
+ .setBackendService("backendService-1884714623")
+ .setBackendServiceResource(BackendService.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ ApiFuture future = backendServicesClient.updateCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_Update_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/update/AsyncUpdateLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/update/AsyncUpdateLRO.java
new file mode 100644
index 000000000000..0e521aac8884
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/update/AsyncUpdateLRO.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_Update_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.BackendService;
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.UpdateBackendServiceRequest;
+
+public class AsyncUpdateLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncUpdateLRO();
+ }
+
+ public static void asyncUpdateLRO() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ UpdateBackendServiceRequest request =
+ UpdateBackendServiceRequest.newBuilder()
+ .setBackendService("backendService-1884714623")
+ .setBackendServiceResource(BackendService.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ OperationFuture future =
+ backendServicesClient.updateOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_Update_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/update/SyncUpdate.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/update/SyncUpdate.java
new file mode 100644
index 000000000000..de62df1af084
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/update/SyncUpdate.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_Update_sync]
+import com.google.cloud.compute.v1.BackendService;
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.UpdateBackendServiceRequest;
+
+public class SyncUpdate {
+
+ public static void main(String[] args) throws Exception {
+ syncUpdate();
+ }
+
+ public static void syncUpdate() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ UpdateBackendServiceRequest request =
+ UpdateBackendServiceRequest.newBuilder()
+ .setBackendService("backendService-1884714623")
+ .setBackendServiceResource(BackendService.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ Operation response = backendServicesClient.updateAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_Update_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/update/SyncUpdateStringStringBackendservice.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/update/SyncUpdateStringStringBackendservice.java
new file mode 100644
index 000000000000..aa2b38faf7f0
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservices/update/SyncUpdateStringStringBackendservice.java
@@ -0,0 +1,45 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServices_Update_StringStringBackendservice_sync]
+import com.google.cloud.compute.v1.BackendService;
+import com.google.cloud.compute.v1.BackendServicesClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncUpdateStringStringBackendservice {
+
+ public static void main(String[] args) throws Exception {
+ syncUpdateStringStringBackendservice();
+ }
+
+ public static void syncUpdateStringStringBackendservice() 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
+ String project = "project-309310695";
+ String backendService = "backendService-1884714623";
+ BackendService backendServiceResource = BackendService.newBuilder().build();
+ Operation response =
+ backendServicesClient.updateAsync(project, backendService, backendServiceResource).get();
+ }
+ }
+}
+// [END compute_v1_generated_BackendServices_Update_StringStringBackendservice_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservicessettings/get/SyncGet.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservicessettings/get/SyncGet.java
new file mode 100644
index 000000000000..c4a0abf23503
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/backendservicessettings/get/SyncGet.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.compute.v1.samples;
+
+// [START compute_v1_generated_BackendServicesSettings_Get_sync]
+import com.google.cloud.compute.v1.BackendServicesSettings;
+import java.time.Duration;
+
+public class SyncGet {
+
+ public static void main(String[] args) throws Exception {
+ syncGet();
+ }
+
+ public static void syncGet() 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
+ BackendServicesSettings.Builder backendServicesSettingsBuilder =
+ BackendServicesSettings.newBuilder();
+ backendServicesSettingsBuilder
+ .getSettings()
+ .setRetrySettings(
+ backendServicesSettingsBuilder
+ .getSettings()
+ .getRetrySettings()
+ .toBuilder()
+ .setTotalTimeout(Duration.ofSeconds(30))
+ .build());
+ BackendServicesSettings backendServicesSettings = backendServicesSettingsBuilder.build();
+ }
+}
+// [END compute_v1_generated_BackendServicesSettings_Get_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/addresourcepolicies/AsyncAddResourcePolicies.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/addresourcepolicies/AsyncAddResourcePolicies.java
new file mode 100644
index 000000000000..4097c84f01d7
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/addresourcepolicies/AsyncAddResourcePolicies.java
@@ -0,0 +1,54 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_AddResourcePolicies_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.AddResourcePoliciesDiskRequest;
+import com.google.cloud.compute.v1.DisksAddResourcePoliciesRequest;
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.longrunning.Operation;
+
+public class AsyncAddResourcePolicies {
+
+ public static void main(String[] args) throws Exception {
+ asyncAddResourcePolicies();
+ }
+
+ public static void asyncAddResourcePolicies() 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 (DisksClient disksClient = DisksClient.create()) {
+ AddResourcePoliciesDiskRequest request =
+ AddResourcePoliciesDiskRequest.newBuilder()
+ .setDisk("disk3083677")
+ .setDisksAddResourcePoliciesRequestResource(
+ DisksAddResourcePoliciesRequest.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setZone("zone3744684")
+ .build();
+ ApiFuture future = disksClient.addResourcePoliciesCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Disks_AddResourcePolicies_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/addresourcepolicies/AsyncAddResourcePoliciesLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/addresourcepolicies/AsyncAddResourcePoliciesLRO.java
new file mode 100644
index 000000000000..aa8f633ef8f7
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/addresourcepolicies/AsyncAddResourcePoliciesLRO.java
@@ -0,0 +1,55 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_AddResourcePolicies_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.AddResourcePoliciesDiskRequest;
+import com.google.cloud.compute.v1.DisksAddResourcePoliciesRequest;
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class AsyncAddResourcePoliciesLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncAddResourcePoliciesLRO();
+ }
+
+ public static void asyncAddResourcePoliciesLRO() 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 (DisksClient disksClient = DisksClient.create()) {
+ AddResourcePoliciesDiskRequest request =
+ AddResourcePoliciesDiskRequest.newBuilder()
+ .setDisk("disk3083677")
+ .setDisksAddResourcePoliciesRequestResource(
+ DisksAddResourcePoliciesRequest.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setZone("zone3744684")
+ .build();
+ OperationFuture future =
+ disksClient.addResourcePoliciesOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Disks_AddResourcePolicies_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/addresourcepolicies/SyncAddResourcePolicies.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/addresourcepolicies/SyncAddResourcePolicies.java
new file mode 100644
index 000000000000..7044a49dffe1
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/addresourcepolicies/SyncAddResourcePolicies.java
@@ -0,0 +1,51 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_AddResourcePolicies_sync]
+import com.google.cloud.compute.v1.AddResourcePoliciesDiskRequest;
+import com.google.cloud.compute.v1.DisksAddResourcePoliciesRequest;
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncAddResourcePolicies {
+
+ public static void main(String[] args) throws Exception {
+ syncAddResourcePolicies();
+ }
+
+ public static void syncAddResourcePolicies() 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 (DisksClient disksClient = DisksClient.create()) {
+ AddResourcePoliciesDiskRequest request =
+ AddResourcePoliciesDiskRequest.newBuilder()
+ .setDisk("disk3083677")
+ .setDisksAddResourcePoliciesRequestResource(
+ DisksAddResourcePoliciesRequest.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setZone("zone3744684")
+ .build();
+ Operation response = disksClient.addResourcePoliciesAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_Disks_AddResourcePolicies_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/addresourcepolicies/SyncAddResourcePoliciesStringStringStringDisksaddresourcepoliciesrequest.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/addresourcepolicies/SyncAddResourcePoliciesStringStringStringDisksaddresourcepoliciesrequest.java
new file mode 100644
index 000000000000..578681e79249
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/addresourcepolicies/SyncAddResourcePoliciesStringStringStringDisksaddresourcepoliciesrequest.java
@@ -0,0 +1,51 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_AddResourcePolicies_StringStringStringDisksaddresourcepoliciesrequest_sync]
+import com.google.cloud.compute.v1.DisksAddResourcePoliciesRequest;
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncAddResourcePoliciesStringStringStringDisksaddresourcepoliciesrequest {
+
+ public static void main(String[] args) throws Exception {
+ syncAddResourcePoliciesStringStringStringDisksaddresourcepoliciesrequest();
+ }
+
+ public static void syncAddResourcePoliciesStringStringStringDisksaddresourcepoliciesrequest()
+ 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 (DisksClient disksClient = DisksClient.create()) {
+ String project = "project-309310695";
+ String zone = "zone3744684";
+ String disk = "disk3083677";
+ DisksAddResourcePoliciesRequest disksAddResourcePoliciesRequestResource =
+ DisksAddResourcePoliciesRequest.newBuilder().build();
+ Operation response =
+ disksClient
+ .addResourcePoliciesAsync(
+ project, zone, disk, disksAddResourcePoliciesRequestResource)
+ .get();
+ }
+ }
+}
+// [END compute_v1_generated_Disks_AddResourcePolicies_StringStringStringDisksaddresourcepoliciesrequest_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/aggregatedlist/AsyncAggregatedList.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/aggregatedlist/AsyncAggregatedList.java
new file mode 100644
index 000000000000..bd73d05db611
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/aggregatedlist/AsyncAggregatedList.java
@@ -0,0 +1,58 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_AggregatedList_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.AggregatedListDisksRequest;
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.DisksScopedList;
+import java.util.Map;
+
+public class AsyncAggregatedList {
+
+ public static void main(String[] args) throws Exception {
+ asyncAggregatedList();
+ }
+
+ public static void asyncAggregatedList() 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 (DisksClient disksClient = DisksClient.create()) {
+ AggregatedListDisksRequest request =
+ AggregatedListDisksRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setIncludeAllScopes(true)
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .build();
+ ApiFuture> future =
+ disksClient.aggregatedListPagedCallable().futureCall(request);
+ // Do something.
+ for (Map.Entry element : future.get().iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_Disks_AggregatedList_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/aggregatedlist/AsyncAggregatedListPaged.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/aggregatedlist/AsyncAggregatedListPaged.java
new file mode 100644
index 000000000000..f6ad47e798ae
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/aggregatedlist/AsyncAggregatedListPaged.java
@@ -0,0 +1,65 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_AggregatedList_Paged_async]
+import com.google.cloud.compute.v1.AggregatedListDisksRequest;
+import com.google.cloud.compute.v1.DiskAggregatedList;
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.DisksScopedList;
+import com.google.common.base.Strings;
+import java.util.Map;
+
+public class AsyncAggregatedListPaged {
+
+ public static void main(String[] args) throws Exception {
+ asyncAggregatedListPaged();
+ }
+
+ public static void asyncAggregatedListPaged() 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 (DisksClient disksClient = DisksClient.create()) {
+ AggregatedListDisksRequest request =
+ AggregatedListDisksRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setIncludeAllScopes(true)
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .build();
+ while (true) {
+ DiskAggregatedList response = disksClient.aggregatedListCallable().call(request);
+ for (Map.Entry element : response.getItemsList()) {
+ // doThingsWith(element);
+ }
+ String nextPageToken = response.getNextPageToken();
+ if (!Strings.isNullOrEmpty(nextPageToken)) {
+ request = request.toBuilder().setPageToken(nextPageToken).build();
+ } else {
+ break;
+ }
+ }
+ }
+ }
+}
+// [END compute_v1_generated_Disks_AggregatedList_Paged_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/aggregatedlist/SyncAggregatedList.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/aggregatedlist/SyncAggregatedList.java
new file mode 100644
index 000000000000..538c823d5cd2
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/aggregatedlist/SyncAggregatedList.java
@@ -0,0 +1,55 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_AggregatedList_sync]
+import com.google.cloud.compute.v1.AggregatedListDisksRequest;
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.DisksScopedList;
+import java.util.Map;
+
+public class SyncAggregatedList {
+
+ public static void main(String[] args) throws Exception {
+ syncAggregatedList();
+ }
+
+ public static void syncAggregatedList() 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 (DisksClient disksClient = DisksClient.create()) {
+ AggregatedListDisksRequest request =
+ AggregatedListDisksRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setIncludeAllScopes(true)
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .build();
+ for (Map.Entry element :
+ disksClient.aggregatedList(request).iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_Disks_AggregatedList_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/aggregatedlist/SyncAggregatedListString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/aggregatedlist/SyncAggregatedListString.java
new file mode 100644
index 000000000000..c6170aa88697
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/aggregatedlist/SyncAggregatedListString.java
@@ -0,0 +1,45 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_AggregatedList_String_sync]
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.DisksScopedList;
+import java.util.Map;
+
+public class SyncAggregatedListString {
+
+ public static void main(String[] args) throws Exception {
+ syncAggregatedListString();
+ }
+
+ public static void syncAggregatedListString() 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 (DisksClient disksClient = DisksClient.create()) {
+ String project = "project-309310695";
+ for (Map.Entry element :
+ disksClient.aggregatedList(project).iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_Disks_AggregatedList_String_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/create/SyncCreateSetCredentialsProvider.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/create/SyncCreateSetCredentialsProvider.java
new file mode 100644
index 000000000000..773126f1b5a0
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_Create_SetCredentialsProvider_sync]
+import com.google.api.gax.core.FixedCredentialsProvider;
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.DisksSettings;
+import com.google.cloud.compute.v1.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
+ DisksSettings disksSettings =
+ DisksSettings.newBuilder()
+ .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ .build();
+ DisksClient disksClient = DisksClient.create(disksSettings);
+ }
+}
+// [END compute_v1_generated_Disks_Create_SetCredentialsProvider_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/create/SyncCreateSetEndpoint.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/create/SyncCreateSetEndpoint.java
new file mode 100644
index 000000000000..9da26e13c29f
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/create/SyncCreateSetEndpoint.java
@@ -0,0 +1,40 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_Create_SetEndpoint_sync]
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.DisksSettings;
+import com.google.cloud.compute.v1.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
+ DisksSettings disksSettings = DisksSettings.newBuilder().setEndpoint(myEndpoint).build();
+ DisksClient disksClient = DisksClient.create(disksSettings);
+ }
+}
+// [END compute_v1_generated_Disks_Create_SetEndpoint_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/createsnapshot/AsyncCreateSnapshot.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/createsnapshot/AsyncCreateSnapshot.java
new file mode 100644
index 000000000000..3814f862efb9
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/createsnapshot/AsyncCreateSnapshot.java
@@ -0,0 +1,54 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_CreateSnapshot_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.CreateSnapshotDiskRequest;
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.Snapshot;
+import com.google.longrunning.Operation;
+
+public class AsyncCreateSnapshot {
+
+ public static void main(String[] args) throws Exception {
+ asyncCreateSnapshot();
+ }
+
+ public static void asyncCreateSnapshot() 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 (DisksClient disksClient = DisksClient.create()) {
+ CreateSnapshotDiskRequest request =
+ CreateSnapshotDiskRequest.newBuilder()
+ .setDisk("disk3083677")
+ .setGuestFlush(true)
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setSnapshotResource(Snapshot.newBuilder().build())
+ .setZone("zone3744684")
+ .build();
+ ApiFuture future = disksClient.createSnapshotCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Disks_CreateSnapshot_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/createsnapshot/AsyncCreateSnapshotLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/createsnapshot/AsyncCreateSnapshotLRO.java
new file mode 100644
index 000000000000..49c4ccba6efd
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/createsnapshot/AsyncCreateSnapshotLRO.java
@@ -0,0 +1,55 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_CreateSnapshot_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.CreateSnapshotDiskRequest;
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.Snapshot;
+
+public class AsyncCreateSnapshotLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncCreateSnapshotLRO();
+ }
+
+ public static void asyncCreateSnapshotLRO() 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 (DisksClient disksClient = DisksClient.create()) {
+ CreateSnapshotDiskRequest request =
+ CreateSnapshotDiskRequest.newBuilder()
+ .setDisk("disk3083677")
+ .setGuestFlush(true)
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setSnapshotResource(Snapshot.newBuilder().build())
+ .setZone("zone3744684")
+ .build();
+ OperationFuture future =
+ disksClient.createSnapshotOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Disks_CreateSnapshot_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/createsnapshot/SyncCreateSnapshot.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/createsnapshot/SyncCreateSnapshot.java
new file mode 100644
index 000000000000..2876c1a8168a
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/createsnapshot/SyncCreateSnapshot.java
@@ -0,0 +1,51 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_CreateSnapshot_sync]
+import com.google.cloud.compute.v1.CreateSnapshotDiskRequest;
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.Snapshot;
+
+public class SyncCreateSnapshot {
+
+ public static void main(String[] args) throws Exception {
+ syncCreateSnapshot();
+ }
+
+ public static void syncCreateSnapshot() 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 (DisksClient disksClient = DisksClient.create()) {
+ CreateSnapshotDiskRequest request =
+ CreateSnapshotDiskRequest.newBuilder()
+ .setDisk("disk3083677")
+ .setGuestFlush(true)
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setSnapshotResource(Snapshot.newBuilder().build())
+ .setZone("zone3744684")
+ .build();
+ Operation response = disksClient.createSnapshotAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_Disks_CreateSnapshot_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/createsnapshot/SyncCreateSnapshotStringStringStringSnapshot.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/createsnapshot/SyncCreateSnapshotStringStringStringSnapshot.java
new file mode 100644
index 000000000000..9c8ee3ebb115
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/createsnapshot/SyncCreateSnapshotStringStringStringSnapshot.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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_CreateSnapshot_StringStringStringSnapshot_sync]
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.Snapshot;
+
+public class SyncCreateSnapshotStringStringStringSnapshot {
+
+ public static void main(String[] args) throws Exception {
+ syncCreateSnapshotStringStringStringSnapshot();
+ }
+
+ public static void syncCreateSnapshotStringStringStringSnapshot() 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 (DisksClient disksClient = DisksClient.create()) {
+ String project = "project-309310695";
+ String zone = "zone3744684";
+ String disk = "disk3083677";
+ Snapshot snapshotResource = Snapshot.newBuilder().build();
+ Operation response =
+ disksClient.createSnapshotAsync(project, zone, disk, snapshotResource).get();
+ }
+ }
+}
+// [END compute_v1_generated_Disks_CreateSnapshot_StringStringStringSnapshot_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/delete/AsyncDelete.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/delete/AsyncDelete.java
new file mode 100644
index 000000000000..789687611517
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/delete/AsyncDelete.java
@@ -0,0 +1,51 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_Delete_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.DeleteDiskRequest;
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.longrunning.Operation;
+
+public class AsyncDelete {
+
+ public static void main(String[] args) throws Exception {
+ asyncDelete();
+ }
+
+ public static void asyncDelete() 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 (DisksClient disksClient = DisksClient.create()) {
+ DeleteDiskRequest request =
+ DeleteDiskRequest.newBuilder()
+ .setDisk("disk3083677")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setZone("zone3744684")
+ .build();
+ ApiFuture future = disksClient.deleteCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Disks_Delete_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/delete/AsyncDeleteLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/delete/AsyncDeleteLRO.java
new file mode 100644
index 000000000000..a8d75b9d783f
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/delete/AsyncDeleteLRO.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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_Delete_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.DeleteDiskRequest;
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class AsyncDeleteLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncDeleteLRO();
+ }
+
+ public static void asyncDeleteLRO() 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 (DisksClient disksClient = DisksClient.create()) {
+ DeleteDiskRequest request =
+ DeleteDiskRequest.newBuilder()
+ .setDisk("disk3083677")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setZone("zone3744684")
+ .build();
+ OperationFuture future =
+ disksClient.deleteOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Disks_Delete_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/delete/SyncDelete.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/delete/SyncDelete.java
new file mode 100644
index 000000000000..2b548de5e840
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/delete/SyncDelete.java
@@ -0,0 +1,48 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_Delete_sync]
+import com.google.cloud.compute.v1.DeleteDiskRequest;
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncDelete {
+
+ public static void main(String[] args) throws Exception {
+ syncDelete();
+ }
+
+ public static void syncDelete() 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 (DisksClient disksClient = DisksClient.create()) {
+ DeleteDiskRequest request =
+ DeleteDiskRequest.newBuilder()
+ .setDisk("disk3083677")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setZone("zone3744684")
+ .build();
+ Operation response = disksClient.deleteAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_Disks_Delete_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/delete/SyncDeleteStringStringString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/delete/SyncDeleteStringStringString.java
new file mode 100644
index 000000000000..9844d4b4e1ec
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/delete/SyncDeleteStringStringString.java
@@ -0,0 +1,43 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_Delete_StringStringString_sync]
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncDeleteStringStringString {
+
+ public static void main(String[] args) throws Exception {
+ syncDeleteStringStringString();
+ }
+
+ public static void syncDeleteStringStringString() 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 (DisksClient disksClient = DisksClient.create()) {
+ String project = "project-309310695";
+ String zone = "zone3744684";
+ String disk = "disk3083677";
+ Operation response = disksClient.deleteAsync(project, zone, disk).get();
+ }
+ }
+}
+// [END compute_v1_generated_Disks_Delete_StringStringString_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/get/AsyncGet.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/get/AsyncGet.java
new file mode 100644
index 000000000000..38a34005baaa
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/get/AsyncGet.java
@@ -0,0 +1,50 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_Get_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.Disk;
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.GetDiskRequest;
+
+public class AsyncGet {
+
+ public static void main(String[] args) throws Exception {
+ asyncGet();
+ }
+
+ public static void asyncGet() 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 (DisksClient disksClient = DisksClient.create()) {
+ GetDiskRequest request =
+ GetDiskRequest.newBuilder()
+ .setDisk("disk3083677")
+ .setProject("project-309310695")
+ .setZone("zone3744684")
+ .build();
+ ApiFuture future = disksClient.getCallable().futureCall(request);
+ // Do something.
+ Disk response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Disks_Get_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/get/SyncGet.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/get/SyncGet.java
new file mode 100644
index 000000000000..e31965cbf6d1
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/get/SyncGet.java
@@ -0,0 +1,47 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_Get_sync]
+import com.google.cloud.compute.v1.Disk;
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.GetDiskRequest;
+
+public class SyncGet {
+
+ public static void main(String[] args) throws Exception {
+ syncGet();
+ }
+
+ public static void syncGet() 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 (DisksClient disksClient = DisksClient.create()) {
+ GetDiskRequest request =
+ GetDiskRequest.newBuilder()
+ .setDisk("disk3083677")
+ .setProject("project-309310695")
+ .setZone("zone3744684")
+ .build();
+ Disk response = disksClient.get(request);
+ }
+ }
+}
+// [END compute_v1_generated_Disks_Get_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/get/SyncGetStringStringString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/get/SyncGetStringStringString.java
new file mode 100644
index 000000000000..2b6ff639e2b5
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/get/SyncGetStringStringString.java
@@ -0,0 +1,43 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_Get_StringStringString_sync]
+import com.google.cloud.compute.v1.Disk;
+import com.google.cloud.compute.v1.DisksClient;
+
+public class SyncGetStringStringString {
+
+ public static void main(String[] args) throws Exception {
+ syncGetStringStringString();
+ }
+
+ public static void syncGetStringStringString() 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 (DisksClient disksClient = DisksClient.create()) {
+ String project = "project-309310695";
+ String zone = "zone3744684";
+ String disk = "disk3083677";
+ Disk response = disksClient.get(project, zone, disk);
+ }
+ }
+}
+// [END compute_v1_generated_Disks_Get_StringStringString_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/getiampolicy/AsyncGetIamPolicy.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/getiampolicy/AsyncGetIamPolicy.java
new file mode 100644
index 000000000000..b4d1823981b0
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/getiampolicy/AsyncGetIamPolicy.java
@@ -0,0 +1,51 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_GetIamPolicy_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.GetIamPolicyDiskRequest;
+import com.google.cloud.compute.v1.Policy;
+
+public class AsyncGetIamPolicy {
+
+ public static void main(String[] args) throws Exception {
+ asyncGetIamPolicy();
+ }
+
+ public static void asyncGetIamPolicy() 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 (DisksClient disksClient = DisksClient.create()) {
+ GetIamPolicyDiskRequest request =
+ GetIamPolicyDiskRequest.newBuilder()
+ .setOptionsRequestedPolicyVersion(-574521795)
+ .setProject("project-309310695")
+ .setResource("resource-341064690")
+ .setZone("zone3744684")
+ .build();
+ ApiFuture future = disksClient.getIamPolicyCallable().futureCall(request);
+ // Do something.
+ Policy response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Disks_GetIamPolicy_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/getiampolicy/SyncGetIamPolicy.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/getiampolicy/SyncGetIamPolicy.java
new file mode 100644
index 000000000000..c07ccae94042
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/getiampolicy/SyncGetIamPolicy.java
@@ -0,0 +1,48 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_GetIamPolicy_sync]
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.GetIamPolicyDiskRequest;
+import com.google.cloud.compute.v1.Policy;
+
+public class SyncGetIamPolicy {
+
+ public static void main(String[] args) throws Exception {
+ syncGetIamPolicy();
+ }
+
+ public static void syncGetIamPolicy() 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 (DisksClient disksClient = DisksClient.create()) {
+ GetIamPolicyDiskRequest request =
+ GetIamPolicyDiskRequest.newBuilder()
+ .setOptionsRequestedPolicyVersion(-574521795)
+ .setProject("project-309310695")
+ .setResource("resource-341064690")
+ .setZone("zone3744684")
+ .build();
+ Policy response = disksClient.getIamPolicy(request);
+ }
+ }
+}
+// [END compute_v1_generated_Disks_GetIamPolicy_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/getiampolicy/SyncGetIamPolicyStringStringString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/getiampolicy/SyncGetIamPolicyStringStringString.java
new file mode 100644
index 000000000000..bce8742e81a0
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/getiampolicy/SyncGetIamPolicyStringStringString.java
@@ -0,0 +1,43 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_GetIamPolicy_StringStringString_sync]
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.Policy;
+
+public class SyncGetIamPolicyStringStringString {
+
+ public static void main(String[] args) throws Exception {
+ syncGetIamPolicyStringStringString();
+ }
+
+ public static void syncGetIamPolicyStringStringString() 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 (DisksClient disksClient = DisksClient.create()) {
+ String project = "project-309310695";
+ String zone = "zone3744684";
+ String resource = "resource-341064690";
+ Policy response = disksClient.getIamPolicy(project, zone, resource);
+ }
+ }
+}
+// [END compute_v1_generated_Disks_GetIamPolicy_StringStringString_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/insert/AsyncInsert.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/insert/AsyncInsert.java
new file mode 100644
index 000000000000..3d1d41fa93d3
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/insert/AsyncInsert.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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_Insert_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.Disk;
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.InsertDiskRequest;
+import com.google.longrunning.Operation;
+
+public class AsyncInsert {
+
+ public static void main(String[] args) throws Exception {
+ asyncInsert();
+ }
+
+ public static void asyncInsert() 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 (DisksClient disksClient = DisksClient.create()) {
+ InsertDiskRequest request =
+ InsertDiskRequest.newBuilder()
+ .setDiskResource(Disk.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setSourceImage("sourceImage-105174528")
+ .setZone("zone3744684")
+ .build();
+ ApiFuture future = disksClient.insertCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Disks_Insert_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/insert/AsyncInsertLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/insert/AsyncInsertLRO.java
new file mode 100644
index 000000000000..4a35f728ed55
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/insert/AsyncInsertLRO.java
@@ -0,0 +1,54 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_Insert_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.Disk;
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.InsertDiskRequest;
+import com.google.cloud.compute.v1.Operation;
+
+public class AsyncInsertLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncInsertLRO();
+ }
+
+ public static void asyncInsertLRO() 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 (DisksClient disksClient = DisksClient.create()) {
+ InsertDiskRequest request =
+ InsertDiskRequest.newBuilder()
+ .setDiskResource(Disk.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setSourceImage("sourceImage-105174528")
+ .setZone("zone3744684")
+ .build();
+ OperationFuture future =
+ disksClient.insertOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Disks_Insert_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/insert/SyncInsert.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/insert/SyncInsert.java
new file mode 100644
index 000000000000..e647dfbe5e7e
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/insert/SyncInsert.java
@@ -0,0 +1,50 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_Insert_sync]
+import com.google.cloud.compute.v1.Disk;
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.InsertDiskRequest;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncInsert {
+
+ public static void main(String[] args) throws Exception {
+ syncInsert();
+ }
+
+ public static void syncInsert() 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 (DisksClient disksClient = DisksClient.create()) {
+ InsertDiskRequest request =
+ InsertDiskRequest.newBuilder()
+ .setDiskResource(Disk.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setSourceImage("sourceImage-105174528")
+ .setZone("zone3744684")
+ .build();
+ Operation response = disksClient.insertAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_Disks_Insert_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/insert/SyncInsertStringStringDisk.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/insert/SyncInsertStringStringDisk.java
new file mode 100644
index 000000000000..58ce1858cc21
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/insert/SyncInsertStringStringDisk.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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_Insert_StringStringDisk_sync]
+import com.google.cloud.compute.v1.Disk;
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncInsertStringStringDisk {
+
+ public static void main(String[] args) throws Exception {
+ syncInsertStringStringDisk();
+ }
+
+ public static void syncInsertStringStringDisk() 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 (DisksClient disksClient = DisksClient.create()) {
+ String project = "project-309310695";
+ String zone = "zone3744684";
+ Disk diskResource = Disk.newBuilder().build();
+ Operation response = disksClient.insertAsync(project, zone, diskResource).get();
+ }
+ }
+}
+// [END compute_v1_generated_Disks_Insert_StringStringDisk_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/list/AsyncList.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/list/AsyncList.java
new file mode 100644
index 000000000000..b05fdeb1e0ee
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/list/AsyncList.java
@@ -0,0 +1,56 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_List_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.Disk;
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.ListDisksRequest;
+
+public class AsyncList {
+
+ public static void main(String[] args) throws Exception {
+ asyncList();
+ }
+
+ public static void asyncList() 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 (DisksClient disksClient = DisksClient.create()) {
+ ListDisksRequest request =
+ ListDisksRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .setZone("zone3744684")
+ .build();
+ ApiFuture future = disksClient.listPagedCallable().futureCall(request);
+ // Do something.
+ for (Disk element : future.get().iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_Disks_List_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/list/AsyncListPaged.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/list/AsyncListPaged.java
new file mode 100644
index 000000000000..903f58a2d737
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/list/AsyncListPaged.java
@@ -0,0 +1,64 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_List_Paged_async]
+import com.google.cloud.compute.v1.Disk;
+import com.google.cloud.compute.v1.DiskList;
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.ListDisksRequest;
+import com.google.common.base.Strings;
+
+public class AsyncListPaged {
+
+ public static void main(String[] args) throws Exception {
+ asyncListPaged();
+ }
+
+ public static void asyncListPaged() 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 (DisksClient disksClient = DisksClient.create()) {
+ ListDisksRequest request =
+ ListDisksRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .setZone("zone3744684")
+ .build();
+ while (true) {
+ DiskList response = disksClient.listCallable().call(request);
+ for (Disk element : response.getItemsList()) {
+ // doThingsWith(element);
+ }
+ String nextPageToken = response.getNextPageToken();
+ if (!Strings.isNullOrEmpty(nextPageToken)) {
+ request = request.toBuilder().setPageToken(nextPageToken).build();
+ } else {
+ break;
+ }
+ }
+ }
+ }
+}
+// [END compute_v1_generated_Disks_List_Paged_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/list/SyncList.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/list/SyncList.java
new file mode 100644
index 000000000000..6314ecfa8512
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/list/SyncList.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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_List_sync]
+import com.google.cloud.compute.v1.Disk;
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.ListDisksRequest;
+
+public class SyncList {
+
+ public static void main(String[] args) throws Exception {
+ syncList();
+ }
+
+ public static void syncList() 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 (DisksClient disksClient = DisksClient.create()) {
+ ListDisksRequest request =
+ ListDisksRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .setZone("zone3744684")
+ .build();
+ for (Disk element : disksClient.list(request).iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_Disks_List_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/list/SyncListStringString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/list/SyncListStringString.java
new file mode 100644
index 000000000000..8f33889431e2
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/list/SyncListStringString.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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_List_StringString_sync]
+import com.google.cloud.compute.v1.Disk;
+import com.google.cloud.compute.v1.DisksClient;
+
+public class SyncListStringString {
+
+ public static void main(String[] args) throws Exception {
+ syncListStringString();
+ }
+
+ public static void syncListStringString() 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 (DisksClient disksClient = DisksClient.create()) {
+ String project = "project-309310695";
+ String zone = "zone3744684";
+ for (Disk element : disksClient.list(project, zone).iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_Disks_List_StringString_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/removeresourcepolicies/AsyncRemoveResourcePolicies.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/removeresourcepolicies/AsyncRemoveResourcePolicies.java
new file mode 100644
index 000000000000..2577087c0d63
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/removeresourcepolicies/AsyncRemoveResourcePolicies.java
@@ -0,0 +1,55 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_RemoveResourcePolicies_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.DisksRemoveResourcePoliciesRequest;
+import com.google.cloud.compute.v1.RemoveResourcePoliciesDiskRequest;
+import com.google.longrunning.Operation;
+
+public class AsyncRemoveResourcePolicies {
+
+ public static void main(String[] args) throws Exception {
+ asyncRemoveResourcePolicies();
+ }
+
+ public static void asyncRemoveResourcePolicies() 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 (DisksClient disksClient = DisksClient.create()) {
+ RemoveResourcePoliciesDiskRequest request =
+ RemoveResourcePoliciesDiskRequest.newBuilder()
+ .setDisk("disk3083677")
+ .setDisksRemoveResourcePoliciesRequestResource(
+ DisksRemoveResourcePoliciesRequest.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setZone("zone3744684")
+ .build();
+ ApiFuture future =
+ disksClient.removeResourcePoliciesCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Disks_RemoveResourcePolicies_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/removeresourcepolicies/AsyncRemoveResourcePoliciesLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/removeresourcepolicies/AsyncRemoveResourcePoliciesLRO.java
new file mode 100644
index 000000000000..084cc4c81d3c
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/removeresourcepolicies/AsyncRemoveResourcePoliciesLRO.java
@@ -0,0 +1,55 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_RemoveResourcePolicies_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.DisksRemoveResourcePoliciesRequest;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.RemoveResourcePoliciesDiskRequest;
+
+public class AsyncRemoveResourcePoliciesLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncRemoveResourcePoliciesLRO();
+ }
+
+ public static void asyncRemoveResourcePoliciesLRO() 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 (DisksClient disksClient = DisksClient.create()) {
+ RemoveResourcePoliciesDiskRequest request =
+ RemoveResourcePoliciesDiskRequest.newBuilder()
+ .setDisk("disk3083677")
+ .setDisksRemoveResourcePoliciesRequestResource(
+ DisksRemoveResourcePoliciesRequest.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setZone("zone3744684")
+ .build();
+ OperationFuture future =
+ disksClient.removeResourcePoliciesOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Disks_RemoveResourcePolicies_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/removeresourcepolicies/SyncRemoveResourcePolicies.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/removeresourcepolicies/SyncRemoveResourcePolicies.java
new file mode 100644
index 000000000000..eb5c3ca468c5
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/removeresourcepolicies/SyncRemoveResourcePolicies.java
@@ -0,0 +1,51 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_RemoveResourcePolicies_sync]
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.DisksRemoveResourcePoliciesRequest;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.RemoveResourcePoliciesDiskRequest;
+
+public class SyncRemoveResourcePolicies {
+
+ public static void main(String[] args) throws Exception {
+ syncRemoveResourcePolicies();
+ }
+
+ public static void syncRemoveResourcePolicies() 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 (DisksClient disksClient = DisksClient.create()) {
+ RemoveResourcePoliciesDiskRequest request =
+ RemoveResourcePoliciesDiskRequest.newBuilder()
+ .setDisk("disk3083677")
+ .setDisksRemoveResourcePoliciesRequestResource(
+ DisksRemoveResourcePoliciesRequest.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setZone("zone3744684")
+ .build();
+ Operation response = disksClient.removeResourcePoliciesAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_Disks_RemoveResourcePolicies_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/removeresourcepolicies/SyncRemoveResourcePoliciesStringStringStringDisksremoveresourcepoliciesrequest.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/removeresourcepolicies/SyncRemoveResourcePoliciesStringStringStringDisksremoveresourcepoliciesrequest.java
new file mode 100644
index 000000000000..8a56c0b51f91
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/removeresourcepolicies/SyncRemoveResourcePoliciesStringStringStringDisksremoveresourcepoliciesrequest.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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_RemoveResourcePolicies_StringStringStringDisksremoveresourcepoliciesrequest_sync]
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.DisksRemoveResourcePoliciesRequest;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncRemoveResourcePoliciesStringStringStringDisksremoveresourcepoliciesrequest {
+
+ public static void main(String[] args) throws Exception {
+ syncRemoveResourcePoliciesStringStringStringDisksremoveresourcepoliciesrequest();
+ }
+
+ public static void
+ syncRemoveResourcePoliciesStringStringStringDisksremoveresourcepoliciesrequest()
+ 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 (DisksClient disksClient = DisksClient.create()) {
+ String project = "project-309310695";
+ String zone = "zone3744684";
+ String disk = "disk3083677";
+ DisksRemoveResourcePoliciesRequest disksRemoveResourcePoliciesRequestResource =
+ DisksRemoveResourcePoliciesRequest.newBuilder().build();
+ Operation response =
+ disksClient
+ .removeResourcePoliciesAsync(
+ project, zone, disk, disksRemoveResourcePoliciesRequestResource)
+ .get();
+ }
+ }
+}
+// [END compute_v1_generated_Disks_RemoveResourcePolicies_StringStringStringDisksremoveresourcepoliciesrequest_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/resize/AsyncResize.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/resize/AsyncResize.java
new file mode 100644
index 000000000000..c0c1bf002679
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/resize/AsyncResize.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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_Resize_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.DisksResizeRequest;
+import com.google.cloud.compute.v1.ResizeDiskRequest;
+import com.google.longrunning.Operation;
+
+public class AsyncResize {
+
+ public static void main(String[] args) throws Exception {
+ asyncResize();
+ }
+
+ public static void asyncResize() 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 (DisksClient disksClient = DisksClient.create()) {
+ ResizeDiskRequest request =
+ ResizeDiskRequest.newBuilder()
+ .setDisk("disk3083677")
+ .setDisksResizeRequestResource(DisksResizeRequest.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setZone("zone3744684")
+ .build();
+ ApiFuture future = disksClient.resizeCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Disks_Resize_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/resize/AsyncResizeLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/resize/AsyncResizeLRO.java
new file mode 100644
index 000000000000..c80a87437154
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/resize/AsyncResizeLRO.java
@@ -0,0 +1,54 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_Resize_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.DisksResizeRequest;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.ResizeDiskRequest;
+
+public class AsyncResizeLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncResizeLRO();
+ }
+
+ public static void asyncResizeLRO() 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 (DisksClient disksClient = DisksClient.create()) {
+ ResizeDiskRequest request =
+ ResizeDiskRequest.newBuilder()
+ .setDisk("disk3083677")
+ .setDisksResizeRequestResource(DisksResizeRequest.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setZone("zone3744684")
+ .build();
+ OperationFuture future =
+ disksClient.resizeOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Disks_Resize_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/resize/SyncResize.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/resize/SyncResize.java
new file mode 100644
index 000000000000..7d3ef9be3c97
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/resize/SyncResize.java
@@ -0,0 +1,50 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_Resize_sync]
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.DisksResizeRequest;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.ResizeDiskRequest;
+
+public class SyncResize {
+
+ public static void main(String[] args) throws Exception {
+ syncResize();
+ }
+
+ public static void syncResize() 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 (DisksClient disksClient = DisksClient.create()) {
+ ResizeDiskRequest request =
+ ResizeDiskRequest.newBuilder()
+ .setDisk("disk3083677")
+ .setDisksResizeRequestResource(DisksResizeRequest.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setZone("zone3744684")
+ .build();
+ Operation response = disksClient.resizeAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_Disks_Resize_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/resize/SyncResizeStringStringStringDisksresizerequest.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/resize/SyncResizeStringStringStringDisksresizerequest.java
new file mode 100644
index 000000000000..e52c9c8bb691
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/resize/SyncResizeStringStringStringDisksresizerequest.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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_Resize_StringStringStringDisksresizerequest_sync]
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.DisksResizeRequest;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncResizeStringStringStringDisksresizerequest {
+
+ public static void main(String[] args) throws Exception {
+ syncResizeStringStringStringDisksresizerequest();
+ }
+
+ public static void syncResizeStringStringStringDisksresizerequest() 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 (DisksClient disksClient = DisksClient.create()) {
+ String project = "project-309310695";
+ String zone = "zone3744684";
+ String disk = "disk3083677";
+ DisksResizeRequest disksResizeRequestResource = DisksResizeRequest.newBuilder().build();
+ Operation response =
+ disksClient.resizeAsync(project, zone, disk, disksResizeRequestResource).get();
+ }
+ }
+}
+// [END compute_v1_generated_Disks_Resize_StringStringStringDisksresizerequest_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/setiampolicy/AsyncSetIamPolicy.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/setiampolicy/AsyncSetIamPolicy.java
new file mode 100644
index 000000000000..3e486a24f16a
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/setiampolicy/AsyncSetIamPolicy.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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_SetIamPolicy_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.Policy;
+import com.google.cloud.compute.v1.SetIamPolicyDiskRequest;
+import com.google.cloud.compute.v1.ZoneSetPolicyRequest;
+
+public class AsyncSetIamPolicy {
+
+ public static void main(String[] args) throws Exception {
+ asyncSetIamPolicy();
+ }
+
+ public static void asyncSetIamPolicy() 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 (DisksClient disksClient = DisksClient.create()) {
+ SetIamPolicyDiskRequest request =
+ SetIamPolicyDiskRequest.newBuilder()
+ .setProject("project-309310695")
+ .setResource("resource-341064690")
+ .setZone("zone3744684")
+ .setZoneSetPolicyRequestResource(ZoneSetPolicyRequest.newBuilder().build())
+ .build();
+ ApiFuture future = disksClient.setIamPolicyCallable().futureCall(request);
+ // Do something.
+ Policy response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Disks_SetIamPolicy_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/setiampolicy/SyncSetIamPolicy.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/setiampolicy/SyncSetIamPolicy.java
new file mode 100644
index 000000000000..a1ae0b587bd9
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/setiampolicy/SyncSetIamPolicy.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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_SetIamPolicy_sync]
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.Policy;
+import com.google.cloud.compute.v1.SetIamPolicyDiskRequest;
+import com.google.cloud.compute.v1.ZoneSetPolicyRequest;
+
+public class SyncSetIamPolicy {
+
+ public static void main(String[] args) throws Exception {
+ syncSetIamPolicy();
+ }
+
+ public static void syncSetIamPolicy() 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 (DisksClient disksClient = DisksClient.create()) {
+ SetIamPolicyDiskRequest request =
+ SetIamPolicyDiskRequest.newBuilder()
+ .setProject("project-309310695")
+ .setResource("resource-341064690")
+ .setZone("zone3744684")
+ .setZoneSetPolicyRequestResource(ZoneSetPolicyRequest.newBuilder().build())
+ .build();
+ Policy response = disksClient.setIamPolicy(request);
+ }
+ }
+}
+// [END compute_v1_generated_Disks_SetIamPolicy_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/setiampolicy/SyncSetIamPolicyStringStringStringZonesetpolicyrequest.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/setiampolicy/SyncSetIamPolicyStringStringStringZonesetpolicyrequest.java
new file mode 100644
index 000000000000..f652d953914a
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/setiampolicy/SyncSetIamPolicyStringStringStringZonesetpolicyrequest.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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_SetIamPolicy_StringStringStringZonesetpolicyrequest_sync]
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.Policy;
+import com.google.cloud.compute.v1.ZoneSetPolicyRequest;
+
+public class SyncSetIamPolicyStringStringStringZonesetpolicyrequest {
+
+ public static void main(String[] args) throws Exception {
+ syncSetIamPolicyStringStringStringZonesetpolicyrequest();
+ }
+
+ public static void syncSetIamPolicyStringStringStringZonesetpolicyrequest() 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 (DisksClient disksClient = DisksClient.create()) {
+ String project = "project-309310695";
+ String zone = "zone3744684";
+ String resource = "resource-341064690";
+ ZoneSetPolicyRequest zoneSetPolicyRequestResource = ZoneSetPolicyRequest.newBuilder().build();
+ Policy response =
+ disksClient.setIamPolicy(project, zone, resource, zoneSetPolicyRequestResource);
+ }
+ }
+}
+// [END compute_v1_generated_Disks_SetIamPolicy_StringStringStringZonesetpolicyrequest_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/setlabels/AsyncSetLabels.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/setlabels/AsyncSetLabels.java
new file mode 100644
index 000000000000..0f3157288002
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/setlabels/AsyncSetLabels.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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_SetLabels_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.SetLabelsDiskRequest;
+import com.google.cloud.compute.v1.ZoneSetLabelsRequest;
+import com.google.longrunning.Operation;
+
+public class AsyncSetLabels {
+
+ public static void main(String[] args) throws Exception {
+ asyncSetLabels();
+ }
+
+ public static void asyncSetLabels() 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 (DisksClient disksClient = DisksClient.create()) {
+ SetLabelsDiskRequest request =
+ SetLabelsDiskRequest.newBuilder()
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setResource("resource-341064690")
+ .setZone("zone3744684")
+ .setZoneSetLabelsRequestResource(ZoneSetLabelsRequest.newBuilder().build())
+ .build();
+ ApiFuture future = disksClient.setLabelsCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Disks_SetLabels_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/setlabels/AsyncSetLabelsLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/setlabels/AsyncSetLabelsLRO.java
new file mode 100644
index 000000000000..91d8fd86b3b9
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/setlabels/AsyncSetLabelsLRO.java
@@ -0,0 +1,54 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_SetLabels_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.SetLabelsDiskRequest;
+import com.google.cloud.compute.v1.ZoneSetLabelsRequest;
+
+public class AsyncSetLabelsLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncSetLabelsLRO();
+ }
+
+ public static void asyncSetLabelsLRO() 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 (DisksClient disksClient = DisksClient.create()) {
+ SetLabelsDiskRequest request =
+ SetLabelsDiskRequest.newBuilder()
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setResource("resource-341064690")
+ .setZone("zone3744684")
+ .setZoneSetLabelsRequestResource(ZoneSetLabelsRequest.newBuilder().build())
+ .build();
+ OperationFuture future =
+ disksClient.setLabelsOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Disks_SetLabels_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/setlabels/SyncSetLabels.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/setlabels/SyncSetLabels.java
new file mode 100644
index 000000000000..bcb4c2da544d
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/setlabels/SyncSetLabels.java
@@ -0,0 +1,50 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_SetLabels_sync]
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.SetLabelsDiskRequest;
+import com.google.cloud.compute.v1.ZoneSetLabelsRequest;
+
+public class SyncSetLabels {
+
+ public static void main(String[] args) throws Exception {
+ syncSetLabels();
+ }
+
+ public static void syncSetLabels() 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 (DisksClient disksClient = DisksClient.create()) {
+ SetLabelsDiskRequest request =
+ SetLabelsDiskRequest.newBuilder()
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setResource("resource-341064690")
+ .setZone("zone3744684")
+ .setZoneSetLabelsRequestResource(ZoneSetLabelsRequest.newBuilder().build())
+ .build();
+ Operation response = disksClient.setLabelsAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_Disks_SetLabels_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/setlabels/SyncSetLabelsStringStringStringZonesetlabelsrequest.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/setlabels/SyncSetLabelsStringStringStringZonesetlabelsrequest.java
new file mode 100644
index 000000000000..65110e4d3c8e
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/setlabels/SyncSetLabelsStringStringStringZonesetlabelsrequest.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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_SetLabels_StringStringStringZonesetlabelsrequest_sync]
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.ZoneSetLabelsRequest;
+
+public class SyncSetLabelsStringStringStringZonesetlabelsrequest {
+
+ public static void main(String[] args) throws Exception {
+ syncSetLabelsStringStringStringZonesetlabelsrequest();
+ }
+
+ public static void syncSetLabelsStringStringStringZonesetlabelsrequest() 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 (DisksClient disksClient = DisksClient.create()) {
+ String project = "project-309310695";
+ String zone = "zone3744684";
+ String resource = "resource-341064690";
+ ZoneSetLabelsRequest zoneSetLabelsRequestResource = ZoneSetLabelsRequest.newBuilder().build();
+ Operation response =
+ disksClient.setLabelsAsync(project, zone, resource, zoneSetLabelsRequestResource).get();
+ }
+ }
+}
+// [END compute_v1_generated_Disks_SetLabels_StringStringStringZonesetlabelsrequest_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/testiampermissions/AsyncTestIamPermissions.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/testiampermissions/AsyncTestIamPermissions.java
new file mode 100644
index 000000000000..87f0c0078828
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/testiampermissions/AsyncTestIamPermissions.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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_TestIamPermissions_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.TestIamPermissionsDiskRequest;
+import com.google.cloud.compute.v1.TestPermissionsRequest;
+import com.google.cloud.compute.v1.TestPermissionsResponse;
+
+public class AsyncTestIamPermissions {
+
+ public static void main(String[] args) throws Exception {
+ asyncTestIamPermissions();
+ }
+
+ public static void asyncTestIamPermissions() 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 (DisksClient disksClient = DisksClient.create()) {
+ TestIamPermissionsDiskRequest request =
+ TestIamPermissionsDiskRequest.newBuilder()
+ .setProject("project-309310695")
+ .setResource("resource-341064690")
+ .setTestPermissionsRequestResource(TestPermissionsRequest.newBuilder().build())
+ .setZone("zone3744684")
+ .build();
+ ApiFuture future =
+ disksClient.testIamPermissionsCallable().futureCall(request);
+ // Do something.
+ TestPermissionsResponse response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Disks_TestIamPermissions_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/testiampermissions/SyncTestIamPermissions.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/testiampermissions/SyncTestIamPermissions.java
new file mode 100644
index 000000000000..3f93550f4522
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/testiampermissions/SyncTestIamPermissions.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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_TestIamPermissions_sync]
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.TestIamPermissionsDiskRequest;
+import com.google.cloud.compute.v1.TestPermissionsRequest;
+import com.google.cloud.compute.v1.TestPermissionsResponse;
+
+public class SyncTestIamPermissions {
+
+ public static void main(String[] args) throws Exception {
+ syncTestIamPermissions();
+ }
+
+ public static void syncTestIamPermissions() 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 (DisksClient disksClient = DisksClient.create()) {
+ TestIamPermissionsDiskRequest request =
+ TestIamPermissionsDiskRequest.newBuilder()
+ .setProject("project-309310695")
+ .setResource("resource-341064690")
+ .setTestPermissionsRequestResource(TestPermissionsRequest.newBuilder().build())
+ .setZone("zone3744684")
+ .build();
+ TestPermissionsResponse response = disksClient.testIamPermissions(request);
+ }
+ }
+}
+// [END compute_v1_generated_Disks_TestIamPermissions_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/testiampermissions/SyncTestIamPermissionsStringStringStringTestpermissionsrequest.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/testiampermissions/SyncTestIamPermissionsStringStringStringTestpermissionsrequest.java
new file mode 100644
index 000000000000..7d8199a4c475
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/testiampermissions/SyncTestIamPermissionsStringStringStringTestpermissionsrequest.java
@@ -0,0 +1,48 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_TestIamPermissions_StringStringStringTestpermissionsrequest_sync]
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.TestPermissionsRequest;
+import com.google.cloud.compute.v1.TestPermissionsResponse;
+
+public class SyncTestIamPermissionsStringStringStringTestpermissionsrequest {
+
+ public static void main(String[] args) throws Exception {
+ syncTestIamPermissionsStringStringStringTestpermissionsrequest();
+ }
+
+ public static void syncTestIamPermissionsStringStringStringTestpermissionsrequest()
+ 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 (DisksClient disksClient = DisksClient.create()) {
+ String project = "project-309310695";
+ String zone = "zone3744684";
+ String resource = "resource-341064690";
+ TestPermissionsRequest testPermissionsRequestResource =
+ TestPermissionsRequest.newBuilder().build();
+ TestPermissionsResponse response =
+ disksClient.testIamPermissions(project, zone, resource, testPermissionsRequestResource);
+ }
+ }
+}
+// [END compute_v1_generated_Disks_TestIamPermissions_StringStringStringTestpermissionsrequest_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/update/AsyncUpdate.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/update/AsyncUpdate.java
new file mode 100644
index 000000000000..7777d1bbf92d
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/update/AsyncUpdate.java
@@ -0,0 +1,55 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_Update_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.Disk;
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.UpdateDiskRequest;
+import com.google.longrunning.Operation;
+
+public class AsyncUpdate {
+
+ public static void main(String[] args) throws Exception {
+ asyncUpdate();
+ }
+
+ public static void asyncUpdate() 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 (DisksClient disksClient = DisksClient.create()) {
+ UpdateDiskRequest request =
+ UpdateDiskRequest.newBuilder()
+ .setDisk("disk3083677")
+ .setDiskResource(Disk.newBuilder().build())
+ .setPaths("paths106438894")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setUpdateMask("updateMask-296147115")
+ .setZone("zone3744684")
+ .build();
+ ApiFuture future = disksClient.updateCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Disks_Update_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/update/AsyncUpdateLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/update/AsyncUpdateLRO.java
new file mode 100644
index 000000000000..a3f6f2d94664
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/update/AsyncUpdateLRO.java
@@ -0,0 +1,56 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_Update_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.Disk;
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.UpdateDiskRequest;
+
+public class AsyncUpdateLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncUpdateLRO();
+ }
+
+ public static void asyncUpdateLRO() 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 (DisksClient disksClient = DisksClient.create()) {
+ UpdateDiskRequest request =
+ UpdateDiskRequest.newBuilder()
+ .setDisk("disk3083677")
+ .setDiskResource(Disk.newBuilder().build())
+ .setPaths("paths106438894")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setUpdateMask("updateMask-296147115")
+ .setZone("zone3744684")
+ .build();
+ OperationFuture future =
+ disksClient.updateOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Disks_Update_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/update/SyncUpdate.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/update/SyncUpdate.java
new file mode 100644
index 000000000000..578fc16b2df1
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/update/SyncUpdate.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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_Update_sync]
+import com.google.cloud.compute.v1.Disk;
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.UpdateDiskRequest;
+
+public class SyncUpdate {
+
+ public static void main(String[] args) throws Exception {
+ syncUpdate();
+ }
+
+ public static void syncUpdate() 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 (DisksClient disksClient = DisksClient.create()) {
+ UpdateDiskRequest request =
+ UpdateDiskRequest.newBuilder()
+ .setDisk("disk3083677")
+ .setDiskResource(Disk.newBuilder().build())
+ .setPaths("paths106438894")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .setUpdateMask("updateMask-296147115")
+ .setZone("zone3744684")
+ .build();
+ Operation response = disksClient.updateAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_Disks_Update_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/update/SyncUpdateStringStringStringDisk.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/update/SyncUpdateStringStringStringDisk.java
new file mode 100644
index 000000000000..7456b4a26c19
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disks/update/SyncUpdateStringStringStringDisk.java
@@ -0,0 +1,45 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Disks_Update_StringStringStringDisk_sync]
+import com.google.cloud.compute.v1.Disk;
+import com.google.cloud.compute.v1.DisksClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncUpdateStringStringStringDisk {
+
+ public static void main(String[] args) throws Exception {
+ syncUpdateStringStringStringDisk();
+ }
+
+ public static void syncUpdateStringStringStringDisk() 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 (DisksClient disksClient = DisksClient.create()) {
+ String project = "project-309310695";
+ String zone = "zone3744684";
+ String disk = "disk3083677";
+ Disk diskResource = Disk.newBuilder().build();
+ Operation response = disksClient.updateAsync(project, zone, disk, diskResource).get();
+ }
+ }
+}
+// [END compute_v1_generated_Disks_Update_StringStringStringDisk_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/diskssettings/get/SyncGet.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/diskssettings/get/SyncGet.java
new file mode 100644
index 000000000000..a07b7f68ccff
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/diskssettings/get/SyncGet.java
@@ -0,0 +1,48 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_DisksSettings_Get_sync]
+import com.google.cloud.compute.v1.DisksSettings;
+import java.time.Duration;
+
+public class SyncGet {
+
+ public static void main(String[] args) throws Exception {
+ syncGet();
+ }
+
+ public static void syncGet() 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
+ DisksSettings.Builder disksSettingsBuilder = DisksSettings.newBuilder();
+ disksSettingsBuilder
+ .getSettings()
+ .setRetrySettings(
+ disksSettingsBuilder
+ .getSettings()
+ .getRetrySettings()
+ .toBuilder()
+ .setTotalTimeout(Duration.ofSeconds(30))
+ .build());
+ DisksSettings disksSettings = disksSettingsBuilder.build();
+ }
+}
+// [END compute_v1_generated_DisksSettings_Get_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disktypes/aggregatedlist/AsyncAggregatedList.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disktypes/aggregatedlist/AsyncAggregatedList.java
new file mode 100644
index 000000000000..d17514894a34
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disktypes/aggregatedlist/AsyncAggregatedList.java
@@ -0,0 +1,58 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_DiskTypes_AggregatedList_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.AggregatedListDiskTypesRequest;
+import com.google.cloud.compute.v1.DiskTypesClient;
+import com.google.cloud.compute.v1.DiskTypesScopedList;
+import java.util.Map;
+
+public class AsyncAggregatedList {
+
+ public static void main(String[] args) throws Exception {
+ asyncAggregatedList();
+ }
+
+ public static void asyncAggregatedList() 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 (DiskTypesClient diskTypesClient = DiskTypesClient.create()) {
+ AggregatedListDiskTypesRequest request =
+ AggregatedListDiskTypesRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setIncludeAllScopes(true)
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .build();
+ ApiFuture> future =
+ diskTypesClient.aggregatedListPagedCallable().futureCall(request);
+ // Do something.
+ for (Map.Entry element : future.get().iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_DiskTypes_AggregatedList_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disktypes/aggregatedlist/AsyncAggregatedListPaged.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disktypes/aggregatedlist/AsyncAggregatedListPaged.java
new file mode 100644
index 000000000000..c7cf9e3d9127
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disktypes/aggregatedlist/AsyncAggregatedListPaged.java
@@ -0,0 +1,65 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_DiskTypes_AggregatedList_Paged_async]
+import com.google.cloud.compute.v1.AggregatedListDiskTypesRequest;
+import com.google.cloud.compute.v1.DiskTypeAggregatedList;
+import com.google.cloud.compute.v1.DiskTypesClient;
+import com.google.cloud.compute.v1.DiskTypesScopedList;
+import com.google.common.base.Strings;
+import java.util.Map;
+
+public class AsyncAggregatedListPaged {
+
+ public static void main(String[] args) throws Exception {
+ asyncAggregatedListPaged();
+ }
+
+ public static void asyncAggregatedListPaged() 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 (DiskTypesClient diskTypesClient = DiskTypesClient.create()) {
+ AggregatedListDiskTypesRequest request =
+ AggregatedListDiskTypesRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setIncludeAllScopes(true)
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .build();
+ while (true) {
+ DiskTypeAggregatedList response = diskTypesClient.aggregatedListCallable().call(request);
+ for (Map.Entry element : response.getItemsList()) {
+ // doThingsWith(element);
+ }
+ String nextPageToken = response.getNextPageToken();
+ if (!Strings.isNullOrEmpty(nextPageToken)) {
+ request = request.toBuilder().setPageToken(nextPageToken).build();
+ } else {
+ break;
+ }
+ }
+ }
+ }
+}
+// [END compute_v1_generated_DiskTypes_AggregatedList_Paged_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disktypes/aggregatedlist/SyncAggregatedList.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disktypes/aggregatedlist/SyncAggregatedList.java
new file mode 100644
index 000000000000..52d3b1a52f7d
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disktypes/aggregatedlist/SyncAggregatedList.java
@@ -0,0 +1,55 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_DiskTypes_AggregatedList_sync]
+import com.google.cloud.compute.v1.AggregatedListDiskTypesRequest;
+import com.google.cloud.compute.v1.DiskTypesClient;
+import com.google.cloud.compute.v1.DiskTypesScopedList;
+import java.util.Map;
+
+public class SyncAggregatedList {
+
+ public static void main(String[] args) throws Exception {
+ syncAggregatedList();
+ }
+
+ public static void syncAggregatedList() 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 (DiskTypesClient diskTypesClient = DiskTypesClient.create()) {
+ AggregatedListDiskTypesRequest request =
+ AggregatedListDiskTypesRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setIncludeAllScopes(true)
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .build();
+ for (Map.Entry element :
+ diskTypesClient.aggregatedList(request).iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_DiskTypes_AggregatedList_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disktypes/aggregatedlist/SyncAggregatedListString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disktypes/aggregatedlist/SyncAggregatedListString.java
new file mode 100644
index 000000000000..2bdfb7f7d03f
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disktypes/aggregatedlist/SyncAggregatedListString.java
@@ -0,0 +1,45 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_DiskTypes_AggregatedList_String_sync]
+import com.google.cloud.compute.v1.DiskTypesClient;
+import com.google.cloud.compute.v1.DiskTypesScopedList;
+import java.util.Map;
+
+public class SyncAggregatedListString {
+
+ public static void main(String[] args) throws Exception {
+ syncAggregatedListString();
+ }
+
+ public static void syncAggregatedListString() 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 (DiskTypesClient diskTypesClient = DiskTypesClient.create()) {
+ String project = "project-309310695";
+ for (Map.Entry element :
+ diskTypesClient.aggregatedList(project).iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_DiskTypes_AggregatedList_String_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disktypes/create/SyncCreateSetCredentialsProvider.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disktypes/create/SyncCreateSetCredentialsProvider.java
new file mode 100644
index 000000000000..9f0d101a3298
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disktypes/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.compute.v1.samples;
+
+// [START compute_v1_generated_DiskTypes_Create_SetCredentialsProvider_sync]
+import com.google.api.gax.core.FixedCredentialsProvider;
+import com.google.cloud.compute.v1.DiskTypesClient;
+import com.google.cloud.compute.v1.DiskTypesSettings;
+import com.google.cloud.compute.v1.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
+ DiskTypesSettings diskTypesSettings =
+ DiskTypesSettings.newBuilder()
+ .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ .build();
+ DiskTypesClient diskTypesClient = DiskTypesClient.create(diskTypesSettings);
+ }
+}
+// [END compute_v1_generated_DiskTypes_Create_SetCredentialsProvider_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disktypes/create/SyncCreateSetEndpoint.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disktypes/create/SyncCreateSetEndpoint.java
new file mode 100644
index 000000000000..a3118631d970
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disktypes/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.compute.v1.samples;
+
+// [START compute_v1_generated_DiskTypes_Create_SetEndpoint_sync]
+import com.google.cloud.compute.v1.DiskTypesClient;
+import com.google.cloud.compute.v1.DiskTypesSettings;
+import com.google.cloud.compute.v1.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
+ DiskTypesSettings diskTypesSettings =
+ DiskTypesSettings.newBuilder().setEndpoint(myEndpoint).build();
+ DiskTypesClient diskTypesClient = DiskTypesClient.create(diskTypesSettings);
+ }
+}
+// [END compute_v1_generated_DiskTypes_Create_SetEndpoint_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disktypes/get/AsyncGet.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disktypes/get/AsyncGet.java
new file mode 100644
index 000000000000..44ecf2b9eca0
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disktypes/get/AsyncGet.java
@@ -0,0 +1,50 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_DiskTypes_Get_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.DiskType;
+import com.google.cloud.compute.v1.DiskTypesClient;
+import com.google.cloud.compute.v1.GetDiskTypeRequest;
+
+public class AsyncGet {
+
+ public static void main(String[] args) throws Exception {
+ asyncGet();
+ }
+
+ public static void asyncGet() 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 (DiskTypesClient diskTypesClient = DiskTypesClient.create()) {
+ GetDiskTypeRequest request =
+ GetDiskTypeRequest.newBuilder()
+ .setDiskType("diskType279771767")
+ .setProject("project-309310695")
+ .setZone("zone3744684")
+ .build();
+ ApiFuture future = diskTypesClient.getCallable().futureCall(request);
+ // Do something.
+ DiskType response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_DiskTypes_Get_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disktypes/get/SyncGet.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disktypes/get/SyncGet.java
new file mode 100644
index 000000000000..1a3c177f9ece
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disktypes/get/SyncGet.java
@@ -0,0 +1,47 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_DiskTypes_Get_sync]
+import com.google.cloud.compute.v1.DiskType;
+import com.google.cloud.compute.v1.DiskTypesClient;
+import com.google.cloud.compute.v1.GetDiskTypeRequest;
+
+public class SyncGet {
+
+ public static void main(String[] args) throws Exception {
+ syncGet();
+ }
+
+ public static void syncGet() 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 (DiskTypesClient diskTypesClient = DiskTypesClient.create()) {
+ GetDiskTypeRequest request =
+ GetDiskTypeRequest.newBuilder()
+ .setDiskType("diskType279771767")
+ .setProject("project-309310695")
+ .setZone("zone3744684")
+ .build();
+ DiskType response = diskTypesClient.get(request);
+ }
+ }
+}
+// [END compute_v1_generated_DiskTypes_Get_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disktypes/get/SyncGetStringStringString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disktypes/get/SyncGetStringStringString.java
new file mode 100644
index 000000000000..70937f3a2045
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disktypes/get/SyncGetStringStringString.java
@@ -0,0 +1,43 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_DiskTypes_Get_StringStringString_sync]
+import com.google.cloud.compute.v1.DiskType;
+import com.google.cloud.compute.v1.DiskTypesClient;
+
+public class SyncGetStringStringString {
+
+ public static void main(String[] args) throws Exception {
+ syncGetStringStringString();
+ }
+
+ public static void syncGetStringStringString() 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 (DiskTypesClient diskTypesClient = DiskTypesClient.create()) {
+ String project = "project-309310695";
+ String zone = "zone3744684";
+ String diskType = "diskType279771767";
+ DiskType response = diskTypesClient.get(project, zone, diskType);
+ }
+ }
+}
+// [END compute_v1_generated_DiskTypes_Get_StringStringString_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disktypes/list/AsyncList.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disktypes/list/AsyncList.java
new file mode 100644
index 000000000000..c2cc0d563c9b
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disktypes/list/AsyncList.java
@@ -0,0 +1,56 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_DiskTypes_List_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.DiskType;
+import com.google.cloud.compute.v1.DiskTypesClient;
+import com.google.cloud.compute.v1.ListDiskTypesRequest;
+
+public class AsyncList {
+
+ public static void main(String[] args) throws Exception {
+ asyncList();
+ }
+
+ public static void asyncList() 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 (DiskTypesClient diskTypesClient = DiskTypesClient.create()) {
+ ListDiskTypesRequest request =
+ ListDiskTypesRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .setZone("zone3744684")
+ .build();
+ ApiFuture future = diskTypesClient.listPagedCallable().futureCall(request);
+ // Do something.
+ for (DiskType element : future.get().iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_DiskTypes_List_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disktypes/list/AsyncListPaged.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disktypes/list/AsyncListPaged.java
new file mode 100644
index 000000000000..84747a2ccfcf
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disktypes/list/AsyncListPaged.java
@@ -0,0 +1,64 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_DiskTypes_List_Paged_async]
+import com.google.cloud.compute.v1.DiskType;
+import com.google.cloud.compute.v1.DiskTypeList;
+import com.google.cloud.compute.v1.DiskTypesClient;
+import com.google.cloud.compute.v1.ListDiskTypesRequest;
+import com.google.common.base.Strings;
+
+public class AsyncListPaged {
+
+ public static void main(String[] args) throws Exception {
+ asyncListPaged();
+ }
+
+ public static void asyncListPaged() 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 (DiskTypesClient diskTypesClient = DiskTypesClient.create()) {
+ ListDiskTypesRequest request =
+ ListDiskTypesRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .setZone("zone3744684")
+ .build();
+ while (true) {
+ DiskTypeList response = diskTypesClient.listCallable().call(request);
+ for (DiskType element : response.getItemsList()) {
+ // doThingsWith(element);
+ }
+ String nextPageToken = response.getNextPageToken();
+ if (!Strings.isNullOrEmpty(nextPageToken)) {
+ request = request.toBuilder().setPageToken(nextPageToken).build();
+ } else {
+ break;
+ }
+ }
+ }
+ }
+}
+// [END compute_v1_generated_DiskTypes_List_Paged_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disktypes/list/SyncList.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disktypes/list/SyncList.java
new file mode 100644
index 000000000000..7bb220cbfd53
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disktypes/list/SyncList.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.compute.v1.samples;
+
+// [START compute_v1_generated_DiskTypes_List_sync]
+import com.google.cloud.compute.v1.DiskType;
+import com.google.cloud.compute.v1.DiskTypesClient;
+import com.google.cloud.compute.v1.ListDiskTypesRequest;
+
+public class SyncList {
+
+ public static void main(String[] args) throws Exception {
+ syncList();
+ }
+
+ public static void syncList() 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 (DiskTypesClient diskTypesClient = DiskTypesClient.create()) {
+ ListDiskTypesRequest request =
+ ListDiskTypesRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .setZone("zone3744684")
+ .build();
+ for (DiskType element : diskTypesClient.list(request).iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_DiskTypes_List_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disktypes/list/SyncListStringString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disktypes/list/SyncListStringString.java
new file mode 100644
index 000000000000..5e493d3518dd
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disktypes/list/SyncListStringString.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.compute.v1.samples;
+
+// [START compute_v1_generated_DiskTypes_List_StringString_sync]
+import com.google.cloud.compute.v1.DiskType;
+import com.google.cloud.compute.v1.DiskTypesClient;
+
+public class SyncListStringString {
+
+ public static void main(String[] args) throws Exception {
+ syncListStringString();
+ }
+
+ public static void syncListStringString() 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 (DiskTypesClient diskTypesClient = DiskTypesClient.create()) {
+ String project = "project-309310695";
+ String zone = "zone3744684";
+ for (DiskType element : diskTypesClient.list(project, zone).iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_DiskTypes_List_StringString_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disktypessettings/get/SyncGet.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disktypessettings/get/SyncGet.java
new file mode 100644
index 000000000000..82785ce382e7
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/disktypessettings/get/SyncGet.java
@@ -0,0 +1,48 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_DiskTypesSettings_Get_sync]
+import com.google.cloud.compute.v1.DiskTypesSettings;
+import java.time.Duration;
+
+public class SyncGet {
+
+ public static void main(String[] args) throws Exception {
+ syncGet();
+ }
+
+ public static void syncGet() 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
+ DiskTypesSettings.Builder diskTypesSettingsBuilder = DiskTypesSettings.newBuilder();
+ diskTypesSettingsBuilder
+ .getSettings()
+ .setRetrySettings(
+ diskTypesSettingsBuilder
+ .getSettings()
+ .getRetrySettings()
+ .toBuilder()
+ .setTotalTimeout(Duration.ofSeconds(30))
+ .build());
+ DiskTypesSettings diskTypesSettings = diskTypesSettingsBuilder.build();
+ }
+}
+// [END compute_v1_generated_DiskTypesSettings_Get_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/create/SyncCreateSetCredentialsProvider.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/create/SyncCreateSetCredentialsProvider.java
new file mode 100644
index 000000000000..0fc354128c60
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/create/SyncCreateSetCredentialsProvider.java
@@ -0,0 +1,45 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_ExternalVpnGateways_Create_SetCredentialsProvider_sync]
+import com.google.api.gax.core.FixedCredentialsProvider;
+import com.google.cloud.compute.v1.ExternalVpnGatewaysClient;
+import com.google.cloud.compute.v1.ExternalVpnGatewaysSettings;
+import com.google.cloud.compute.v1.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
+ ExternalVpnGatewaysSettings externalVpnGatewaysSettings =
+ ExternalVpnGatewaysSettings.newBuilder()
+ .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ .build();
+ ExternalVpnGatewaysClient externalVpnGatewaysClient =
+ ExternalVpnGatewaysClient.create(externalVpnGatewaysSettings);
+ }
+}
+// [END compute_v1_generated_ExternalVpnGateways_Create_SetCredentialsProvider_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/create/SyncCreateSetEndpoint.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/create/SyncCreateSetEndpoint.java
new file mode 100644
index 000000000000..a79b6246ce5a
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/create/SyncCreateSetEndpoint.java
@@ -0,0 +1,42 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_ExternalVpnGateways_Create_SetEndpoint_sync]
+import com.google.cloud.compute.v1.ExternalVpnGatewaysClient;
+import com.google.cloud.compute.v1.ExternalVpnGatewaysSettings;
+import com.google.cloud.compute.v1.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
+ ExternalVpnGatewaysSettings externalVpnGatewaysSettings =
+ ExternalVpnGatewaysSettings.newBuilder().setEndpoint(myEndpoint).build();
+ ExternalVpnGatewaysClient externalVpnGatewaysClient =
+ ExternalVpnGatewaysClient.create(externalVpnGatewaysSettings);
+ }
+}
+// [END compute_v1_generated_ExternalVpnGateways_Create_SetEndpoint_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/delete/AsyncDelete.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/delete/AsyncDelete.java
new file mode 100644
index 000000000000..01a144d56d3a
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/delete/AsyncDelete.java
@@ -0,0 +1,50 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_ExternalVpnGateways_Delete_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.DeleteExternalVpnGatewayRequest;
+import com.google.cloud.compute.v1.ExternalVpnGatewaysClient;
+import com.google.longrunning.Operation;
+
+public class AsyncDelete {
+
+ public static void main(String[] args) throws Exception {
+ asyncDelete();
+ }
+
+ public static void asyncDelete() 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 (ExternalVpnGatewaysClient externalVpnGatewaysClient = ExternalVpnGatewaysClient.create()) {
+ DeleteExternalVpnGatewayRequest request =
+ DeleteExternalVpnGatewayRequest.newBuilder()
+ .setExternalVpnGateway("externalVpnGateway-1140582181")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ ApiFuture future = externalVpnGatewaysClient.deleteCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_ExternalVpnGateways_Delete_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/delete/AsyncDeleteLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/delete/AsyncDeleteLRO.java
new file mode 100644
index 000000000000..67b935543ab9
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/delete/AsyncDeleteLRO.java
@@ -0,0 +1,51 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_ExternalVpnGateways_Delete_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.DeleteExternalVpnGatewayRequest;
+import com.google.cloud.compute.v1.ExternalVpnGatewaysClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class AsyncDeleteLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncDeleteLRO();
+ }
+
+ public static void asyncDeleteLRO() 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 (ExternalVpnGatewaysClient externalVpnGatewaysClient = ExternalVpnGatewaysClient.create()) {
+ DeleteExternalVpnGatewayRequest request =
+ DeleteExternalVpnGatewayRequest.newBuilder()
+ .setExternalVpnGateway("externalVpnGateway-1140582181")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ OperationFuture future =
+ externalVpnGatewaysClient.deleteOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_ExternalVpnGateways_Delete_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/delete/SyncDelete.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/delete/SyncDelete.java
new file mode 100644
index 000000000000..6be070969bdc
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/delete/SyncDelete.java
@@ -0,0 +1,47 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_ExternalVpnGateways_Delete_sync]
+import com.google.cloud.compute.v1.DeleteExternalVpnGatewayRequest;
+import com.google.cloud.compute.v1.ExternalVpnGatewaysClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncDelete {
+
+ public static void main(String[] args) throws Exception {
+ syncDelete();
+ }
+
+ public static void syncDelete() 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 (ExternalVpnGatewaysClient externalVpnGatewaysClient = ExternalVpnGatewaysClient.create()) {
+ DeleteExternalVpnGatewayRequest request =
+ DeleteExternalVpnGatewayRequest.newBuilder()
+ .setExternalVpnGateway("externalVpnGateway-1140582181")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ Operation response = externalVpnGatewaysClient.deleteAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_ExternalVpnGateways_Delete_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/delete/SyncDeleteStringString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/delete/SyncDeleteStringString.java
new file mode 100644
index 000000000000..d3ec943f7210
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/delete/SyncDeleteStringString.java
@@ -0,0 +1,42 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_ExternalVpnGateways_Delete_StringString_sync]
+import com.google.cloud.compute.v1.ExternalVpnGatewaysClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncDeleteStringString {
+
+ public static void main(String[] args) throws Exception {
+ syncDeleteStringString();
+ }
+
+ public static void syncDeleteStringString() 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 (ExternalVpnGatewaysClient externalVpnGatewaysClient = ExternalVpnGatewaysClient.create()) {
+ String project = "project-309310695";
+ String externalVpnGateway = "externalVpnGateway-1140582181";
+ Operation response = externalVpnGatewaysClient.deleteAsync(project, externalVpnGateway).get();
+ }
+ }
+}
+// [END compute_v1_generated_ExternalVpnGateways_Delete_StringString_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/get/AsyncGet.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/get/AsyncGet.java
new file mode 100644
index 000000000000..d37a223acbf5
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/get/AsyncGet.java
@@ -0,0 +1,50 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_ExternalVpnGateways_Get_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.ExternalVpnGateway;
+import com.google.cloud.compute.v1.ExternalVpnGatewaysClient;
+import com.google.cloud.compute.v1.GetExternalVpnGatewayRequest;
+
+public class AsyncGet {
+
+ public static void main(String[] args) throws Exception {
+ asyncGet();
+ }
+
+ public static void asyncGet() 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 (ExternalVpnGatewaysClient externalVpnGatewaysClient = ExternalVpnGatewaysClient.create()) {
+ GetExternalVpnGatewayRequest request =
+ GetExternalVpnGatewayRequest.newBuilder()
+ .setExternalVpnGateway("externalVpnGateway-1140582181")
+ .setProject("project-309310695")
+ .build();
+ ApiFuture future =
+ externalVpnGatewaysClient.getCallable().futureCall(request);
+ // Do something.
+ ExternalVpnGateway response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_ExternalVpnGateways_Get_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/get/SyncGet.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/get/SyncGet.java
new file mode 100644
index 000000000000..c010bdd82801
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/get/SyncGet.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.compute.v1.samples;
+
+// [START compute_v1_generated_ExternalVpnGateways_Get_sync]
+import com.google.cloud.compute.v1.ExternalVpnGateway;
+import com.google.cloud.compute.v1.ExternalVpnGatewaysClient;
+import com.google.cloud.compute.v1.GetExternalVpnGatewayRequest;
+
+public class SyncGet {
+
+ public static void main(String[] args) throws Exception {
+ syncGet();
+ }
+
+ public static void syncGet() 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 (ExternalVpnGatewaysClient externalVpnGatewaysClient = ExternalVpnGatewaysClient.create()) {
+ GetExternalVpnGatewayRequest request =
+ GetExternalVpnGatewayRequest.newBuilder()
+ .setExternalVpnGateway("externalVpnGateway-1140582181")
+ .setProject("project-309310695")
+ .build();
+ ExternalVpnGateway response = externalVpnGatewaysClient.get(request);
+ }
+ }
+}
+// [END compute_v1_generated_ExternalVpnGateways_Get_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/get/SyncGetStringString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/get/SyncGetStringString.java
new file mode 100644
index 000000000000..85d9383290eb
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/get/SyncGetStringString.java
@@ -0,0 +1,42 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_ExternalVpnGateways_Get_StringString_sync]
+import com.google.cloud.compute.v1.ExternalVpnGateway;
+import com.google.cloud.compute.v1.ExternalVpnGatewaysClient;
+
+public class SyncGetStringString {
+
+ public static void main(String[] args) throws Exception {
+ syncGetStringString();
+ }
+
+ public static void syncGetStringString() 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 (ExternalVpnGatewaysClient externalVpnGatewaysClient = ExternalVpnGatewaysClient.create()) {
+ String project = "project-309310695";
+ String externalVpnGateway = "externalVpnGateway-1140582181";
+ ExternalVpnGateway response = externalVpnGatewaysClient.get(project, externalVpnGateway);
+ }
+ }
+}
+// [END compute_v1_generated_ExternalVpnGateways_Get_StringString_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/insert/AsyncInsert.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/insert/AsyncInsert.java
new file mode 100644
index 000000000000..174d00ff38cc
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/insert/AsyncInsert.java
@@ -0,0 +1,51 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_ExternalVpnGateways_Insert_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.ExternalVpnGateway;
+import com.google.cloud.compute.v1.ExternalVpnGatewaysClient;
+import com.google.cloud.compute.v1.InsertExternalVpnGatewayRequest;
+import com.google.longrunning.Operation;
+
+public class AsyncInsert {
+
+ public static void main(String[] args) throws Exception {
+ asyncInsert();
+ }
+
+ public static void asyncInsert() 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 (ExternalVpnGatewaysClient externalVpnGatewaysClient = ExternalVpnGatewaysClient.create()) {
+ InsertExternalVpnGatewayRequest request =
+ InsertExternalVpnGatewayRequest.newBuilder()
+ .setExternalVpnGatewayResource(ExternalVpnGateway.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ ApiFuture future = externalVpnGatewaysClient.insertCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_ExternalVpnGateways_Insert_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/insert/AsyncInsertLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/insert/AsyncInsertLRO.java
new file mode 100644
index 000000000000..14cc12c9ba1e
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/insert/AsyncInsertLRO.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.compute.v1.samples;
+
+// [START compute_v1_generated_ExternalVpnGateways_Insert_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.ExternalVpnGateway;
+import com.google.cloud.compute.v1.ExternalVpnGatewaysClient;
+import com.google.cloud.compute.v1.InsertExternalVpnGatewayRequest;
+import com.google.cloud.compute.v1.Operation;
+
+public class AsyncInsertLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncInsertLRO();
+ }
+
+ public static void asyncInsertLRO() 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 (ExternalVpnGatewaysClient externalVpnGatewaysClient = ExternalVpnGatewaysClient.create()) {
+ InsertExternalVpnGatewayRequest request =
+ InsertExternalVpnGatewayRequest.newBuilder()
+ .setExternalVpnGatewayResource(ExternalVpnGateway.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ OperationFuture future =
+ externalVpnGatewaysClient.insertOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_ExternalVpnGateways_Insert_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/insert/SyncInsert.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/insert/SyncInsert.java
new file mode 100644
index 000000000000..79b62978e2f6
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/insert/SyncInsert.java
@@ -0,0 +1,48 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_ExternalVpnGateways_Insert_sync]
+import com.google.cloud.compute.v1.ExternalVpnGateway;
+import com.google.cloud.compute.v1.ExternalVpnGatewaysClient;
+import com.google.cloud.compute.v1.InsertExternalVpnGatewayRequest;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncInsert {
+
+ public static void main(String[] args) throws Exception {
+ syncInsert();
+ }
+
+ public static void syncInsert() 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 (ExternalVpnGatewaysClient externalVpnGatewaysClient = ExternalVpnGatewaysClient.create()) {
+ InsertExternalVpnGatewayRequest request =
+ InsertExternalVpnGatewayRequest.newBuilder()
+ .setExternalVpnGatewayResource(ExternalVpnGateway.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ Operation response = externalVpnGatewaysClient.insertAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_ExternalVpnGateways_Insert_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/insert/SyncInsertStringExternalvpngateway.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/insert/SyncInsertStringExternalvpngateway.java
new file mode 100644
index 000000000000..e9d8a636647f
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/insert/SyncInsertStringExternalvpngateway.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.compute.v1.samples;
+
+// [START compute_v1_generated_ExternalVpnGateways_Insert_StringExternalvpngateway_sync]
+import com.google.cloud.compute.v1.ExternalVpnGateway;
+import com.google.cloud.compute.v1.ExternalVpnGatewaysClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncInsertStringExternalvpngateway {
+
+ public static void main(String[] args) throws Exception {
+ syncInsertStringExternalvpngateway();
+ }
+
+ public static void syncInsertStringExternalvpngateway() 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 (ExternalVpnGatewaysClient externalVpnGatewaysClient = ExternalVpnGatewaysClient.create()) {
+ String project = "project-309310695";
+ ExternalVpnGateway externalVpnGatewayResource = ExternalVpnGateway.newBuilder().build();
+ Operation response =
+ externalVpnGatewaysClient.insertAsync(project, externalVpnGatewayResource).get();
+ }
+ }
+}
+// [END compute_v1_generated_ExternalVpnGateways_Insert_StringExternalvpngateway_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/list/AsyncList.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/list/AsyncList.java
new file mode 100644
index 000000000000..5b69e6b1f1b8
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/list/AsyncList.java
@@ -0,0 +1,56 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_ExternalVpnGateways_List_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.ExternalVpnGateway;
+import com.google.cloud.compute.v1.ExternalVpnGatewaysClient;
+import com.google.cloud.compute.v1.ListExternalVpnGatewaysRequest;
+
+public class AsyncList {
+
+ public static void main(String[] args) throws Exception {
+ asyncList();
+ }
+
+ public static void asyncList() 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 (ExternalVpnGatewaysClient externalVpnGatewaysClient = ExternalVpnGatewaysClient.create()) {
+ ListExternalVpnGatewaysRequest request =
+ ListExternalVpnGatewaysRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .build();
+ ApiFuture future =
+ externalVpnGatewaysClient.listPagedCallable().futureCall(request);
+ // Do something.
+ for (ExternalVpnGateway element : future.get().iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_ExternalVpnGateways_List_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/list/AsyncListPaged.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/list/AsyncListPaged.java
new file mode 100644
index 000000000000..1d2507b21643
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/list/AsyncListPaged.java
@@ -0,0 +1,63 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_ExternalVpnGateways_List_Paged_async]
+import com.google.cloud.compute.v1.ExternalVpnGateway;
+import com.google.cloud.compute.v1.ExternalVpnGatewayList;
+import com.google.cloud.compute.v1.ExternalVpnGatewaysClient;
+import com.google.cloud.compute.v1.ListExternalVpnGatewaysRequest;
+import com.google.common.base.Strings;
+
+public class AsyncListPaged {
+
+ public static void main(String[] args) throws Exception {
+ asyncListPaged();
+ }
+
+ public static void asyncListPaged() 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 (ExternalVpnGatewaysClient externalVpnGatewaysClient = ExternalVpnGatewaysClient.create()) {
+ ListExternalVpnGatewaysRequest request =
+ ListExternalVpnGatewaysRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .build();
+ while (true) {
+ ExternalVpnGatewayList response = externalVpnGatewaysClient.listCallable().call(request);
+ for (ExternalVpnGateway element : response.getItemsList()) {
+ // doThingsWith(element);
+ }
+ String nextPageToken = response.getNextPageToken();
+ if (!Strings.isNullOrEmpty(nextPageToken)) {
+ request = request.toBuilder().setPageToken(nextPageToken).build();
+ } else {
+ break;
+ }
+ }
+ }
+ }
+}
+// [END compute_v1_generated_ExternalVpnGateways_List_Paged_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/list/SyncList.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/list/SyncList.java
new file mode 100644
index 000000000000..f7e1b5980a6c
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/list/SyncList.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.compute.v1.samples;
+
+// [START compute_v1_generated_ExternalVpnGateways_List_sync]
+import com.google.cloud.compute.v1.ExternalVpnGateway;
+import com.google.cloud.compute.v1.ExternalVpnGatewaysClient;
+import com.google.cloud.compute.v1.ListExternalVpnGatewaysRequest;
+
+public class SyncList {
+
+ public static void main(String[] args) throws Exception {
+ syncList();
+ }
+
+ public static void syncList() 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 (ExternalVpnGatewaysClient externalVpnGatewaysClient = ExternalVpnGatewaysClient.create()) {
+ ListExternalVpnGatewaysRequest request =
+ ListExternalVpnGatewaysRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .build();
+ for (ExternalVpnGateway element : externalVpnGatewaysClient.list(request).iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_ExternalVpnGateways_List_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/list/SyncListString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/list/SyncListString.java
new file mode 100644
index 000000000000..7e52a649a5d0
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/list/SyncListString.java
@@ -0,0 +1,43 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_ExternalVpnGateways_List_String_sync]
+import com.google.cloud.compute.v1.ExternalVpnGateway;
+import com.google.cloud.compute.v1.ExternalVpnGatewaysClient;
+
+public class SyncListString {
+
+ public static void main(String[] args) throws Exception {
+ syncListString();
+ }
+
+ public static void syncListString() 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 (ExternalVpnGatewaysClient externalVpnGatewaysClient = ExternalVpnGatewaysClient.create()) {
+ String project = "project-309310695";
+ for (ExternalVpnGateway element : externalVpnGatewaysClient.list(project).iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_ExternalVpnGateways_List_String_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/setlabels/AsyncSetLabels.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/setlabels/AsyncSetLabels.java
new file mode 100644
index 000000000000..e85aba102f4f
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/setlabels/AsyncSetLabels.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.compute.v1.samples;
+
+// [START compute_v1_generated_ExternalVpnGateways_SetLabels_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.ExternalVpnGatewaysClient;
+import com.google.cloud.compute.v1.GlobalSetLabelsRequest;
+import com.google.cloud.compute.v1.SetLabelsExternalVpnGatewayRequest;
+import com.google.longrunning.Operation;
+
+public class AsyncSetLabels {
+
+ public static void main(String[] args) throws Exception {
+ asyncSetLabels();
+ }
+
+ public static void asyncSetLabels() 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 (ExternalVpnGatewaysClient externalVpnGatewaysClient = ExternalVpnGatewaysClient.create()) {
+ SetLabelsExternalVpnGatewayRequest request =
+ SetLabelsExternalVpnGatewayRequest.newBuilder()
+ .setGlobalSetLabelsRequestResource(GlobalSetLabelsRequest.newBuilder().build())
+ .setProject("project-309310695")
+ .setResource("resource-341064690")
+ .build();
+ ApiFuture future =
+ externalVpnGatewaysClient.setLabelsCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_ExternalVpnGateways_SetLabels_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/setlabels/AsyncSetLabelsLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/setlabels/AsyncSetLabelsLRO.java
new file mode 100644
index 000000000000..791f0416084c
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/setlabels/AsyncSetLabelsLRO.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.compute.v1.samples;
+
+// [START compute_v1_generated_ExternalVpnGateways_SetLabels_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.ExternalVpnGatewaysClient;
+import com.google.cloud.compute.v1.GlobalSetLabelsRequest;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.SetLabelsExternalVpnGatewayRequest;
+
+public class AsyncSetLabelsLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncSetLabelsLRO();
+ }
+
+ public static void asyncSetLabelsLRO() 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 (ExternalVpnGatewaysClient externalVpnGatewaysClient = ExternalVpnGatewaysClient.create()) {
+ SetLabelsExternalVpnGatewayRequest request =
+ SetLabelsExternalVpnGatewayRequest.newBuilder()
+ .setGlobalSetLabelsRequestResource(GlobalSetLabelsRequest.newBuilder().build())
+ .setProject("project-309310695")
+ .setResource("resource-341064690")
+ .build();
+ OperationFuture future =
+ externalVpnGatewaysClient.setLabelsOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_ExternalVpnGateways_SetLabels_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/setlabels/SyncSetLabels.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/setlabels/SyncSetLabels.java
new file mode 100644
index 000000000000..bfecbc3e1029
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/setlabels/SyncSetLabels.java
@@ -0,0 +1,48 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_ExternalVpnGateways_SetLabels_sync]
+import com.google.cloud.compute.v1.ExternalVpnGatewaysClient;
+import com.google.cloud.compute.v1.GlobalSetLabelsRequest;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.SetLabelsExternalVpnGatewayRequest;
+
+public class SyncSetLabels {
+
+ public static void main(String[] args) throws Exception {
+ syncSetLabels();
+ }
+
+ public static void syncSetLabels() 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 (ExternalVpnGatewaysClient externalVpnGatewaysClient = ExternalVpnGatewaysClient.create()) {
+ SetLabelsExternalVpnGatewayRequest request =
+ SetLabelsExternalVpnGatewayRequest.newBuilder()
+ .setGlobalSetLabelsRequestResource(GlobalSetLabelsRequest.newBuilder().build())
+ .setProject("project-309310695")
+ .setResource("resource-341064690")
+ .build();
+ Operation response = externalVpnGatewaysClient.setLabelsAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_ExternalVpnGateways_SetLabels_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/setlabels/SyncSetLabelsStringStringGlobalsetlabelsrequest.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/setlabels/SyncSetLabelsStringStringGlobalsetlabelsrequest.java
new file mode 100644
index 000000000000..c9b91b343cb1
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/setlabels/SyncSetLabelsStringStringGlobalsetlabelsrequest.java
@@ -0,0 +1,48 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_ExternalVpnGateways_SetLabels_StringStringGlobalsetlabelsrequest_sync]
+import com.google.cloud.compute.v1.ExternalVpnGatewaysClient;
+import com.google.cloud.compute.v1.GlobalSetLabelsRequest;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncSetLabelsStringStringGlobalsetlabelsrequest {
+
+ public static void main(String[] args) throws Exception {
+ syncSetLabelsStringStringGlobalsetlabelsrequest();
+ }
+
+ public static void syncSetLabelsStringStringGlobalsetlabelsrequest() 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 (ExternalVpnGatewaysClient externalVpnGatewaysClient = ExternalVpnGatewaysClient.create()) {
+ String project = "project-309310695";
+ String resource = "resource-341064690";
+ GlobalSetLabelsRequest globalSetLabelsRequestResource =
+ GlobalSetLabelsRequest.newBuilder().build();
+ Operation response =
+ externalVpnGatewaysClient
+ .setLabelsAsync(project, resource, globalSetLabelsRequestResource)
+ .get();
+ }
+ }
+}
+// [END compute_v1_generated_ExternalVpnGateways_SetLabels_StringStringGlobalsetlabelsrequest_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/testiampermissions/AsyncTestIamPermissions.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/testiampermissions/AsyncTestIamPermissions.java
new file mode 100644
index 000000000000..20e7bb14f6c6
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/testiampermissions/AsyncTestIamPermissions.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.compute.v1.samples;
+
+// [START compute_v1_generated_ExternalVpnGateways_TestIamPermissions_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.ExternalVpnGatewaysClient;
+import com.google.cloud.compute.v1.TestIamPermissionsExternalVpnGatewayRequest;
+import com.google.cloud.compute.v1.TestPermissionsRequest;
+import com.google.cloud.compute.v1.TestPermissionsResponse;
+
+public class AsyncTestIamPermissions {
+
+ public static void main(String[] args) throws Exception {
+ asyncTestIamPermissions();
+ }
+
+ public static void asyncTestIamPermissions() 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 (ExternalVpnGatewaysClient externalVpnGatewaysClient = ExternalVpnGatewaysClient.create()) {
+ TestIamPermissionsExternalVpnGatewayRequest request =
+ TestIamPermissionsExternalVpnGatewayRequest.newBuilder()
+ .setProject("project-309310695")
+ .setResource("resource-341064690")
+ .setTestPermissionsRequestResource(TestPermissionsRequest.newBuilder().build())
+ .build();
+ ApiFuture future =
+ externalVpnGatewaysClient.testIamPermissionsCallable().futureCall(request);
+ // Do something.
+ TestPermissionsResponse response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_ExternalVpnGateways_TestIamPermissions_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/testiampermissions/SyncTestIamPermissions.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/testiampermissions/SyncTestIamPermissions.java
new file mode 100644
index 000000000000..e0ae6709473c
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/testiampermissions/SyncTestIamPermissions.java
@@ -0,0 +1,48 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_ExternalVpnGateways_TestIamPermissions_sync]
+import com.google.cloud.compute.v1.ExternalVpnGatewaysClient;
+import com.google.cloud.compute.v1.TestIamPermissionsExternalVpnGatewayRequest;
+import com.google.cloud.compute.v1.TestPermissionsRequest;
+import com.google.cloud.compute.v1.TestPermissionsResponse;
+
+public class SyncTestIamPermissions {
+
+ public static void main(String[] args) throws Exception {
+ syncTestIamPermissions();
+ }
+
+ public static void syncTestIamPermissions() 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 (ExternalVpnGatewaysClient externalVpnGatewaysClient = ExternalVpnGatewaysClient.create()) {
+ TestIamPermissionsExternalVpnGatewayRequest request =
+ TestIamPermissionsExternalVpnGatewayRequest.newBuilder()
+ .setProject("project-309310695")
+ .setResource("resource-341064690")
+ .setTestPermissionsRequestResource(TestPermissionsRequest.newBuilder().build())
+ .build();
+ TestPermissionsResponse response = externalVpnGatewaysClient.testIamPermissions(request);
+ }
+ }
+}
+// [END compute_v1_generated_ExternalVpnGateways_TestIamPermissions_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/testiampermissions/SyncTestIamPermissionsStringStringTestpermissionsrequest.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/testiampermissions/SyncTestIamPermissionsStringStringTestpermissionsrequest.java
new file mode 100644
index 000000000000..6bec105dd295
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngateways/testiampermissions/SyncTestIamPermissionsStringStringTestpermissionsrequest.java
@@ -0,0 +1,47 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_ExternalVpnGateways_TestIamPermissions_StringStringTestpermissionsrequest_sync]
+import com.google.cloud.compute.v1.ExternalVpnGatewaysClient;
+import com.google.cloud.compute.v1.TestPermissionsRequest;
+import com.google.cloud.compute.v1.TestPermissionsResponse;
+
+public class SyncTestIamPermissionsStringStringTestpermissionsrequest {
+
+ public static void main(String[] args) throws Exception {
+ syncTestIamPermissionsStringStringTestpermissionsrequest();
+ }
+
+ public static void syncTestIamPermissionsStringStringTestpermissionsrequest() 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 (ExternalVpnGatewaysClient externalVpnGatewaysClient = ExternalVpnGatewaysClient.create()) {
+ String project = "project-309310695";
+ String resource = "resource-341064690";
+ TestPermissionsRequest testPermissionsRequestResource =
+ TestPermissionsRequest.newBuilder().build();
+ TestPermissionsResponse response =
+ externalVpnGatewaysClient.testIamPermissions(
+ project, resource, testPermissionsRequestResource);
+ }
+ }
+}
+// [END compute_v1_generated_ExternalVpnGateways_TestIamPermissions_StringStringTestpermissionsrequest_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngatewayssettings/get/SyncGet.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngatewayssettings/get/SyncGet.java
new file mode 100644
index 000000000000..0d2041e9cfdb
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/externalvpngatewayssettings/get/SyncGet.java
@@ -0,0 +1,50 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_ExternalVpnGatewaysSettings_Get_sync]
+import com.google.cloud.compute.v1.ExternalVpnGatewaysSettings;
+import java.time.Duration;
+
+public class SyncGet {
+
+ public static void main(String[] args) throws Exception {
+ syncGet();
+ }
+
+ public static void syncGet() 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
+ ExternalVpnGatewaysSettings.Builder externalVpnGatewaysSettingsBuilder =
+ ExternalVpnGatewaysSettings.newBuilder();
+ externalVpnGatewaysSettingsBuilder
+ .getSettings()
+ .setRetrySettings(
+ externalVpnGatewaysSettingsBuilder
+ .getSettings()
+ .getRetrySettings()
+ .toBuilder()
+ .setTotalTimeout(Duration.ofSeconds(30))
+ .build());
+ ExternalVpnGatewaysSettings externalVpnGatewaysSettings =
+ externalVpnGatewaysSettingsBuilder.build();
+ }
+}
+// [END compute_v1_generated_ExternalVpnGatewaysSettings_Get_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/addassociation/AsyncAddAssociation.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/addassociation/AsyncAddAssociation.java
new file mode 100644
index 000000000000..f05b35e9c578
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/addassociation/AsyncAddAssociation.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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_AddAssociation_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.AddAssociationFirewallPolicyRequest;
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.FirewallPolicyAssociation;
+import com.google.longrunning.Operation;
+
+public class AsyncAddAssociation {
+
+ public static void main(String[] args) throws Exception {
+ asyncAddAssociation();
+ }
+
+ public static void asyncAddAssociation() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ AddAssociationFirewallPolicyRequest request =
+ AddAssociationFirewallPolicyRequest.newBuilder()
+ .setFirewallPolicy("firewallPolicy1819692626")
+ .setFirewallPolicyAssociationResource(FirewallPolicyAssociation.newBuilder().build())
+ .setReplaceExistingAssociation(true)
+ .setRequestId("requestId693933066")
+ .build();
+ ApiFuture future =
+ firewallPoliciesClient.addAssociationCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_AddAssociation_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/addassociation/AsyncAddAssociationLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/addassociation/AsyncAddAssociationLRO.java
new file mode 100644
index 000000000000..a170c4446f4a
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/addassociation/AsyncAddAssociationLRO.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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_AddAssociation_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.AddAssociationFirewallPolicyRequest;
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.FirewallPolicyAssociation;
+import com.google.cloud.compute.v1.Operation;
+
+public class AsyncAddAssociationLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncAddAssociationLRO();
+ }
+
+ public static void asyncAddAssociationLRO() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ AddAssociationFirewallPolicyRequest request =
+ AddAssociationFirewallPolicyRequest.newBuilder()
+ .setFirewallPolicy("firewallPolicy1819692626")
+ .setFirewallPolicyAssociationResource(FirewallPolicyAssociation.newBuilder().build())
+ .setReplaceExistingAssociation(true)
+ .setRequestId("requestId693933066")
+ .build();
+ OperationFuture future =
+ firewallPoliciesClient.addAssociationOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_AddAssociation_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/addassociation/SyncAddAssociation.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/addassociation/SyncAddAssociation.java
new file mode 100644
index 000000000000..8716bfb24483
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/addassociation/SyncAddAssociation.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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_AddAssociation_sync]
+import com.google.cloud.compute.v1.AddAssociationFirewallPolicyRequest;
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.FirewallPolicyAssociation;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncAddAssociation {
+
+ public static void main(String[] args) throws Exception {
+ syncAddAssociation();
+ }
+
+ public static void syncAddAssociation() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ AddAssociationFirewallPolicyRequest request =
+ AddAssociationFirewallPolicyRequest.newBuilder()
+ .setFirewallPolicy("firewallPolicy1819692626")
+ .setFirewallPolicyAssociationResource(FirewallPolicyAssociation.newBuilder().build())
+ .setReplaceExistingAssociation(true)
+ .setRequestId("requestId693933066")
+ .build();
+ Operation response = firewallPoliciesClient.addAssociationAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_AddAssociation_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/addassociation/SyncAddAssociationStringFirewallpolicyassociation.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/addassociation/SyncAddAssociationStringFirewallpolicyassociation.java
new file mode 100644
index 000000000000..a759baa20435
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/addassociation/SyncAddAssociationStringFirewallpolicyassociation.java
@@ -0,0 +1,47 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_AddAssociation_StringFirewallpolicyassociation_sync]
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.FirewallPolicyAssociation;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncAddAssociationStringFirewallpolicyassociation {
+
+ public static void main(String[] args) throws Exception {
+ syncAddAssociationStringFirewallpolicyassociation();
+ }
+
+ public static void syncAddAssociationStringFirewallpolicyassociation() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ String firewallPolicy = "firewallPolicy1819692626";
+ FirewallPolicyAssociation firewallPolicyAssociationResource =
+ FirewallPolicyAssociation.newBuilder().build();
+ Operation response =
+ firewallPoliciesClient
+ .addAssociationAsync(firewallPolicy, firewallPolicyAssociationResource)
+ .get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_AddAssociation_StringFirewallpolicyassociation_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/addrule/AsyncAddRule.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/addrule/AsyncAddRule.java
new file mode 100644
index 000000000000..b8992a1656d9
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/addrule/AsyncAddRule.java
@@ -0,0 +1,51 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_AddRule_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.AddRuleFirewallPolicyRequest;
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.FirewallPolicyRule;
+import com.google.longrunning.Operation;
+
+public class AsyncAddRule {
+
+ public static void main(String[] args) throws Exception {
+ asyncAddRule();
+ }
+
+ public static void asyncAddRule() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ AddRuleFirewallPolicyRequest request =
+ AddRuleFirewallPolicyRequest.newBuilder()
+ .setFirewallPolicy("firewallPolicy1819692626")
+ .setFirewallPolicyRuleResource(FirewallPolicyRule.newBuilder().build())
+ .setRequestId("requestId693933066")
+ .build();
+ ApiFuture future = firewallPoliciesClient.addRuleCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_AddRule_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/addrule/AsyncAddRuleLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/addrule/AsyncAddRuleLRO.java
new file mode 100644
index 000000000000..91d249a8daa9
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/addrule/AsyncAddRuleLRO.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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_AddRule_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.AddRuleFirewallPolicyRequest;
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.FirewallPolicyRule;
+import com.google.cloud.compute.v1.Operation;
+
+public class AsyncAddRuleLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncAddRuleLRO();
+ }
+
+ public static void asyncAddRuleLRO() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ AddRuleFirewallPolicyRequest request =
+ AddRuleFirewallPolicyRequest.newBuilder()
+ .setFirewallPolicy("firewallPolicy1819692626")
+ .setFirewallPolicyRuleResource(FirewallPolicyRule.newBuilder().build())
+ .setRequestId("requestId693933066")
+ .build();
+ OperationFuture future =
+ firewallPoliciesClient.addRuleOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_AddRule_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/addrule/SyncAddRule.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/addrule/SyncAddRule.java
new file mode 100644
index 000000000000..4e7659de05b6
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/addrule/SyncAddRule.java
@@ -0,0 +1,48 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_AddRule_sync]
+import com.google.cloud.compute.v1.AddRuleFirewallPolicyRequest;
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.FirewallPolicyRule;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncAddRule {
+
+ public static void main(String[] args) throws Exception {
+ syncAddRule();
+ }
+
+ public static void syncAddRule() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ AddRuleFirewallPolicyRequest request =
+ AddRuleFirewallPolicyRequest.newBuilder()
+ .setFirewallPolicy("firewallPolicy1819692626")
+ .setFirewallPolicyRuleResource(FirewallPolicyRule.newBuilder().build())
+ .setRequestId("requestId693933066")
+ .build();
+ Operation response = firewallPoliciesClient.addRuleAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_AddRule_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/addrule/SyncAddRuleStringFirewallpolicyrule.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/addrule/SyncAddRuleStringFirewallpolicyrule.java
new file mode 100644
index 000000000000..0b09be4a3445
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/addrule/SyncAddRuleStringFirewallpolicyrule.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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_AddRule_StringFirewallpolicyrule_sync]
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.FirewallPolicyRule;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncAddRuleStringFirewallpolicyrule {
+
+ public static void main(String[] args) throws Exception {
+ syncAddRuleStringFirewallpolicyrule();
+ }
+
+ public static void syncAddRuleStringFirewallpolicyrule() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ String firewallPolicy = "firewallPolicy1819692626";
+ FirewallPolicyRule firewallPolicyRuleResource = FirewallPolicyRule.newBuilder().build();
+ Operation response =
+ firewallPoliciesClient.addRuleAsync(firewallPolicy, firewallPolicyRuleResource).get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_AddRule_StringFirewallpolicyrule_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/clonerules/AsyncCloneRules.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/clonerules/AsyncCloneRules.java
new file mode 100644
index 000000000000..ed43a500b5cd
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/clonerules/AsyncCloneRules.java
@@ -0,0 +1,50 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_CloneRules_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.CloneRulesFirewallPolicyRequest;
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.longrunning.Operation;
+
+public class AsyncCloneRules {
+
+ public static void main(String[] args) throws Exception {
+ asyncCloneRules();
+ }
+
+ public static void asyncCloneRules() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ CloneRulesFirewallPolicyRequest request =
+ CloneRulesFirewallPolicyRequest.newBuilder()
+ .setFirewallPolicy("firewallPolicy1819692626")
+ .setRequestId("requestId693933066")
+ .setSourceFirewallPolicy("sourceFirewallPolicy-593774771")
+ .build();
+ ApiFuture future = firewallPoliciesClient.cloneRulesCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_CloneRules_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/clonerules/AsyncCloneRulesLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/clonerules/AsyncCloneRulesLRO.java
new file mode 100644
index 000000000000..d329ae37e808
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/clonerules/AsyncCloneRulesLRO.java
@@ -0,0 +1,51 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_CloneRules_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.CloneRulesFirewallPolicyRequest;
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class AsyncCloneRulesLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncCloneRulesLRO();
+ }
+
+ public static void asyncCloneRulesLRO() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ CloneRulesFirewallPolicyRequest request =
+ CloneRulesFirewallPolicyRequest.newBuilder()
+ .setFirewallPolicy("firewallPolicy1819692626")
+ .setRequestId("requestId693933066")
+ .setSourceFirewallPolicy("sourceFirewallPolicy-593774771")
+ .build();
+ OperationFuture future =
+ firewallPoliciesClient.cloneRulesOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_CloneRules_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/clonerules/SyncCloneRules.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/clonerules/SyncCloneRules.java
new file mode 100644
index 000000000000..0cb469977a03
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/clonerules/SyncCloneRules.java
@@ -0,0 +1,47 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_CloneRules_sync]
+import com.google.cloud.compute.v1.CloneRulesFirewallPolicyRequest;
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncCloneRules {
+
+ public static void main(String[] args) throws Exception {
+ syncCloneRules();
+ }
+
+ public static void syncCloneRules() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ CloneRulesFirewallPolicyRequest request =
+ CloneRulesFirewallPolicyRequest.newBuilder()
+ .setFirewallPolicy("firewallPolicy1819692626")
+ .setRequestId("requestId693933066")
+ .setSourceFirewallPolicy("sourceFirewallPolicy-593774771")
+ .build();
+ Operation response = firewallPoliciesClient.cloneRulesAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_CloneRules_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/clonerules/SyncCloneRulesString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/clonerules/SyncCloneRulesString.java
new file mode 100644
index 000000000000..353bc84d1115
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/clonerules/SyncCloneRulesString.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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_CloneRules_String_sync]
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncCloneRulesString {
+
+ public static void main(String[] args) throws Exception {
+ syncCloneRulesString();
+ }
+
+ public static void syncCloneRulesString() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ String firewallPolicy = "firewallPolicy1819692626";
+ Operation response = firewallPoliciesClient.cloneRulesAsync(firewallPolicy).get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_CloneRules_String_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/create/SyncCreateSetCredentialsProvider.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/create/SyncCreateSetCredentialsProvider.java
new file mode 100644
index 000000000000..7922adb3c9a9
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/create/SyncCreateSetCredentialsProvider.java
@@ -0,0 +1,45 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_Create_SetCredentialsProvider_sync]
+import com.google.api.gax.core.FixedCredentialsProvider;
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.FirewallPoliciesSettings;
+import com.google.cloud.compute.v1.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
+ FirewallPoliciesSettings firewallPoliciesSettings =
+ FirewallPoliciesSettings.newBuilder()
+ .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ .build();
+ FirewallPoliciesClient firewallPoliciesClient =
+ FirewallPoliciesClient.create(firewallPoliciesSettings);
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_Create_SetCredentialsProvider_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/create/SyncCreateSetEndpoint.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/create/SyncCreateSetEndpoint.java
new file mode 100644
index 000000000000..edd894e8a049
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/create/SyncCreateSetEndpoint.java
@@ -0,0 +1,42 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_Create_SetEndpoint_sync]
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.FirewallPoliciesSettings;
+import com.google.cloud.compute.v1.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
+ FirewallPoliciesSettings firewallPoliciesSettings =
+ FirewallPoliciesSettings.newBuilder().setEndpoint(myEndpoint).build();
+ FirewallPoliciesClient firewallPoliciesClient =
+ FirewallPoliciesClient.create(firewallPoliciesSettings);
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_Create_SetEndpoint_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/delete/AsyncDelete.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/delete/AsyncDelete.java
new file mode 100644
index 000000000000..4f8bcaef8105
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/delete/AsyncDelete.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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_Delete_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.DeleteFirewallPolicyRequest;
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.longrunning.Operation;
+
+public class AsyncDelete {
+
+ public static void main(String[] args) throws Exception {
+ asyncDelete();
+ }
+
+ public static void asyncDelete() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ DeleteFirewallPolicyRequest request =
+ DeleteFirewallPolicyRequest.newBuilder()
+ .setFirewallPolicy("firewallPolicy1819692626")
+ .setRequestId("requestId693933066")
+ .build();
+ ApiFuture future = firewallPoliciesClient.deleteCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_Delete_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/delete/AsyncDeleteLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/delete/AsyncDeleteLRO.java
new file mode 100644
index 000000000000..d38d8f769792
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/delete/AsyncDeleteLRO.java
@@ -0,0 +1,50 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_Delete_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.DeleteFirewallPolicyRequest;
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class AsyncDeleteLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncDeleteLRO();
+ }
+
+ public static void asyncDeleteLRO() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ DeleteFirewallPolicyRequest request =
+ DeleteFirewallPolicyRequest.newBuilder()
+ .setFirewallPolicy("firewallPolicy1819692626")
+ .setRequestId("requestId693933066")
+ .build();
+ OperationFuture future =
+ firewallPoliciesClient.deleteOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_Delete_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/delete/SyncDelete.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/delete/SyncDelete.java
new file mode 100644
index 000000000000..68e1aaf18b86
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/delete/SyncDelete.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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_Delete_sync]
+import com.google.cloud.compute.v1.DeleteFirewallPolicyRequest;
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncDelete {
+
+ public static void main(String[] args) throws Exception {
+ syncDelete();
+ }
+
+ public static void syncDelete() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ DeleteFirewallPolicyRequest request =
+ DeleteFirewallPolicyRequest.newBuilder()
+ .setFirewallPolicy("firewallPolicy1819692626")
+ .setRequestId("requestId693933066")
+ .build();
+ Operation response = firewallPoliciesClient.deleteAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_Delete_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/delete/SyncDeleteString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/delete/SyncDeleteString.java
new file mode 100644
index 000000000000..2f859a71aa02
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/delete/SyncDeleteString.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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_Delete_String_sync]
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncDeleteString {
+
+ public static void main(String[] args) throws Exception {
+ syncDeleteString();
+ }
+
+ public static void syncDeleteString() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ String firewallPolicy = "firewallPolicy1819692626";
+ Operation response = firewallPoliciesClient.deleteAsync(firewallPolicy).get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_Delete_String_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/get/AsyncGet.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/get/AsyncGet.java
new file mode 100644
index 000000000000..96e17470c81c
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/get/AsyncGet.java
@@ -0,0 +1,48 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_Get_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.FirewallPolicy;
+import com.google.cloud.compute.v1.GetFirewallPolicyRequest;
+
+public class AsyncGet {
+
+ public static void main(String[] args) throws Exception {
+ asyncGet();
+ }
+
+ public static void asyncGet() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ GetFirewallPolicyRequest request =
+ GetFirewallPolicyRequest.newBuilder()
+ .setFirewallPolicy("firewallPolicy1819692626")
+ .build();
+ ApiFuture future = firewallPoliciesClient.getCallable().futureCall(request);
+ // Do something.
+ FirewallPolicy response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_Get_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/get/SyncGet.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/get/SyncGet.java
new file mode 100644
index 000000000000..f508dac9688b
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/get/SyncGet.java
@@ -0,0 +1,45 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_Get_sync]
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.FirewallPolicy;
+import com.google.cloud.compute.v1.GetFirewallPolicyRequest;
+
+public class SyncGet {
+
+ public static void main(String[] args) throws Exception {
+ syncGet();
+ }
+
+ public static void syncGet() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ GetFirewallPolicyRequest request =
+ GetFirewallPolicyRequest.newBuilder()
+ .setFirewallPolicy("firewallPolicy1819692626")
+ .build();
+ FirewallPolicy response = firewallPoliciesClient.get(request);
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_Get_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/get/SyncGetString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/get/SyncGetString.java
new file mode 100644
index 000000000000..fbf8b60cc4a3
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/get/SyncGetString.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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_Get_String_sync]
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.FirewallPolicy;
+
+public class SyncGetString {
+
+ public static void main(String[] args) throws Exception {
+ syncGetString();
+ }
+
+ public static void syncGetString() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ String firewallPolicy = "firewallPolicy1819692626";
+ FirewallPolicy response = firewallPoliciesClient.get(firewallPolicy);
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_Get_String_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/getassociation/AsyncGetAssociation.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/getassociation/AsyncGetAssociation.java
new file mode 100644
index 000000000000..7f01e0fed042
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/getassociation/AsyncGetAssociation.java
@@ -0,0 +1,50 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_GetAssociation_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.FirewallPolicyAssociation;
+import com.google.cloud.compute.v1.GetAssociationFirewallPolicyRequest;
+
+public class AsyncGetAssociation {
+
+ public static void main(String[] args) throws Exception {
+ asyncGetAssociation();
+ }
+
+ public static void asyncGetAssociation() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ GetAssociationFirewallPolicyRequest request =
+ GetAssociationFirewallPolicyRequest.newBuilder()
+ .setFirewallPolicy("firewallPolicy1819692626")
+ .setName("name3373707")
+ .build();
+ ApiFuture future =
+ firewallPoliciesClient.getAssociationCallable().futureCall(request);
+ // Do something.
+ FirewallPolicyAssociation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_GetAssociation_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/getassociation/SyncGetAssociation.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/getassociation/SyncGetAssociation.java
new file mode 100644
index 000000000000..60a9fea63b65
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/getassociation/SyncGetAssociation.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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_GetAssociation_sync]
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.FirewallPolicyAssociation;
+import com.google.cloud.compute.v1.GetAssociationFirewallPolicyRequest;
+
+public class SyncGetAssociation {
+
+ public static void main(String[] args) throws Exception {
+ syncGetAssociation();
+ }
+
+ public static void syncGetAssociation() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ GetAssociationFirewallPolicyRequest request =
+ GetAssociationFirewallPolicyRequest.newBuilder()
+ .setFirewallPolicy("firewallPolicy1819692626")
+ .setName("name3373707")
+ .build();
+ FirewallPolicyAssociation response = firewallPoliciesClient.getAssociation(request);
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_GetAssociation_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/getassociation/SyncGetAssociationString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/getassociation/SyncGetAssociationString.java
new file mode 100644
index 000000000000..f5dca6d9cc34
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/getassociation/SyncGetAssociationString.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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_GetAssociation_String_sync]
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.FirewallPolicyAssociation;
+
+public class SyncGetAssociationString {
+
+ public static void main(String[] args) throws Exception {
+ syncGetAssociationString();
+ }
+
+ public static void syncGetAssociationString() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ String firewallPolicy = "firewallPolicy1819692626";
+ FirewallPolicyAssociation response = firewallPoliciesClient.getAssociation(firewallPolicy);
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_GetAssociation_String_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/getiampolicy/AsyncGetIamPolicy.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/getiampolicy/AsyncGetIamPolicy.java
new file mode 100644
index 000000000000..6d45c3d2bfde
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/getiampolicy/AsyncGetIamPolicy.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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_GetIamPolicy_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.GetIamPolicyFirewallPolicyRequest;
+import com.google.cloud.compute.v1.Policy;
+
+public class AsyncGetIamPolicy {
+
+ public static void main(String[] args) throws Exception {
+ asyncGetIamPolicy();
+ }
+
+ public static void asyncGetIamPolicy() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ GetIamPolicyFirewallPolicyRequest request =
+ GetIamPolicyFirewallPolicyRequest.newBuilder()
+ .setOptionsRequestedPolicyVersion(-574521795)
+ .setResource("resource-341064690")
+ .build();
+ ApiFuture future = firewallPoliciesClient.getIamPolicyCallable().futureCall(request);
+ // Do something.
+ Policy response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_GetIamPolicy_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/getiampolicy/SyncGetIamPolicy.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/getiampolicy/SyncGetIamPolicy.java
new file mode 100644
index 000000000000..d9e2b67a17d7
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/getiampolicy/SyncGetIamPolicy.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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_GetIamPolicy_sync]
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.GetIamPolicyFirewallPolicyRequest;
+import com.google.cloud.compute.v1.Policy;
+
+public class SyncGetIamPolicy {
+
+ public static void main(String[] args) throws Exception {
+ syncGetIamPolicy();
+ }
+
+ public static void syncGetIamPolicy() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ GetIamPolicyFirewallPolicyRequest request =
+ GetIamPolicyFirewallPolicyRequest.newBuilder()
+ .setOptionsRequestedPolicyVersion(-574521795)
+ .setResource("resource-341064690")
+ .build();
+ Policy response = firewallPoliciesClient.getIamPolicy(request);
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_GetIamPolicy_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/getiampolicy/SyncGetIamPolicyString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/getiampolicy/SyncGetIamPolicyString.java
new file mode 100644
index 000000000000..8b990b4a7d91
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/getiampolicy/SyncGetIamPolicyString.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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_GetIamPolicy_String_sync]
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.Policy;
+
+public class SyncGetIamPolicyString {
+
+ public static void main(String[] args) throws Exception {
+ syncGetIamPolicyString();
+ }
+
+ public static void syncGetIamPolicyString() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ String resource = "resource-341064690";
+ Policy response = firewallPoliciesClient.getIamPolicy(resource);
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_GetIamPolicy_String_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/getrule/AsyncGetRule.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/getrule/AsyncGetRule.java
new file mode 100644
index 000000000000..23ee865793fc
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/getrule/AsyncGetRule.java
@@ -0,0 +1,50 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_GetRule_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.FirewallPolicyRule;
+import com.google.cloud.compute.v1.GetRuleFirewallPolicyRequest;
+
+public class AsyncGetRule {
+
+ public static void main(String[] args) throws Exception {
+ asyncGetRule();
+ }
+
+ public static void asyncGetRule() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ GetRuleFirewallPolicyRequest request =
+ GetRuleFirewallPolicyRequest.newBuilder()
+ .setFirewallPolicy("firewallPolicy1819692626")
+ .setPriority(-1165461084)
+ .build();
+ ApiFuture future =
+ firewallPoliciesClient.getRuleCallable().futureCall(request);
+ // Do something.
+ FirewallPolicyRule response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_GetRule_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/getrule/SyncGetRule.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/getrule/SyncGetRule.java
new file mode 100644
index 000000000000..29c535050f10
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/getrule/SyncGetRule.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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_GetRule_sync]
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.FirewallPolicyRule;
+import com.google.cloud.compute.v1.GetRuleFirewallPolicyRequest;
+
+public class SyncGetRule {
+
+ public static void main(String[] args) throws Exception {
+ syncGetRule();
+ }
+
+ public static void syncGetRule() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ GetRuleFirewallPolicyRequest request =
+ GetRuleFirewallPolicyRequest.newBuilder()
+ .setFirewallPolicy("firewallPolicy1819692626")
+ .setPriority(-1165461084)
+ .build();
+ FirewallPolicyRule response = firewallPoliciesClient.getRule(request);
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_GetRule_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/getrule/SyncGetRuleString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/getrule/SyncGetRuleString.java
new file mode 100644
index 000000000000..59d6261b1ac5
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/getrule/SyncGetRuleString.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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_GetRule_String_sync]
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.FirewallPolicyRule;
+
+public class SyncGetRuleString {
+
+ public static void main(String[] args) throws Exception {
+ syncGetRuleString();
+ }
+
+ public static void syncGetRuleString() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ String firewallPolicy = "firewallPolicy1819692626";
+ FirewallPolicyRule response = firewallPoliciesClient.getRule(firewallPolicy);
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_GetRule_String_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/insert/AsyncInsert.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/insert/AsyncInsert.java
new file mode 100644
index 000000000000..d879b2038a8e
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/insert/AsyncInsert.java
@@ -0,0 +1,51 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_Insert_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.FirewallPolicy;
+import com.google.cloud.compute.v1.InsertFirewallPolicyRequest;
+import com.google.longrunning.Operation;
+
+public class AsyncInsert {
+
+ public static void main(String[] args) throws Exception {
+ asyncInsert();
+ }
+
+ public static void asyncInsert() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ InsertFirewallPolicyRequest request =
+ InsertFirewallPolicyRequest.newBuilder()
+ .setFirewallPolicyResource(FirewallPolicy.newBuilder().build())
+ .setParentId("parentId1175162725")
+ .setRequestId("requestId693933066")
+ .build();
+ ApiFuture future = firewallPoliciesClient.insertCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_Insert_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/insert/AsyncInsertLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/insert/AsyncInsertLRO.java
new file mode 100644
index 000000000000..654c71f31386
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/insert/AsyncInsertLRO.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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_Insert_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.FirewallPolicy;
+import com.google.cloud.compute.v1.InsertFirewallPolicyRequest;
+import com.google.cloud.compute.v1.Operation;
+
+public class AsyncInsertLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncInsertLRO();
+ }
+
+ public static void asyncInsertLRO() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ InsertFirewallPolicyRequest request =
+ InsertFirewallPolicyRequest.newBuilder()
+ .setFirewallPolicyResource(FirewallPolicy.newBuilder().build())
+ .setParentId("parentId1175162725")
+ .setRequestId("requestId693933066")
+ .build();
+ OperationFuture future =
+ firewallPoliciesClient.insertOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_Insert_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/insert/SyncInsert.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/insert/SyncInsert.java
new file mode 100644
index 000000000000..bc0888a2ed95
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/insert/SyncInsert.java
@@ -0,0 +1,48 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_Insert_sync]
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.FirewallPolicy;
+import com.google.cloud.compute.v1.InsertFirewallPolicyRequest;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncInsert {
+
+ public static void main(String[] args) throws Exception {
+ syncInsert();
+ }
+
+ public static void syncInsert() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ InsertFirewallPolicyRequest request =
+ InsertFirewallPolicyRequest.newBuilder()
+ .setFirewallPolicyResource(FirewallPolicy.newBuilder().build())
+ .setParentId("parentId1175162725")
+ .setRequestId("requestId693933066")
+ .build();
+ Operation response = firewallPoliciesClient.insertAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_Insert_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/insert/SyncInsertStringFirewallpolicy.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/insert/SyncInsertStringFirewallpolicy.java
new file mode 100644
index 000000000000..a2f1a59b100a
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/insert/SyncInsertStringFirewallpolicy.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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_Insert_StringFirewallpolicy_sync]
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.FirewallPolicy;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncInsertStringFirewallpolicy {
+
+ public static void main(String[] args) throws Exception {
+ syncInsertStringFirewallpolicy();
+ }
+
+ public static void syncInsertStringFirewallpolicy() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ String parentId = "parentId1175162725";
+ FirewallPolicy firewallPolicyResource = FirewallPolicy.newBuilder().build();
+ Operation response =
+ firewallPoliciesClient.insertAsync(parentId, firewallPolicyResource).get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_Insert_StringFirewallpolicy_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/list/AsyncList.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/list/AsyncList.java
new file mode 100644
index 000000000000..1f17d6072255
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/list/AsyncList.java
@@ -0,0 +1,56 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_List_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.FirewallPolicy;
+import com.google.cloud.compute.v1.ListFirewallPoliciesRequest;
+
+public class AsyncList {
+
+ public static void main(String[] args) throws Exception {
+ asyncList();
+ }
+
+ public static void asyncList() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ ListFirewallPoliciesRequest request =
+ ListFirewallPoliciesRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setParentId("parentId1175162725")
+ .setReturnPartialSuccess(true)
+ .build();
+ ApiFuture future =
+ firewallPoliciesClient.listPagedCallable().futureCall(request);
+ // Do something.
+ for (FirewallPolicy element : future.get().iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_List_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/list/AsyncListPaged.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/list/AsyncListPaged.java
new file mode 100644
index 000000000000..0241dc1f0a94
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/list/AsyncListPaged.java
@@ -0,0 +1,63 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_List_Paged_async]
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.FirewallPolicy;
+import com.google.cloud.compute.v1.FirewallPolicyList;
+import com.google.cloud.compute.v1.ListFirewallPoliciesRequest;
+import com.google.common.base.Strings;
+
+public class AsyncListPaged {
+
+ public static void main(String[] args) throws Exception {
+ asyncListPaged();
+ }
+
+ public static void asyncListPaged() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ ListFirewallPoliciesRequest request =
+ ListFirewallPoliciesRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setParentId("parentId1175162725")
+ .setReturnPartialSuccess(true)
+ .build();
+ while (true) {
+ FirewallPolicyList response = firewallPoliciesClient.listCallable().call(request);
+ for (FirewallPolicy element : response.getItemsList()) {
+ // doThingsWith(element);
+ }
+ String nextPageToken = response.getNextPageToken();
+ if (!Strings.isNullOrEmpty(nextPageToken)) {
+ request = request.toBuilder().setPageToken(nextPageToken).build();
+ } else {
+ break;
+ }
+ }
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_List_Paged_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/list/SyncList.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/list/SyncList.java
new file mode 100644
index 000000000000..883c91f9d5a1
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/list/SyncList.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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_List_sync]
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.FirewallPolicy;
+import com.google.cloud.compute.v1.ListFirewallPoliciesRequest;
+
+public class SyncList {
+
+ public static void main(String[] args) throws Exception {
+ syncList();
+ }
+
+ public static void syncList() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ ListFirewallPoliciesRequest request =
+ ListFirewallPoliciesRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setParentId("parentId1175162725")
+ .setReturnPartialSuccess(true)
+ .build();
+ for (FirewallPolicy element : firewallPoliciesClient.list(request).iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_List_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/list/SyncListNoargs.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/list/SyncListNoargs.java
new file mode 100644
index 000000000000..66b54dbcb03f
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/list/SyncListNoargs.java
@@ -0,0 +1,42 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_List_Noargs_sync]
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.FirewallPolicy;
+
+public class SyncListNoargs {
+
+ public static void main(String[] args) throws Exception {
+ syncListNoargs();
+ }
+
+ public static void syncListNoargs() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ for (FirewallPolicy element : firewallPoliciesClient.list().iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_List_Noargs_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/listassociations/AsyncListAssociations.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/listassociations/AsyncListAssociations.java
new file mode 100644
index 000000000000..b83cb1b77239
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/listassociations/AsyncListAssociations.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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_ListAssociations_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.FirewallPoliciesListAssociationsResponse;
+import com.google.cloud.compute.v1.ListAssociationsFirewallPolicyRequest;
+
+public class AsyncListAssociations {
+
+ public static void main(String[] args) throws Exception {
+ asyncListAssociations();
+ }
+
+ public static void asyncListAssociations() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ ListAssociationsFirewallPolicyRequest request =
+ ListAssociationsFirewallPolicyRequest.newBuilder()
+ .setTargetResource("targetResource-1933150017")
+ .build();
+ ApiFuture future =
+ firewallPoliciesClient.listAssociationsCallable().futureCall(request);
+ // Do something.
+ FirewallPoliciesListAssociationsResponse response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_ListAssociations_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/listassociations/SyncListAssociations.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/listassociations/SyncListAssociations.java
new file mode 100644
index 000000000000..0669c76d4704
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/listassociations/SyncListAssociations.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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_ListAssociations_sync]
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.FirewallPoliciesListAssociationsResponse;
+import com.google.cloud.compute.v1.ListAssociationsFirewallPolicyRequest;
+
+public class SyncListAssociations {
+
+ public static void main(String[] args) throws Exception {
+ syncListAssociations();
+ }
+
+ public static void syncListAssociations() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ ListAssociationsFirewallPolicyRequest request =
+ ListAssociationsFirewallPolicyRequest.newBuilder()
+ .setTargetResource("targetResource-1933150017")
+ .build();
+ FirewallPoliciesListAssociationsResponse response =
+ firewallPoliciesClient.listAssociations(request);
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_ListAssociations_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/listassociations/SyncListAssociationsNoargs.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/listassociations/SyncListAssociationsNoargs.java
new file mode 100644
index 000000000000..0d72ab29ca61
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/listassociations/SyncListAssociationsNoargs.java
@@ -0,0 +1,40 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_ListAssociations_Noargs_sync]
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.FirewallPoliciesListAssociationsResponse;
+
+public class SyncListAssociationsNoargs {
+
+ public static void main(String[] args) throws Exception {
+ syncListAssociationsNoargs();
+ }
+
+ public static void syncListAssociationsNoargs() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ FirewallPoliciesListAssociationsResponse response = firewallPoliciesClient.listAssociations();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_ListAssociations_Noargs_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/move/AsyncMove.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/move/AsyncMove.java
new file mode 100644
index 000000000000..eae9c29e54b2
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/move/AsyncMove.java
@@ -0,0 +1,50 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_Move_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.MoveFirewallPolicyRequest;
+import com.google.longrunning.Operation;
+
+public class AsyncMove {
+
+ public static void main(String[] args) throws Exception {
+ asyncMove();
+ }
+
+ public static void asyncMove() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ MoveFirewallPolicyRequest request =
+ MoveFirewallPolicyRequest.newBuilder()
+ .setFirewallPolicy("firewallPolicy1819692626")
+ .setParentId("parentId1175162725")
+ .setRequestId("requestId693933066")
+ .build();
+ ApiFuture future = firewallPoliciesClient.moveCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_Move_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/move/AsyncMoveLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/move/AsyncMoveLRO.java
new file mode 100644
index 000000000000..43396c3d89cf
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/move/AsyncMoveLRO.java
@@ -0,0 +1,51 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_Move_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.MoveFirewallPolicyRequest;
+import com.google.cloud.compute.v1.Operation;
+
+public class AsyncMoveLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncMoveLRO();
+ }
+
+ public static void asyncMoveLRO() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ MoveFirewallPolicyRequest request =
+ MoveFirewallPolicyRequest.newBuilder()
+ .setFirewallPolicy("firewallPolicy1819692626")
+ .setParentId("parentId1175162725")
+ .setRequestId("requestId693933066")
+ .build();
+ OperationFuture future =
+ firewallPoliciesClient.moveOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_Move_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/move/SyncMove.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/move/SyncMove.java
new file mode 100644
index 000000000000..4a611b3a82f8
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/move/SyncMove.java
@@ -0,0 +1,47 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_Move_sync]
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.MoveFirewallPolicyRequest;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncMove {
+
+ public static void main(String[] args) throws Exception {
+ syncMove();
+ }
+
+ public static void syncMove() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ MoveFirewallPolicyRequest request =
+ MoveFirewallPolicyRequest.newBuilder()
+ .setFirewallPolicy("firewallPolicy1819692626")
+ .setParentId("parentId1175162725")
+ .setRequestId("requestId693933066")
+ .build();
+ Operation response = firewallPoliciesClient.moveAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_Move_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/move/SyncMoveStringString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/move/SyncMoveStringString.java
new file mode 100644
index 000000000000..3fa0ffd8b145
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/move/SyncMoveStringString.java
@@ -0,0 +1,42 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_Move_StringString_sync]
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncMoveStringString {
+
+ public static void main(String[] args) throws Exception {
+ syncMoveStringString();
+ }
+
+ public static void syncMoveStringString() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ String firewallPolicy = "firewallPolicy1819692626";
+ String parentId = "parentId1175162725";
+ Operation response = firewallPoliciesClient.moveAsync(firewallPolicy, parentId).get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_Move_StringString_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/patch/AsyncPatch.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/patch/AsyncPatch.java
new file mode 100644
index 000000000000..1c5b621afbfa
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/patch/AsyncPatch.java
@@ -0,0 +1,51 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_Patch_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.FirewallPolicy;
+import com.google.cloud.compute.v1.PatchFirewallPolicyRequest;
+import com.google.longrunning.Operation;
+
+public class AsyncPatch {
+
+ public static void main(String[] args) throws Exception {
+ asyncPatch();
+ }
+
+ public static void asyncPatch() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ PatchFirewallPolicyRequest request =
+ PatchFirewallPolicyRequest.newBuilder()
+ .setFirewallPolicy("firewallPolicy1819692626")
+ .setFirewallPolicyResource(FirewallPolicy.newBuilder().build())
+ .setRequestId("requestId693933066")
+ .build();
+ ApiFuture future = firewallPoliciesClient.patchCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_Patch_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/patch/AsyncPatchLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/patch/AsyncPatchLRO.java
new file mode 100644
index 000000000000..f9ad985d29e1
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/patch/AsyncPatchLRO.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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_Patch_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.FirewallPolicy;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.PatchFirewallPolicyRequest;
+
+public class AsyncPatchLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncPatchLRO();
+ }
+
+ public static void asyncPatchLRO() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ PatchFirewallPolicyRequest request =
+ PatchFirewallPolicyRequest.newBuilder()
+ .setFirewallPolicy("firewallPolicy1819692626")
+ .setFirewallPolicyResource(FirewallPolicy.newBuilder().build())
+ .setRequestId("requestId693933066")
+ .build();
+ OperationFuture future =
+ firewallPoliciesClient.patchOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_Patch_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/patch/SyncPatch.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/patch/SyncPatch.java
new file mode 100644
index 000000000000..3d6a443597d0
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/patch/SyncPatch.java
@@ -0,0 +1,48 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_Patch_sync]
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.FirewallPolicy;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.PatchFirewallPolicyRequest;
+
+public class SyncPatch {
+
+ public static void main(String[] args) throws Exception {
+ syncPatch();
+ }
+
+ public static void syncPatch() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ PatchFirewallPolicyRequest request =
+ PatchFirewallPolicyRequest.newBuilder()
+ .setFirewallPolicy("firewallPolicy1819692626")
+ .setFirewallPolicyResource(FirewallPolicy.newBuilder().build())
+ .setRequestId("requestId693933066")
+ .build();
+ Operation response = firewallPoliciesClient.patchAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_Patch_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/patch/SyncPatchStringFirewallpolicy.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/patch/SyncPatchStringFirewallpolicy.java
new file mode 100644
index 000000000000..01cfb364b409
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/patch/SyncPatchStringFirewallpolicy.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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_Patch_StringFirewallpolicy_sync]
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.FirewallPolicy;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncPatchStringFirewallpolicy {
+
+ public static void main(String[] args) throws Exception {
+ syncPatchStringFirewallpolicy();
+ }
+
+ public static void syncPatchStringFirewallpolicy() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ String firewallPolicy = "firewallPolicy1819692626";
+ FirewallPolicy firewallPolicyResource = FirewallPolicy.newBuilder().build();
+ Operation response =
+ firewallPoliciesClient.patchAsync(firewallPolicy, firewallPolicyResource).get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_Patch_StringFirewallpolicy_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/patchrule/AsyncPatchRule.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/patchrule/AsyncPatchRule.java
new file mode 100644
index 000000000000..d617ebad0dd3
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/patchrule/AsyncPatchRule.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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_PatchRule_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.FirewallPolicyRule;
+import com.google.cloud.compute.v1.PatchRuleFirewallPolicyRequest;
+import com.google.longrunning.Operation;
+
+public class AsyncPatchRule {
+
+ public static void main(String[] args) throws Exception {
+ asyncPatchRule();
+ }
+
+ public static void asyncPatchRule() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ PatchRuleFirewallPolicyRequest request =
+ PatchRuleFirewallPolicyRequest.newBuilder()
+ .setFirewallPolicy("firewallPolicy1819692626")
+ .setFirewallPolicyRuleResource(FirewallPolicyRule.newBuilder().build())
+ .setPriority(-1165461084)
+ .setRequestId("requestId693933066")
+ .build();
+ ApiFuture future = firewallPoliciesClient.patchRuleCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_PatchRule_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/patchrule/AsyncPatchRuleLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/patchrule/AsyncPatchRuleLRO.java
new file mode 100644
index 000000000000..bda7770290a5
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/patchrule/AsyncPatchRuleLRO.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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_PatchRule_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.FirewallPolicyRule;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.PatchRuleFirewallPolicyRequest;
+
+public class AsyncPatchRuleLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncPatchRuleLRO();
+ }
+
+ public static void asyncPatchRuleLRO() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ PatchRuleFirewallPolicyRequest request =
+ PatchRuleFirewallPolicyRequest.newBuilder()
+ .setFirewallPolicy("firewallPolicy1819692626")
+ .setFirewallPolicyRuleResource(FirewallPolicyRule.newBuilder().build())
+ .setPriority(-1165461084)
+ .setRequestId("requestId693933066")
+ .build();
+ OperationFuture future =
+ firewallPoliciesClient.patchRuleOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_PatchRule_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/patchrule/SyncPatchRule.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/patchrule/SyncPatchRule.java
new file mode 100644
index 000000000000..2f682b540158
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/patchrule/SyncPatchRule.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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_PatchRule_sync]
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.FirewallPolicyRule;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.PatchRuleFirewallPolicyRequest;
+
+public class SyncPatchRule {
+
+ public static void main(String[] args) throws Exception {
+ syncPatchRule();
+ }
+
+ public static void syncPatchRule() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ PatchRuleFirewallPolicyRequest request =
+ PatchRuleFirewallPolicyRequest.newBuilder()
+ .setFirewallPolicy("firewallPolicy1819692626")
+ .setFirewallPolicyRuleResource(FirewallPolicyRule.newBuilder().build())
+ .setPriority(-1165461084)
+ .setRequestId("requestId693933066")
+ .build();
+ Operation response = firewallPoliciesClient.patchRuleAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_PatchRule_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/patchrule/SyncPatchRuleStringFirewallpolicyrule.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/patchrule/SyncPatchRuleStringFirewallpolicyrule.java
new file mode 100644
index 000000000000..6b78fb7695c8
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/patchrule/SyncPatchRuleStringFirewallpolicyrule.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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_PatchRule_StringFirewallpolicyrule_sync]
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.FirewallPolicyRule;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncPatchRuleStringFirewallpolicyrule {
+
+ public static void main(String[] args) throws Exception {
+ syncPatchRuleStringFirewallpolicyrule();
+ }
+
+ public static void syncPatchRuleStringFirewallpolicyrule() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ String firewallPolicy = "firewallPolicy1819692626";
+ FirewallPolicyRule firewallPolicyRuleResource = FirewallPolicyRule.newBuilder().build();
+ Operation response =
+ firewallPoliciesClient.patchRuleAsync(firewallPolicy, firewallPolicyRuleResource).get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_PatchRule_StringFirewallpolicyrule_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/removeassociation/AsyncRemoveAssociation.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/removeassociation/AsyncRemoveAssociation.java
new file mode 100644
index 000000000000..02d74c5f24b3
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/removeassociation/AsyncRemoveAssociation.java
@@ -0,0 +1,51 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_RemoveAssociation_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.RemoveAssociationFirewallPolicyRequest;
+import com.google.longrunning.Operation;
+
+public class AsyncRemoveAssociation {
+
+ public static void main(String[] args) throws Exception {
+ asyncRemoveAssociation();
+ }
+
+ public static void asyncRemoveAssociation() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ RemoveAssociationFirewallPolicyRequest request =
+ RemoveAssociationFirewallPolicyRequest.newBuilder()
+ .setFirewallPolicy("firewallPolicy1819692626")
+ .setName("name3373707")
+ .setRequestId("requestId693933066")
+ .build();
+ ApiFuture future =
+ firewallPoliciesClient.removeAssociationCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_RemoveAssociation_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/removeassociation/AsyncRemoveAssociationLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/removeassociation/AsyncRemoveAssociationLRO.java
new file mode 100644
index 000000000000..8d5faa843b31
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/removeassociation/AsyncRemoveAssociationLRO.java
@@ -0,0 +1,51 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_RemoveAssociation_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.RemoveAssociationFirewallPolicyRequest;
+
+public class AsyncRemoveAssociationLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncRemoveAssociationLRO();
+ }
+
+ public static void asyncRemoveAssociationLRO() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ RemoveAssociationFirewallPolicyRequest request =
+ RemoveAssociationFirewallPolicyRequest.newBuilder()
+ .setFirewallPolicy("firewallPolicy1819692626")
+ .setName("name3373707")
+ .setRequestId("requestId693933066")
+ .build();
+ OperationFuture future =
+ firewallPoliciesClient.removeAssociationOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_RemoveAssociation_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/removeassociation/SyncRemoveAssociation.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/removeassociation/SyncRemoveAssociation.java
new file mode 100644
index 000000000000..c5e743888eb4
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/removeassociation/SyncRemoveAssociation.java
@@ -0,0 +1,47 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_RemoveAssociation_sync]
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.RemoveAssociationFirewallPolicyRequest;
+
+public class SyncRemoveAssociation {
+
+ public static void main(String[] args) throws Exception {
+ syncRemoveAssociation();
+ }
+
+ public static void syncRemoveAssociation() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ RemoveAssociationFirewallPolicyRequest request =
+ RemoveAssociationFirewallPolicyRequest.newBuilder()
+ .setFirewallPolicy("firewallPolicy1819692626")
+ .setName("name3373707")
+ .setRequestId("requestId693933066")
+ .build();
+ Operation response = firewallPoliciesClient.removeAssociationAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_RemoveAssociation_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/removeassociation/SyncRemoveAssociationString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/removeassociation/SyncRemoveAssociationString.java
new file mode 100644
index 000000000000..378fa2deb268
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/removeassociation/SyncRemoveAssociationString.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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_RemoveAssociation_String_sync]
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncRemoveAssociationString {
+
+ public static void main(String[] args) throws Exception {
+ syncRemoveAssociationString();
+ }
+
+ public static void syncRemoveAssociationString() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ String firewallPolicy = "firewallPolicy1819692626";
+ Operation response = firewallPoliciesClient.removeAssociationAsync(firewallPolicy).get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_RemoveAssociation_String_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/removerule/AsyncRemoveRule.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/removerule/AsyncRemoveRule.java
new file mode 100644
index 000000000000..0264f0cc2d05
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/removerule/AsyncRemoveRule.java
@@ -0,0 +1,50 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_RemoveRule_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.RemoveRuleFirewallPolicyRequest;
+import com.google.longrunning.Operation;
+
+public class AsyncRemoveRule {
+
+ public static void main(String[] args) throws Exception {
+ asyncRemoveRule();
+ }
+
+ public static void asyncRemoveRule() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ RemoveRuleFirewallPolicyRequest request =
+ RemoveRuleFirewallPolicyRequest.newBuilder()
+ .setFirewallPolicy("firewallPolicy1819692626")
+ .setPriority(-1165461084)
+ .setRequestId("requestId693933066")
+ .build();
+ ApiFuture future = firewallPoliciesClient.removeRuleCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_RemoveRule_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/removerule/AsyncRemoveRuleLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/removerule/AsyncRemoveRuleLRO.java
new file mode 100644
index 000000000000..d14795d74999
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/removerule/AsyncRemoveRuleLRO.java
@@ -0,0 +1,51 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_RemoveRule_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.RemoveRuleFirewallPolicyRequest;
+
+public class AsyncRemoveRuleLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncRemoveRuleLRO();
+ }
+
+ public static void asyncRemoveRuleLRO() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ RemoveRuleFirewallPolicyRequest request =
+ RemoveRuleFirewallPolicyRequest.newBuilder()
+ .setFirewallPolicy("firewallPolicy1819692626")
+ .setPriority(-1165461084)
+ .setRequestId("requestId693933066")
+ .build();
+ OperationFuture future =
+ firewallPoliciesClient.removeRuleOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_RemoveRule_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/removerule/SyncRemoveRule.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/removerule/SyncRemoveRule.java
new file mode 100644
index 000000000000..9f90af8b6be3
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/removerule/SyncRemoveRule.java
@@ -0,0 +1,47 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_RemoveRule_sync]
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.RemoveRuleFirewallPolicyRequest;
+
+public class SyncRemoveRule {
+
+ public static void main(String[] args) throws Exception {
+ syncRemoveRule();
+ }
+
+ public static void syncRemoveRule() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ RemoveRuleFirewallPolicyRequest request =
+ RemoveRuleFirewallPolicyRequest.newBuilder()
+ .setFirewallPolicy("firewallPolicy1819692626")
+ .setPriority(-1165461084)
+ .setRequestId("requestId693933066")
+ .build();
+ Operation response = firewallPoliciesClient.removeRuleAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_RemoveRule_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/removerule/SyncRemoveRuleString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/removerule/SyncRemoveRuleString.java
new file mode 100644
index 000000000000..a40f91015a2f
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/removerule/SyncRemoveRuleString.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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_RemoveRule_String_sync]
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncRemoveRuleString {
+
+ public static void main(String[] args) throws Exception {
+ syncRemoveRuleString();
+ }
+
+ public static void syncRemoveRuleString() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ String firewallPolicy = "firewallPolicy1819692626";
+ Operation response = firewallPoliciesClient.removeRuleAsync(firewallPolicy).get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_RemoveRule_String_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/setiampolicy/AsyncSetIamPolicy.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/setiampolicy/AsyncSetIamPolicy.java
new file mode 100644
index 000000000000..e908c6675efe
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/setiampolicy/AsyncSetIamPolicy.java
@@ -0,0 +1,51 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_SetIamPolicy_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest;
+import com.google.cloud.compute.v1.Policy;
+import com.google.cloud.compute.v1.SetIamPolicyFirewallPolicyRequest;
+
+public class AsyncSetIamPolicy {
+
+ public static void main(String[] args) throws Exception {
+ asyncSetIamPolicy();
+ }
+
+ public static void asyncSetIamPolicy() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ SetIamPolicyFirewallPolicyRequest request =
+ SetIamPolicyFirewallPolicyRequest.newBuilder()
+ .setGlobalOrganizationSetPolicyRequestResource(
+ GlobalOrganizationSetPolicyRequest.newBuilder().build())
+ .setResource("resource-341064690")
+ .build();
+ ApiFuture future = firewallPoliciesClient.setIamPolicyCallable().futureCall(request);
+ // Do something.
+ Policy response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_SetIamPolicy_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/setiampolicy/SyncSetIamPolicy.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/setiampolicy/SyncSetIamPolicy.java
new file mode 100644
index 000000000000..825c453df8c3
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/setiampolicy/SyncSetIamPolicy.java
@@ -0,0 +1,48 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_SetIamPolicy_sync]
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest;
+import com.google.cloud.compute.v1.Policy;
+import com.google.cloud.compute.v1.SetIamPolicyFirewallPolicyRequest;
+
+public class SyncSetIamPolicy {
+
+ public static void main(String[] args) throws Exception {
+ syncSetIamPolicy();
+ }
+
+ public static void syncSetIamPolicy() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ SetIamPolicyFirewallPolicyRequest request =
+ SetIamPolicyFirewallPolicyRequest.newBuilder()
+ .setGlobalOrganizationSetPolicyRequestResource(
+ GlobalOrganizationSetPolicyRequest.newBuilder().build())
+ .setResource("resource-341064690")
+ .build();
+ Policy response = firewallPoliciesClient.setIamPolicy(request);
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_SetIamPolicy_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/setiampolicy/SyncSetIamPolicyStringGlobalorganizationsetpolicyrequest.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/setiampolicy/SyncSetIamPolicyStringGlobalorganizationsetpolicyrequest.java
new file mode 100644
index 000000000000..de0efcae03b8
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/setiampolicy/SyncSetIamPolicyStringGlobalorganizationsetpolicyrequest.java
@@ -0,0 +1,45 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_SetIamPolicy_StringGlobalorganizationsetpolicyrequest_sync]
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest;
+import com.google.cloud.compute.v1.Policy;
+
+public class SyncSetIamPolicyStringGlobalorganizationsetpolicyrequest {
+
+ public static void main(String[] args) throws Exception {
+ syncSetIamPolicyStringGlobalorganizationsetpolicyrequest();
+ }
+
+ public static void syncSetIamPolicyStringGlobalorganizationsetpolicyrequest() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ String resource = "resource-341064690";
+ GlobalOrganizationSetPolicyRequest globalOrganizationSetPolicyRequestResource =
+ GlobalOrganizationSetPolicyRequest.newBuilder().build();
+ Policy response =
+ firewallPoliciesClient.setIamPolicy(resource, globalOrganizationSetPolicyRequestResource);
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_SetIamPolicy_StringGlobalorganizationsetpolicyrequest_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/testiampermissions/AsyncTestIamPermissions.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/testiampermissions/AsyncTestIamPermissions.java
new file mode 100644
index 000000000000..e78f13f620c9
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/testiampermissions/AsyncTestIamPermissions.java
@@ -0,0 +1,51 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_TestIamPermissions_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.TestIamPermissionsFirewallPolicyRequest;
+import com.google.cloud.compute.v1.TestPermissionsRequest;
+import com.google.cloud.compute.v1.TestPermissionsResponse;
+
+public class AsyncTestIamPermissions {
+
+ public static void main(String[] args) throws Exception {
+ asyncTestIamPermissions();
+ }
+
+ public static void asyncTestIamPermissions() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ TestIamPermissionsFirewallPolicyRequest request =
+ TestIamPermissionsFirewallPolicyRequest.newBuilder()
+ .setResource("resource-341064690")
+ .setTestPermissionsRequestResource(TestPermissionsRequest.newBuilder().build())
+ .build();
+ ApiFuture future =
+ firewallPoliciesClient.testIamPermissionsCallable().futureCall(request);
+ // Do something.
+ TestPermissionsResponse response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_TestIamPermissions_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/testiampermissions/SyncTestIamPermissions.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/testiampermissions/SyncTestIamPermissions.java
new file mode 100644
index 000000000000..c80568d4f40e
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/testiampermissions/SyncTestIamPermissions.java
@@ -0,0 +1,47 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_TestIamPermissions_sync]
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.TestIamPermissionsFirewallPolicyRequest;
+import com.google.cloud.compute.v1.TestPermissionsRequest;
+import com.google.cloud.compute.v1.TestPermissionsResponse;
+
+public class SyncTestIamPermissions {
+
+ public static void main(String[] args) throws Exception {
+ syncTestIamPermissions();
+ }
+
+ public static void syncTestIamPermissions() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ TestIamPermissionsFirewallPolicyRequest request =
+ TestIamPermissionsFirewallPolicyRequest.newBuilder()
+ .setResource("resource-341064690")
+ .setTestPermissionsRequestResource(TestPermissionsRequest.newBuilder().build())
+ .build();
+ TestPermissionsResponse response = firewallPoliciesClient.testIamPermissions(request);
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_TestIamPermissions_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/testiampermissions/SyncTestIamPermissionsStringTestpermissionsrequest.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/testiampermissions/SyncTestIamPermissionsStringTestpermissionsrequest.java
new file mode 100644
index 000000000000..cf370bfb12aa
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpolicies/testiampermissions/SyncTestIamPermissionsStringTestpermissionsrequest.java
@@ -0,0 +1,45 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPolicies_TestIamPermissions_StringTestpermissionsrequest_sync]
+import com.google.cloud.compute.v1.FirewallPoliciesClient;
+import com.google.cloud.compute.v1.TestPermissionsRequest;
+import com.google.cloud.compute.v1.TestPermissionsResponse;
+
+public class SyncTestIamPermissionsStringTestpermissionsrequest {
+
+ public static void main(String[] args) throws Exception {
+ syncTestIamPermissionsStringTestpermissionsrequest();
+ }
+
+ public static void syncTestIamPermissionsStringTestpermissionsrequest() 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
+ String resource = "resource-341064690";
+ TestPermissionsRequest testPermissionsRequestResource =
+ TestPermissionsRequest.newBuilder().build();
+ TestPermissionsResponse response =
+ firewallPoliciesClient.testIamPermissions(resource, testPermissionsRequestResource);
+ }
+ }
+}
+// [END compute_v1_generated_FirewallPolicies_TestIamPermissions_StringTestpermissionsrequest_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpoliciessettings/get/SyncGet.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpoliciessettings/get/SyncGet.java
new file mode 100644
index 000000000000..f4ffbd7a237f
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallpoliciessettings/get/SyncGet.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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallPoliciesSettings_Get_sync]
+import com.google.cloud.compute.v1.FirewallPoliciesSettings;
+import java.time.Duration;
+
+public class SyncGet {
+
+ public static void main(String[] args) throws Exception {
+ syncGet();
+ }
+
+ public static void syncGet() 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
+ FirewallPoliciesSettings.Builder firewallPoliciesSettingsBuilder =
+ FirewallPoliciesSettings.newBuilder();
+ firewallPoliciesSettingsBuilder
+ .getSettings()
+ .setRetrySettings(
+ firewallPoliciesSettingsBuilder
+ .getSettings()
+ .getRetrySettings()
+ .toBuilder()
+ .setTotalTimeout(Duration.ofSeconds(30))
+ .build());
+ FirewallPoliciesSettings firewallPoliciesSettings = firewallPoliciesSettingsBuilder.build();
+ }
+}
+// [END compute_v1_generated_FirewallPoliciesSettings_Get_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/create/SyncCreateSetCredentialsProvider.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/create/SyncCreateSetCredentialsProvider.java
new file mode 100644
index 000000000000..aa0c84c1f191
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/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.compute.v1.samples;
+
+// [START compute_v1_generated_Firewalls_Create_SetCredentialsProvider_sync]
+import com.google.api.gax.core.FixedCredentialsProvider;
+import com.google.cloud.compute.v1.FirewallsClient;
+import com.google.cloud.compute.v1.FirewallsSettings;
+import com.google.cloud.compute.v1.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
+ FirewallsSettings firewallsSettings =
+ FirewallsSettings.newBuilder()
+ .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ .build();
+ FirewallsClient firewallsClient = FirewallsClient.create(firewallsSettings);
+ }
+}
+// [END compute_v1_generated_Firewalls_Create_SetCredentialsProvider_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/create/SyncCreateSetEndpoint.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/create/SyncCreateSetEndpoint.java
new file mode 100644
index 000000000000..c4cb8b59a2f4
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/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.compute.v1.samples;
+
+// [START compute_v1_generated_Firewalls_Create_SetEndpoint_sync]
+import com.google.cloud.compute.v1.FirewallsClient;
+import com.google.cloud.compute.v1.FirewallsSettings;
+import com.google.cloud.compute.v1.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
+ FirewallsSettings firewallsSettings =
+ FirewallsSettings.newBuilder().setEndpoint(myEndpoint).build();
+ FirewallsClient firewallsClient = FirewallsClient.create(firewallsSettings);
+ }
+}
+// [END compute_v1_generated_Firewalls_Create_SetEndpoint_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/delete/AsyncDelete.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/delete/AsyncDelete.java
new file mode 100644
index 000000000000..59e7c0a53982
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/delete/AsyncDelete.java
@@ -0,0 +1,50 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Firewalls_Delete_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.DeleteFirewallRequest;
+import com.google.cloud.compute.v1.FirewallsClient;
+import com.google.longrunning.Operation;
+
+public class AsyncDelete {
+
+ public static void main(String[] args) throws Exception {
+ asyncDelete();
+ }
+
+ public static void asyncDelete() 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 (FirewallsClient firewallsClient = FirewallsClient.create()) {
+ DeleteFirewallRequest request =
+ DeleteFirewallRequest.newBuilder()
+ .setFirewall("firewall-562725632")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ ApiFuture future = firewallsClient.deleteCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Firewalls_Delete_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/delete/AsyncDeleteLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/delete/AsyncDeleteLRO.java
new file mode 100644
index 000000000000..d7d8871ce931
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/delete/AsyncDeleteLRO.java
@@ -0,0 +1,51 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Firewalls_Delete_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.DeleteFirewallRequest;
+import com.google.cloud.compute.v1.FirewallsClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class AsyncDeleteLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncDeleteLRO();
+ }
+
+ public static void asyncDeleteLRO() 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 (FirewallsClient firewallsClient = FirewallsClient.create()) {
+ DeleteFirewallRequest request =
+ DeleteFirewallRequest.newBuilder()
+ .setFirewall("firewall-562725632")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ OperationFuture future =
+ firewallsClient.deleteOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Firewalls_Delete_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/delete/SyncDelete.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/delete/SyncDelete.java
new file mode 100644
index 000000000000..cfb79a33ad32
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/delete/SyncDelete.java
@@ -0,0 +1,47 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Firewalls_Delete_sync]
+import com.google.cloud.compute.v1.DeleteFirewallRequest;
+import com.google.cloud.compute.v1.FirewallsClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncDelete {
+
+ public static void main(String[] args) throws Exception {
+ syncDelete();
+ }
+
+ public static void syncDelete() 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 (FirewallsClient firewallsClient = FirewallsClient.create()) {
+ DeleteFirewallRequest request =
+ DeleteFirewallRequest.newBuilder()
+ .setFirewall("firewall-562725632")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ Operation response = firewallsClient.deleteAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_Firewalls_Delete_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/delete/SyncDeleteStringString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/delete/SyncDeleteStringString.java
new file mode 100644
index 000000000000..69b77fadabf8
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/delete/SyncDeleteStringString.java
@@ -0,0 +1,42 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Firewalls_Delete_StringString_sync]
+import com.google.cloud.compute.v1.FirewallsClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncDeleteStringString {
+
+ public static void main(String[] args) throws Exception {
+ syncDeleteStringString();
+ }
+
+ public static void syncDeleteStringString() 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 (FirewallsClient firewallsClient = FirewallsClient.create()) {
+ String project = "project-309310695";
+ String firewall = "firewall-562725632";
+ Operation response = firewallsClient.deleteAsync(project, firewall).get();
+ }
+ }
+}
+// [END compute_v1_generated_Firewalls_Delete_StringString_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/get/AsyncGet.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/get/AsyncGet.java
new file mode 100644
index 000000000000..b106d650f95e
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/get/AsyncGet.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.compute.v1.samples;
+
+// [START compute_v1_generated_Firewalls_Get_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.Firewall;
+import com.google.cloud.compute.v1.FirewallsClient;
+import com.google.cloud.compute.v1.GetFirewallRequest;
+
+public class AsyncGet {
+
+ public static void main(String[] args) throws Exception {
+ asyncGet();
+ }
+
+ public static void asyncGet() 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 (FirewallsClient firewallsClient = FirewallsClient.create()) {
+ GetFirewallRequest request =
+ GetFirewallRequest.newBuilder()
+ .setFirewall("firewall-562725632")
+ .setProject("project-309310695")
+ .build();
+ ApiFuture future = firewallsClient.getCallable().futureCall(request);
+ // Do something.
+ Firewall response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Firewalls_Get_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/get/SyncGet.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/get/SyncGet.java
new file mode 100644
index 000000000000..042354a6aa0b
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/get/SyncGet.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.compute.v1.samples;
+
+// [START compute_v1_generated_Firewalls_Get_sync]
+import com.google.cloud.compute.v1.Firewall;
+import com.google.cloud.compute.v1.FirewallsClient;
+import com.google.cloud.compute.v1.GetFirewallRequest;
+
+public class SyncGet {
+
+ public static void main(String[] args) throws Exception {
+ syncGet();
+ }
+
+ public static void syncGet() 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 (FirewallsClient firewallsClient = FirewallsClient.create()) {
+ GetFirewallRequest request =
+ GetFirewallRequest.newBuilder()
+ .setFirewall("firewall-562725632")
+ .setProject("project-309310695")
+ .build();
+ Firewall response = firewallsClient.get(request);
+ }
+ }
+}
+// [END compute_v1_generated_Firewalls_Get_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/get/SyncGetStringString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/get/SyncGetStringString.java
new file mode 100644
index 000000000000..a0db7bb51df5
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/get/SyncGetStringString.java
@@ -0,0 +1,42 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Firewalls_Get_StringString_sync]
+import com.google.cloud.compute.v1.Firewall;
+import com.google.cloud.compute.v1.FirewallsClient;
+
+public class SyncGetStringString {
+
+ public static void main(String[] args) throws Exception {
+ syncGetStringString();
+ }
+
+ public static void syncGetStringString() 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 (FirewallsClient firewallsClient = FirewallsClient.create()) {
+ String project = "project-309310695";
+ String firewall = "firewall-562725632";
+ Firewall response = firewallsClient.get(project, firewall);
+ }
+ }
+}
+// [END compute_v1_generated_Firewalls_Get_StringString_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/insert/AsyncInsert.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/insert/AsyncInsert.java
new file mode 100644
index 000000000000..b1471b2fb166
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/insert/AsyncInsert.java
@@ -0,0 +1,51 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Firewalls_Insert_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.Firewall;
+import com.google.cloud.compute.v1.FirewallsClient;
+import com.google.cloud.compute.v1.InsertFirewallRequest;
+import com.google.longrunning.Operation;
+
+public class AsyncInsert {
+
+ public static void main(String[] args) throws Exception {
+ asyncInsert();
+ }
+
+ public static void asyncInsert() 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 (FirewallsClient firewallsClient = FirewallsClient.create()) {
+ InsertFirewallRequest request =
+ InsertFirewallRequest.newBuilder()
+ .setFirewallResource(Firewall.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ ApiFuture future = firewallsClient.insertCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Firewalls_Insert_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/insert/AsyncInsertLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/insert/AsyncInsertLRO.java
new file mode 100644
index 000000000000..5b87ab8eedd3
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/insert/AsyncInsertLRO.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.compute.v1.samples;
+
+// [START compute_v1_generated_Firewalls_Insert_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.Firewall;
+import com.google.cloud.compute.v1.FirewallsClient;
+import com.google.cloud.compute.v1.InsertFirewallRequest;
+import com.google.cloud.compute.v1.Operation;
+
+public class AsyncInsertLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncInsertLRO();
+ }
+
+ public static void asyncInsertLRO() 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 (FirewallsClient firewallsClient = FirewallsClient.create()) {
+ InsertFirewallRequest request =
+ InsertFirewallRequest.newBuilder()
+ .setFirewallResource(Firewall.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ OperationFuture future =
+ firewallsClient.insertOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Firewalls_Insert_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/insert/SyncInsert.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/insert/SyncInsert.java
new file mode 100644
index 000000000000..4832786f0072
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/insert/SyncInsert.java
@@ -0,0 +1,48 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Firewalls_Insert_sync]
+import com.google.cloud.compute.v1.Firewall;
+import com.google.cloud.compute.v1.FirewallsClient;
+import com.google.cloud.compute.v1.InsertFirewallRequest;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncInsert {
+
+ public static void main(String[] args) throws Exception {
+ syncInsert();
+ }
+
+ public static void syncInsert() 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 (FirewallsClient firewallsClient = FirewallsClient.create()) {
+ InsertFirewallRequest request =
+ InsertFirewallRequest.newBuilder()
+ .setFirewallResource(Firewall.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ Operation response = firewallsClient.insertAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_Firewalls_Insert_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/insert/SyncInsertStringFirewall.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/insert/SyncInsertStringFirewall.java
new file mode 100644
index 000000000000..25c1503550d0
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/insert/SyncInsertStringFirewall.java
@@ -0,0 +1,43 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Firewalls_Insert_StringFirewall_sync]
+import com.google.cloud.compute.v1.Firewall;
+import com.google.cloud.compute.v1.FirewallsClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncInsertStringFirewall {
+
+ public static void main(String[] args) throws Exception {
+ syncInsertStringFirewall();
+ }
+
+ public static void syncInsertStringFirewall() 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 (FirewallsClient firewallsClient = FirewallsClient.create()) {
+ String project = "project-309310695";
+ Firewall firewallResource = Firewall.newBuilder().build();
+ Operation response = firewallsClient.insertAsync(project, firewallResource).get();
+ }
+ }
+}
+// [END compute_v1_generated_Firewalls_Insert_StringFirewall_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/list/AsyncList.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/list/AsyncList.java
new file mode 100644
index 000000000000..557d57651864
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/list/AsyncList.java
@@ -0,0 +1,55 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Firewalls_List_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.Firewall;
+import com.google.cloud.compute.v1.FirewallsClient;
+import com.google.cloud.compute.v1.ListFirewallsRequest;
+
+public class AsyncList {
+
+ public static void main(String[] args) throws Exception {
+ asyncList();
+ }
+
+ public static void asyncList() 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 (FirewallsClient firewallsClient = FirewallsClient.create()) {
+ ListFirewallsRequest request =
+ ListFirewallsRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .build();
+ ApiFuture future = firewallsClient.listPagedCallable().futureCall(request);
+ // Do something.
+ for (Firewall element : future.get().iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_Firewalls_List_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/list/AsyncListPaged.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/list/AsyncListPaged.java
new file mode 100644
index 000000000000..6e8817302838
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/list/AsyncListPaged.java
@@ -0,0 +1,63 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Firewalls_List_Paged_async]
+import com.google.cloud.compute.v1.Firewall;
+import com.google.cloud.compute.v1.FirewallList;
+import com.google.cloud.compute.v1.FirewallsClient;
+import com.google.cloud.compute.v1.ListFirewallsRequest;
+import com.google.common.base.Strings;
+
+public class AsyncListPaged {
+
+ public static void main(String[] args) throws Exception {
+ asyncListPaged();
+ }
+
+ public static void asyncListPaged() 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 (FirewallsClient firewallsClient = FirewallsClient.create()) {
+ ListFirewallsRequest request =
+ ListFirewallsRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .build();
+ while (true) {
+ FirewallList response = firewallsClient.listCallable().call(request);
+ for (Firewall element : response.getItemsList()) {
+ // doThingsWith(element);
+ }
+ String nextPageToken = response.getNextPageToken();
+ if (!Strings.isNullOrEmpty(nextPageToken)) {
+ request = request.toBuilder().setPageToken(nextPageToken).build();
+ } else {
+ break;
+ }
+ }
+ }
+ }
+}
+// [END compute_v1_generated_Firewalls_List_Paged_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/list/SyncList.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/list/SyncList.java
new file mode 100644
index 000000000000..ee81bb18e370
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/list/SyncList.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.compute.v1.samples;
+
+// [START compute_v1_generated_Firewalls_List_sync]
+import com.google.cloud.compute.v1.Firewall;
+import com.google.cloud.compute.v1.FirewallsClient;
+import com.google.cloud.compute.v1.ListFirewallsRequest;
+
+public class SyncList {
+
+ public static void main(String[] args) throws Exception {
+ syncList();
+ }
+
+ public static void syncList() 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 (FirewallsClient firewallsClient = FirewallsClient.create()) {
+ ListFirewallsRequest request =
+ ListFirewallsRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .build();
+ for (Firewall element : firewallsClient.list(request).iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_Firewalls_List_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/list/SyncListString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/list/SyncListString.java
new file mode 100644
index 000000000000..b5f39330497a
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/list/SyncListString.java
@@ -0,0 +1,43 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_Firewalls_List_String_sync]
+import com.google.cloud.compute.v1.Firewall;
+import com.google.cloud.compute.v1.FirewallsClient;
+
+public class SyncListString {
+
+ public static void main(String[] args) throws Exception {
+ syncListString();
+ }
+
+ public static void syncListString() 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 (FirewallsClient firewallsClient = FirewallsClient.create()) {
+ String project = "project-309310695";
+ for (Firewall element : firewallsClient.list(project).iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_Firewalls_List_String_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/patch/AsyncPatch.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/patch/AsyncPatch.java
new file mode 100644
index 000000000000..8551408e35de
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/patch/AsyncPatch.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.compute.v1.samples;
+
+// [START compute_v1_generated_Firewalls_Patch_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.Firewall;
+import com.google.cloud.compute.v1.FirewallsClient;
+import com.google.cloud.compute.v1.PatchFirewallRequest;
+import com.google.longrunning.Operation;
+
+public class AsyncPatch {
+
+ public static void main(String[] args) throws Exception {
+ asyncPatch();
+ }
+
+ public static void asyncPatch() 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 (FirewallsClient firewallsClient = FirewallsClient.create()) {
+ PatchFirewallRequest request =
+ PatchFirewallRequest.newBuilder()
+ .setFirewall("firewall-562725632")
+ .setFirewallResource(Firewall.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ ApiFuture future = firewallsClient.patchCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Firewalls_Patch_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/patch/AsyncPatchLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/patch/AsyncPatchLRO.java
new file mode 100644
index 000000000000..05adaeed6ee0
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/patch/AsyncPatchLRO.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.compute.v1.samples;
+
+// [START compute_v1_generated_Firewalls_Patch_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.Firewall;
+import com.google.cloud.compute.v1.FirewallsClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.PatchFirewallRequest;
+
+public class AsyncPatchLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncPatchLRO();
+ }
+
+ public static void asyncPatchLRO() 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 (FirewallsClient firewallsClient = FirewallsClient.create()) {
+ PatchFirewallRequest request =
+ PatchFirewallRequest.newBuilder()
+ .setFirewall("firewall-562725632")
+ .setFirewallResource(Firewall.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ OperationFuture future =
+ firewallsClient.patchOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Firewalls_Patch_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/patch/SyncPatch.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/patch/SyncPatch.java
new file mode 100644
index 000000000000..5a0f4e5ef7c0
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/patch/SyncPatch.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.compute.v1.samples;
+
+// [START compute_v1_generated_Firewalls_Patch_sync]
+import com.google.cloud.compute.v1.Firewall;
+import com.google.cloud.compute.v1.FirewallsClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.PatchFirewallRequest;
+
+public class SyncPatch {
+
+ public static void main(String[] args) throws Exception {
+ syncPatch();
+ }
+
+ public static void syncPatch() 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 (FirewallsClient firewallsClient = FirewallsClient.create()) {
+ PatchFirewallRequest request =
+ PatchFirewallRequest.newBuilder()
+ .setFirewall("firewall-562725632")
+ .setFirewallResource(Firewall.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ Operation response = firewallsClient.patchAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_Firewalls_Patch_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/patch/SyncPatchStringStringFirewall.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/patch/SyncPatchStringStringFirewall.java
new file mode 100644
index 000000000000..6adf487dbb35
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/patch/SyncPatchStringStringFirewall.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.compute.v1.samples;
+
+// [START compute_v1_generated_Firewalls_Patch_StringStringFirewall_sync]
+import com.google.cloud.compute.v1.Firewall;
+import com.google.cloud.compute.v1.FirewallsClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncPatchStringStringFirewall {
+
+ public static void main(String[] args) throws Exception {
+ syncPatchStringStringFirewall();
+ }
+
+ public static void syncPatchStringStringFirewall() 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 (FirewallsClient firewallsClient = FirewallsClient.create()) {
+ String project = "project-309310695";
+ String firewall = "firewall-562725632";
+ Firewall firewallResource = Firewall.newBuilder().build();
+ Operation response = firewallsClient.patchAsync(project, firewall, firewallResource).get();
+ }
+ }
+}
+// [END compute_v1_generated_Firewalls_Patch_StringStringFirewall_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/update/AsyncUpdate.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/update/AsyncUpdate.java
new file mode 100644
index 000000000000..f94ab683cf6a
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/update/AsyncUpdate.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.compute.v1.samples;
+
+// [START compute_v1_generated_Firewalls_Update_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.Firewall;
+import com.google.cloud.compute.v1.FirewallsClient;
+import com.google.cloud.compute.v1.UpdateFirewallRequest;
+import com.google.longrunning.Operation;
+
+public class AsyncUpdate {
+
+ public static void main(String[] args) throws Exception {
+ asyncUpdate();
+ }
+
+ public static void asyncUpdate() 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 (FirewallsClient firewallsClient = FirewallsClient.create()) {
+ UpdateFirewallRequest request =
+ UpdateFirewallRequest.newBuilder()
+ .setFirewall("firewall-562725632")
+ .setFirewallResource(Firewall.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ ApiFuture future = firewallsClient.updateCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Firewalls_Update_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/update/AsyncUpdateLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/update/AsyncUpdateLRO.java
new file mode 100644
index 000000000000..c1ff4cc2cafa
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/update/AsyncUpdateLRO.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.compute.v1.samples;
+
+// [START compute_v1_generated_Firewalls_Update_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.Firewall;
+import com.google.cloud.compute.v1.FirewallsClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.UpdateFirewallRequest;
+
+public class AsyncUpdateLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncUpdateLRO();
+ }
+
+ public static void asyncUpdateLRO() 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 (FirewallsClient firewallsClient = FirewallsClient.create()) {
+ UpdateFirewallRequest request =
+ UpdateFirewallRequest.newBuilder()
+ .setFirewall("firewall-562725632")
+ .setFirewallResource(Firewall.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ OperationFuture future =
+ firewallsClient.updateOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_Firewalls_Update_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/update/SyncUpdate.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/update/SyncUpdate.java
new file mode 100644
index 000000000000..49ebcce94141
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/update/SyncUpdate.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.compute.v1.samples;
+
+// [START compute_v1_generated_Firewalls_Update_sync]
+import com.google.cloud.compute.v1.Firewall;
+import com.google.cloud.compute.v1.FirewallsClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.UpdateFirewallRequest;
+
+public class SyncUpdate {
+
+ public static void main(String[] args) throws Exception {
+ syncUpdate();
+ }
+
+ public static void syncUpdate() 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 (FirewallsClient firewallsClient = FirewallsClient.create()) {
+ UpdateFirewallRequest request =
+ UpdateFirewallRequest.newBuilder()
+ .setFirewall("firewall-562725632")
+ .setFirewallResource(Firewall.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ Operation response = firewallsClient.updateAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_Firewalls_Update_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/update/SyncUpdateStringStringFirewall.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/update/SyncUpdateStringStringFirewall.java
new file mode 100644
index 000000000000..73542e14356e
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewalls/update/SyncUpdateStringStringFirewall.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.compute.v1.samples;
+
+// [START compute_v1_generated_Firewalls_Update_StringStringFirewall_sync]
+import com.google.cloud.compute.v1.Firewall;
+import com.google.cloud.compute.v1.FirewallsClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncUpdateStringStringFirewall {
+
+ public static void main(String[] args) throws Exception {
+ syncUpdateStringStringFirewall();
+ }
+
+ public static void syncUpdateStringStringFirewall() 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 (FirewallsClient firewallsClient = FirewallsClient.create()) {
+ String project = "project-309310695";
+ String firewall = "firewall-562725632";
+ Firewall firewallResource = Firewall.newBuilder().build();
+ Operation response = firewallsClient.updateAsync(project, firewall, firewallResource).get();
+ }
+ }
+}
+// [END compute_v1_generated_Firewalls_Update_StringStringFirewall_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallssettings/get/SyncGet.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallssettings/get/SyncGet.java
new file mode 100644
index 000000000000..e38aae3e0ed9
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/firewallssettings/get/SyncGet.java
@@ -0,0 +1,48 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_FirewallsSettings_Get_sync]
+import com.google.cloud.compute.v1.FirewallsSettings;
+import java.time.Duration;
+
+public class SyncGet {
+
+ public static void main(String[] args) throws Exception {
+ syncGet();
+ }
+
+ public static void syncGet() 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
+ FirewallsSettings.Builder firewallsSettingsBuilder = FirewallsSettings.newBuilder();
+ firewallsSettingsBuilder
+ .getSettings()
+ .setRetrySettings(
+ firewallsSettingsBuilder
+ .getSettings()
+ .getRetrySettings()
+ .toBuilder()
+ .setTotalTimeout(Duration.ofSeconds(30))
+ .build());
+ FirewallsSettings firewallsSettings = firewallsSettingsBuilder.build();
+ }
+}
+// [END compute_v1_generated_FirewallsSettings_Get_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/aggregatedlist/AsyncAggregatedList.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/aggregatedlist/AsyncAggregatedList.java
new file mode 100644
index 000000000000..215db0d9b4a6
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/aggregatedlist/AsyncAggregatedList.java
@@ -0,0 +1,58 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_ForwardingRules_AggregatedList_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.AggregatedListForwardingRulesRequest;
+import com.google.cloud.compute.v1.ForwardingRulesClient;
+import com.google.cloud.compute.v1.ForwardingRulesScopedList;
+import java.util.Map;
+
+public class AsyncAggregatedList {
+
+ public static void main(String[] args) throws Exception {
+ asyncAggregatedList();
+ }
+
+ public static void asyncAggregatedList() 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 (ForwardingRulesClient forwardingRulesClient = ForwardingRulesClient.create()) {
+ AggregatedListForwardingRulesRequest request =
+ AggregatedListForwardingRulesRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setIncludeAllScopes(true)
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .build();
+ ApiFuture> future =
+ forwardingRulesClient.aggregatedListPagedCallable().futureCall(request);
+ // Do something.
+ for (Map.Entry element : future.get().iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_ForwardingRules_AggregatedList_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/aggregatedlist/AsyncAggregatedListPaged.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/aggregatedlist/AsyncAggregatedListPaged.java
new file mode 100644
index 000000000000..59c9459585bc
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/aggregatedlist/AsyncAggregatedListPaged.java
@@ -0,0 +1,66 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_ForwardingRules_AggregatedList_Paged_async]
+import com.google.cloud.compute.v1.AggregatedListForwardingRulesRequest;
+import com.google.cloud.compute.v1.ForwardingRuleAggregatedList;
+import com.google.cloud.compute.v1.ForwardingRulesClient;
+import com.google.cloud.compute.v1.ForwardingRulesScopedList;
+import com.google.common.base.Strings;
+import java.util.Map;
+
+public class AsyncAggregatedListPaged {
+
+ public static void main(String[] args) throws Exception {
+ asyncAggregatedListPaged();
+ }
+
+ public static void asyncAggregatedListPaged() 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 (ForwardingRulesClient forwardingRulesClient = ForwardingRulesClient.create()) {
+ AggregatedListForwardingRulesRequest request =
+ AggregatedListForwardingRulesRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setIncludeAllScopes(true)
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .build();
+ while (true) {
+ ForwardingRuleAggregatedList response =
+ forwardingRulesClient.aggregatedListCallable().call(request);
+ for (Map.Entry element : response.getItemsList()) {
+ // doThingsWith(element);
+ }
+ String nextPageToken = response.getNextPageToken();
+ if (!Strings.isNullOrEmpty(nextPageToken)) {
+ request = request.toBuilder().setPageToken(nextPageToken).build();
+ } else {
+ break;
+ }
+ }
+ }
+ }
+}
+// [END compute_v1_generated_ForwardingRules_AggregatedList_Paged_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/aggregatedlist/SyncAggregatedList.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/aggregatedlist/SyncAggregatedList.java
new file mode 100644
index 000000000000..6bdfbf35df6e
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/aggregatedlist/SyncAggregatedList.java
@@ -0,0 +1,55 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_ForwardingRules_AggregatedList_sync]
+import com.google.cloud.compute.v1.AggregatedListForwardingRulesRequest;
+import com.google.cloud.compute.v1.ForwardingRulesClient;
+import com.google.cloud.compute.v1.ForwardingRulesScopedList;
+import java.util.Map;
+
+public class SyncAggregatedList {
+
+ public static void main(String[] args) throws Exception {
+ syncAggregatedList();
+ }
+
+ public static void syncAggregatedList() 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 (ForwardingRulesClient forwardingRulesClient = ForwardingRulesClient.create()) {
+ AggregatedListForwardingRulesRequest request =
+ AggregatedListForwardingRulesRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setIncludeAllScopes(true)
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setReturnPartialSuccess(true)
+ .build();
+ for (Map.Entry element :
+ forwardingRulesClient.aggregatedList(request).iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_ForwardingRules_AggregatedList_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/aggregatedlist/SyncAggregatedListString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/aggregatedlist/SyncAggregatedListString.java
new file mode 100644
index 000000000000..73d0e3dff1e4
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/aggregatedlist/SyncAggregatedListString.java
@@ -0,0 +1,45 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_ForwardingRules_AggregatedList_String_sync]
+import com.google.cloud.compute.v1.ForwardingRulesClient;
+import com.google.cloud.compute.v1.ForwardingRulesScopedList;
+import java.util.Map;
+
+public class SyncAggregatedListString {
+
+ public static void main(String[] args) throws Exception {
+ syncAggregatedListString();
+ }
+
+ public static void syncAggregatedListString() 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 (ForwardingRulesClient forwardingRulesClient = ForwardingRulesClient.create()) {
+ String project = "project-309310695";
+ for (Map.Entry element :
+ forwardingRulesClient.aggregatedList(project).iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_ForwardingRules_AggregatedList_String_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/create/SyncCreateSetCredentialsProvider.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/create/SyncCreateSetCredentialsProvider.java
new file mode 100644
index 000000000000..2b202cf9f6c4
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/create/SyncCreateSetCredentialsProvider.java
@@ -0,0 +1,45 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_ForwardingRules_Create_SetCredentialsProvider_sync]
+import com.google.api.gax.core.FixedCredentialsProvider;
+import com.google.cloud.compute.v1.ForwardingRulesClient;
+import com.google.cloud.compute.v1.ForwardingRulesSettings;
+import com.google.cloud.compute.v1.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
+ ForwardingRulesSettings forwardingRulesSettings =
+ ForwardingRulesSettings.newBuilder()
+ .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ .build();
+ ForwardingRulesClient forwardingRulesClient =
+ ForwardingRulesClient.create(forwardingRulesSettings);
+ }
+}
+// [END compute_v1_generated_ForwardingRules_Create_SetCredentialsProvider_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/create/SyncCreateSetEndpoint.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/create/SyncCreateSetEndpoint.java
new file mode 100644
index 000000000000..1deeefba0af1
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/create/SyncCreateSetEndpoint.java
@@ -0,0 +1,42 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_ForwardingRules_Create_SetEndpoint_sync]
+import com.google.cloud.compute.v1.ForwardingRulesClient;
+import com.google.cloud.compute.v1.ForwardingRulesSettings;
+import com.google.cloud.compute.v1.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
+ ForwardingRulesSettings forwardingRulesSettings =
+ ForwardingRulesSettings.newBuilder().setEndpoint(myEndpoint).build();
+ ForwardingRulesClient forwardingRulesClient =
+ ForwardingRulesClient.create(forwardingRulesSettings);
+ }
+}
+// [END compute_v1_generated_ForwardingRules_Create_SetEndpoint_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/delete/AsyncDelete.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/delete/AsyncDelete.java
new file mode 100644
index 000000000000..cd93e5795608
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/delete/AsyncDelete.java
@@ -0,0 +1,51 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_ForwardingRules_Delete_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.DeleteForwardingRuleRequest;
+import com.google.cloud.compute.v1.ForwardingRulesClient;
+import com.google.longrunning.Operation;
+
+public class AsyncDelete {
+
+ public static void main(String[] args) throws Exception {
+ asyncDelete();
+ }
+
+ public static void asyncDelete() 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 (ForwardingRulesClient forwardingRulesClient = ForwardingRulesClient.create()) {
+ DeleteForwardingRuleRequest request =
+ DeleteForwardingRuleRequest.newBuilder()
+ .setForwardingRule("forwardingRule-1429104743")
+ .setProject("project-309310695")
+ .setRegion("region-934795532")
+ .setRequestId("requestId693933066")
+ .build();
+ ApiFuture future = forwardingRulesClient.deleteCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_ForwardingRules_Delete_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/delete/AsyncDeleteLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/delete/AsyncDeleteLRO.java
new file mode 100644
index 000000000000..9a3269699974
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/delete/AsyncDeleteLRO.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.compute.v1.samples;
+
+// [START compute_v1_generated_ForwardingRules_Delete_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.DeleteForwardingRuleRequest;
+import com.google.cloud.compute.v1.ForwardingRulesClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class AsyncDeleteLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncDeleteLRO();
+ }
+
+ public static void asyncDeleteLRO() 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 (ForwardingRulesClient forwardingRulesClient = ForwardingRulesClient.create()) {
+ DeleteForwardingRuleRequest request =
+ DeleteForwardingRuleRequest.newBuilder()
+ .setForwardingRule("forwardingRule-1429104743")
+ .setProject("project-309310695")
+ .setRegion("region-934795532")
+ .setRequestId("requestId693933066")
+ .build();
+ OperationFuture future =
+ forwardingRulesClient.deleteOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_ForwardingRules_Delete_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/delete/SyncDelete.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/delete/SyncDelete.java
new file mode 100644
index 000000000000..46d38a0644e1
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/delete/SyncDelete.java
@@ -0,0 +1,48 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_ForwardingRules_Delete_sync]
+import com.google.cloud.compute.v1.DeleteForwardingRuleRequest;
+import com.google.cloud.compute.v1.ForwardingRulesClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncDelete {
+
+ public static void main(String[] args) throws Exception {
+ syncDelete();
+ }
+
+ public static void syncDelete() 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 (ForwardingRulesClient forwardingRulesClient = ForwardingRulesClient.create()) {
+ DeleteForwardingRuleRequest request =
+ DeleteForwardingRuleRequest.newBuilder()
+ .setForwardingRule("forwardingRule-1429104743")
+ .setProject("project-309310695")
+ .setRegion("region-934795532")
+ .setRequestId("requestId693933066")
+ .build();
+ Operation response = forwardingRulesClient.deleteAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_ForwardingRules_Delete_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/delete/SyncDeleteStringStringString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/delete/SyncDeleteStringStringString.java
new file mode 100644
index 000000000000..76f0315c00ec
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/delete/SyncDeleteStringStringString.java
@@ -0,0 +1,43 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_ForwardingRules_Delete_StringStringString_sync]
+import com.google.cloud.compute.v1.ForwardingRulesClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncDeleteStringStringString {
+
+ public static void main(String[] args) throws Exception {
+ syncDeleteStringStringString();
+ }
+
+ public static void syncDeleteStringStringString() 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 (ForwardingRulesClient forwardingRulesClient = ForwardingRulesClient.create()) {
+ String project = "project-309310695";
+ String region = "region-934795532";
+ String forwardingRule = "forwardingRule-1429104743";
+ Operation response = forwardingRulesClient.deleteAsync(project, region, forwardingRule).get();
+ }
+ }
+}
+// [END compute_v1_generated_ForwardingRules_Delete_StringStringString_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/get/AsyncGet.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/get/AsyncGet.java
new file mode 100644
index 000000000000..2a5324f63c34
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/get/AsyncGet.java
@@ -0,0 +1,50 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_ForwardingRules_Get_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.ForwardingRule;
+import com.google.cloud.compute.v1.ForwardingRulesClient;
+import com.google.cloud.compute.v1.GetForwardingRuleRequest;
+
+public class AsyncGet {
+
+ public static void main(String[] args) throws Exception {
+ asyncGet();
+ }
+
+ public static void asyncGet() 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 (ForwardingRulesClient forwardingRulesClient = ForwardingRulesClient.create()) {
+ GetForwardingRuleRequest request =
+ GetForwardingRuleRequest.newBuilder()
+ .setForwardingRule("forwardingRule-1429104743")
+ .setProject("project-309310695")
+ .setRegion("region-934795532")
+ .build();
+ ApiFuture future = forwardingRulesClient.getCallable().futureCall(request);
+ // Do something.
+ ForwardingRule response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_ForwardingRules_Get_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/get/SyncGet.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/get/SyncGet.java
new file mode 100644
index 000000000000..a5db9d0ce27e
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/get/SyncGet.java
@@ -0,0 +1,47 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_ForwardingRules_Get_sync]
+import com.google.cloud.compute.v1.ForwardingRule;
+import com.google.cloud.compute.v1.ForwardingRulesClient;
+import com.google.cloud.compute.v1.GetForwardingRuleRequest;
+
+public class SyncGet {
+
+ public static void main(String[] args) throws Exception {
+ syncGet();
+ }
+
+ public static void syncGet() 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 (ForwardingRulesClient forwardingRulesClient = ForwardingRulesClient.create()) {
+ GetForwardingRuleRequest request =
+ GetForwardingRuleRequest.newBuilder()
+ .setForwardingRule("forwardingRule-1429104743")
+ .setProject("project-309310695")
+ .setRegion("region-934795532")
+ .build();
+ ForwardingRule response = forwardingRulesClient.get(request);
+ }
+ }
+}
+// [END compute_v1_generated_ForwardingRules_Get_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/get/SyncGetStringStringString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/get/SyncGetStringStringString.java
new file mode 100644
index 000000000000..9ef0df6c8323
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/get/SyncGetStringStringString.java
@@ -0,0 +1,43 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_ForwardingRules_Get_StringStringString_sync]
+import com.google.cloud.compute.v1.ForwardingRule;
+import com.google.cloud.compute.v1.ForwardingRulesClient;
+
+public class SyncGetStringStringString {
+
+ public static void main(String[] args) throws Exception {
+ syncGetStringStringString();
+ }
+
+ public static void syncGetStringStringString() 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 (ForwardingRulesClient forwardingRulesClient = ForwardingRulesClient.create()) {
+ String project = "project-309310695";
+ String region = "region-934795532";
+ String forwardingRule = "forwardingRule-1429104743";
+ ForwardingRule response = forwardingRulesClient.get(project, region, forwardingRule);
+ }
+ }
+}
+// [END compute_v1_generated_ForwardingRules_Get_StringStringString_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/insert/AsyncInsert.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/insert/AsyncInsert.java
new file mode 100644
index 000000000000..af2f5603435b
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/insert/AsyncInsert.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.compute.v1.samples;
+
+// [START compute_v1_generated_ForwardingRules_Insert_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.ForwardingRule;
+import com.google.cloud.compute.v1.ForwardingRulesClient;
+import com.google.cloud.compute.v1.InsertForwardingRuleRequest;
+import com.google.longrunning.Operation;
+
+public class AsyncInsert {
+
+ public static void main(String[] args) throws Exception {
+ asyncInsert();
+ }
+
+ public static void asyncInsert() 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 (ForwardingRulesClient forwardingRulesClient = ForwardingRulesClient.create()) {
+ InsertForwardingRuleRequest request =
+ InsertForwardingRuleRequest.newBuilder()
+ .setForwardingRuleResource(ForwardingRule.newBuilder().build())
+ .setProject("project-309310695")
+ .setRegion("region-934795532")
+ .setRequestId("requestId693933066")
+ .build();
+ ApiFuture future = forwardingRulesClient.insertCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_ForwardingRules_Insert_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/insert/AsyncInsertLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/insert/AsyncInsertLRO.java
new file mode 100644
index 000000000000..e6531389d075
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/insert/AsyncInsertLRO.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.compute.v1.samples;
+
+// [START compute_v1_generated_ForwardingRules_Insert_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.ForwardingRule;
+import com.google.cloud.compute.v1.ForwardingRulesClient;
+import com.google.cloud.compute.v1.InsertForwardingRuleRequest;
+import com.google.cloud.compute.v1.Operation;
+
+public class AsyncInsertLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncInsertLRO();
+ }
+
+ public static void asyncInsertLRO() 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 (ForwardingRulesClient forwardingRulesClient = ForwardingRulesClient.create()) {
+ InsertForwardingRuleRequest request =
+ InsertForwardingRuleRequest.newBuilder()
+ .setForwardingRuleResource(ForwardingRule.newBuilder().build())
+ .setProject("project-309310695")
+ .setRegion("region-934795532")
+ .setRequestId("requestId693933066")
+ .build();
+ OperationFuture future =
+ forwardingRulesClient.insertOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_ForwardingRules_Insert_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/insert/SyncInsert.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/insert/SyncInsert.java
new file mode 100644
index 000000000000..496c5c70ed69
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/insert/SyncInsert.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.compute.v1.samples;
+
+// [START compute_v1_generated_ForwardingRules_Insert_sync]
+import com.google.cloud.compute.v1.ForwardingRule;
+import com.google.cloud.compute.v1.ForwardingRulesClient;
+import com.google.cloud.compute.v1.InsertForwardingRuleRequest;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncInsert {
+
+ public static void main(String[] args) throws Exception {
+ syncInsert();
+ }
+
+ public static void syncInsert() 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 (ForwardingRulesClient forwardingRulesClient = ForwardingRulesClient.create()) {
+ InsertForwardingRuleRequest request =
+ InsertForwardingRuleRequest.newBuilder()
+ .setForwardingRuleResource(ForwardingRule.newBuilder().build())
+ .setProject("project-309310695")
+ .setRegion("region-934795532")
+ .setRequestId("requestId693933066")
+ .build();
+ Operation response = forwardingRulesClient.insertAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_ForwardingRules_Insert_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/insert/SyncInsertStringStringForwardingrule.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/insert/SyncInsertStringStringForwardingrule.java
new file mode 100644
index 000000000000..694f7978d5ab
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/insert/SyncInsertStringStringForwardingrule.java
@@ -0,0 +1,45 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_ForwardingRules_Insert_StringStringForwardingrule_sync]
+import com.google.cloud.compute.v1.ForwardingRule;
+import com.google.cloud.compute.v1.ForwardingRulesClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncInsertStringStringForwardingrule {
+
+ public static void main(String[] args) throws Exception {
+ syncInsertStringStringForwardingrule();
+ }
+
+ public static void syncInsertStringStringForwardingrule() 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 (ForwardingRulesClient forwardingRulesClient = ForwardingRulesClient.create()) {
+ String project = "project-309310695";
+ String region = "region-934795532";
+ ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build();
+ Operation response =
+ forwardingRulesClient.insertAsync(project, region, forwardingRuleResource).get();
+ }
+ }
+}
+// [END compute_v1_generated_ForwardingRules_Insert_StringStringForwardingrule_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/list/AsyncList.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/list/AsyncList.java
new file mode 100644
index 000000000000..34eb2cff2923
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/list/AsyncList.java
@@ -0,0 +1,57 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_ForwardingRules_List_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.ForwardingRule;
+import com.google.cloud.compute.v1.ForwardingRulesClient;
+import com.google.cloud.compute.v1.ListForwardingRulesRequest;
+
+public class AsyncList {
+
+ public static void main(String[] args) throws Exception {
+ asyncList();
+ }
+
+ public static void asyncList() 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 (ForwardingRulesClient forwardingRulesClient = ForwardingRulesClient.create()) {
+ ListForwardingRulesRequest request =
+ ListForwardingRulesRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setRegion("region-934795532")
+ .setReturnPartialSuccess(true)
+ .build();
+ ApiFuture future =
+ forwardingRulesClient.listPagedCallable().futureCall(request);
+ // Do something.
+ for (ForwardingRule element : future.get().iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_ForwardingRules_List_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/list/AsyncListPaged.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/list/AsyncListPaged.java
new file mode 100644
index 000000000000..eef72f584773
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/list/AsyncListPaged.java
@@ -0,0 +1,64 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_ForwardingRules_List_Paged_async]
+import com.google.cloud.compute.v1.ForwardingRule;
+import com.google.cloud.compute.v1.ForwardingRuleList;
+import com.google.cloud.compute.v1.ForwardingRulesClient;
+import com.google.cloud.compute.v1.ListForwardingRulesRequest;
+import com.google.common.base.Strings;
+
+public class AsyncListPaged {
+
+ public static void main(String[] args) throws Exception {
+ asyncListPaged();
+ }
+
+ public static void asyncListPaged() 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 (ForwardingRulesClient forwardingRulesClient = ForwardingRulesClient.create()) {
+ ListForwardingRulesRequest request =
+ ListForwardingRulesRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setRegion("region-934795532")
+ .setReturnPartialSuccess(true)
+ .build();
+ while (true) {
+ ForwardingRuleList response = forwardingRulesClient.listCallable().call(request);
+ for (ForwardingRule element : response.getItemsList()) {
+ // doThingsWith(element);
+ }
+ String nextPageToken = response.getNextPageToken();
+ if (!Strings.isNullOrEmpty(nextPageToken)) {
+ request = request.toBuilder().setPageToken(nextPageToken).build();
+ } else {
+ break;
+ }
+ }
+ }
+ }
+}
+// [END compute_v1_generated_ForwardingRules_List_Paged_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/list/SyncList.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/list/SyncList.java
new file mode 100644
index 000000000000..f7f0ee90ed7d
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/list/SyncList.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.compute.v1.samples;
+
+// [START compute_v1_generated_ForwardingRules_List_sync]
+import com.google.cloud.compute.v1.ForwardingRule;
+import com.google.cloud.compute.v1.ForwardingRulesClient;
+import com.google.cloud.compute.v1.ListForwardingRulesRequest;
+
+public class SyncList {
+
+ public static void main(String[] args) throws Exception {
+ syncList();
+ }
+
+ public static void syncList() 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 (ForwardingRulesClient forwardingRulesClient = ForwardingRulesClient.create()) {
+ ListForwardingRulesRequest request =
+ ListForwardingRulesRequest.newBuilder()
+ .setFilter("filter-1274492040")
+ .setMaxResults(1128457243)
+ .setOrderBy("orderBy-1207110587")
+ .setPageToken("pageToken873572522")
+ .setProject("project-309310695")
+ .setRegion("region-934795532")
+ .setReturnPartialSuccess(true)
+ .build();
+ for (ForwardingRule element : forwardingRulesClient.list(request).iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_ForwardingRules_List_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/list/SyncListStringString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/list/SyncListStringString.java
new file mode 100644
index 000000000000..6bbec4124d4c
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/list/SyncListStringString.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.compute.v1.samples;
+
+// [START compute_v1_generated_ForwardingRules_List_StringString_sync]
+import com.google.cloud.compute.v1.ForwardingRule;
+import com.google.cloud.compute.v1.ForwardingRulesClient;
+
+public class SyncListStringString {
+
+ public static void main(String[] args) throws Exception {
+ syncListStringString();
+ }
+
+ public static void syncListStringString() 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 (ForwardingRulesClient forwardingRulesClient = ForwardingRulesClient.create()) {
+ String project = "project-309310695";
+ String region = "region-934795532";
+ for (ForwardingRule element : forwardingRulesClient.list(project, region).iterateAll()) {
+ // doThingsWith(element);
+ }
+ }
+ }
+}
+// [END compute_v1_generated_ForwardingRules_List_StringString_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/patch/AsyncPatch.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/patch/AsyncPatch.java
new file mode 100644
index 000000000000..ec2ca07efa8e
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/patch/AsyncPatch.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.compute.v1.samples;
+
+// [START compute_v1_generated_ForwardingRules_Patch_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.ForwardingRule;
+import com.google.cloud.compute.v1.ForwardingRulesClient;
+import com.google.cloud.compute.v1.PatchForwardingRuleRequest;
+import com.google.longrunning.Operation;
+
+public class AsyncPatch {
+
+ public static void main(String[] args) throws Exception {
+ asyncPatch();
+ }
+
+ public static void asyncPatch() 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 (ForwardingRulesClient forwardingRulesClient = ForwardingRulesClient.create()) {
+ PatchForwardingRuleRequest request =
+ PatchForwardingRuleRequest.newBuilder()
+ .setForwardingRule("forwardingRule-1429104743")
+ .setForwardingRuleResource(ForwardingRule.newBuilder().build())
+ .setProject("project-309310695")
+ .setRegion("region-934795532")
+ .setRequestId("requestId693933066")
+ .build();
+ ApiFuture future = forwardingRulesClient.patchCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_ForwardingRules_Patch_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/patch/AsyncPatchLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/patch/AsyncPatchLRO.java
new file mode 100644
index 000000000000..30dce3625c91
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/patch/AsyncPatchLRO.java
@@ -0,0 +1,54 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_ForwardingRules_Patch_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.ForwardingRule;
+import com.google.cloud.compute.v1.ForwardingRulesClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.PatchForwardingRuleRequest;
+
+public class AsyncPatchLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncPatchLRO();
+ }
+
+ public static void asyncPatchLRO() 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 (ForwardingRulesClient forwardingRulesClient = ForwardingRulesClient.create()) {
+ PatchForwardingRuleRequest request =
+ PatchForwardingRuleRequest.newBuilder()
+ .setForwardingRule("forwardingRule-1429104743")
+ .setForwardingRuleResource(ForwardingRule.newBuilder().build())
+ .setProject("project-309310695")
+ .setRegion("region-934795532")
+ .setRequestId("requestId693933066")
+ .build();
+ OperationFuture future =
+ forwardingRulesClient.patchOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_ForwardingRules_Patch_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/patch/SyncPatch.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/patch/SyncPatch.java
new file mode 100644
index 000000000000..8565562de693
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/patch/SyncPatch.java
@@ -0,0 +1,50 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_ForwardingRules_Patch_sync]
+import com.google.cloud.compute.v1.ForwardingRule;
+import com.google.cloud.compute.v1.ForwardingRulesClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.PatchForwardingRuleRequest;
+
+public class SyncPatch {
+
+ public static void main(String[] args) throws Exception {
+ syncPatch();
+ }
+
+ public static void syncPatch() 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 (ForwardingRulesClient forwardingRulesClient = ForwardingRulesClient.create()) {
+ PatchForwardingRuleRequest request =
+ PatchForwardingRuleRequest.newBuilder()
+ .setForwardingRule("forwardingRule-1429104743")
+ .setForwardingRuleResource(ForwardingRule.newBuilder().build())
+ .setProject("project-309310695")
+ .setRegion("region-934795532")
+ .setRequestId("requestId693933066")
+ .build();
+ Operation response = forwardingRulesClient.patchAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_ForwardingRules_Patch_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/patch/SyncPatchStringStringStringForwardingrule.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/patch/SyncPatchStringStringStringForwardingrule.java
new file mode 100644
index 000000000000..665ce48a3930
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/patch/SyncPatchStringStringStringForwardingrule.java
@@ -0,0 +1,48 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_ForwardingRules_Patch_StringStringStringForwardingrule_sync]
+import com.google.cloud.compute.v1.ForwardingRule;
+import com.google.cloud.compute.v1.ForwardingRulesClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncPatchStringStringStringForwardingrule {
+
+ public static void main(String[] args) throws Exception {
+ syncPatchStringStringStringForwardingrule();
+ }
+
+ public static void syncPatchStringStringStringForwardingrule() 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 (ForwardingRulesClient forwardingRulesClient = ForwardingRulesClient.create()) {
+ String project = "project-309310695";
+ String region = "region-934795532";
+ String forwardingRule = "forwardingRule-1429104743";
+ ForwardingRule forwardingRuleResource = ForwardingRule.newBuilder().build();
+ Operation response =
+ forwardingRulesClient
+ .patchAsync(project, region, forwardingRule, forwardingRuleResource)
+ .get();
+ }
+ }
+}
+// [END compute_v1_generated_ForwardingRules_Patch_StringStringStringForwardingrule_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/setlabels/AsyncSetLabels.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/setlabels/AsyncSetLabels.java
new file mode 100644
index 000000000000..84cbd0e6ada3
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/setlabels/AsyncSetLabels.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.compute.v1.samples;
+
+// [START compute_v1_generated_ForwardingRules_SetLabels_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.ForwardingRulesClient;
+import com.google.cloud.compute.v1.RegionSetLabelsRequest;
+import com.google.cloud.compute.v1.SetLabelsForwardingRuleRequest;
+import com.google.longrunning.Operation;
+
+public class AsyncSetLabels {
+
+ public static void main(String[] args) throws Exception {
+ asyncSetLabels();
+ }
+
+ public static void asyncSetLabels() 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 (ForwardingRulesClient forwardingRulesClient = ForwardingRulesClient.create()) {
+ SetLabelsForwardingRuleRequest request =
+ SetLabelsForwardingRuleRequest.newBuilder()
+ .setProject("project-309310695")
+ .setRegion("region-934795532")
+ .setRegionSetLabelsRequestResource(RegionSetLabelsRequest.newBuilder().build())
+ .setRequestId("requestId693933066")
+ .setResource("resource-341064690")
+ .build();
+ ApiFuture future = forwardingRulesClient.setLabelsCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_ForwardingRules_SetLabels_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/setlabels/AsyncSetLabelsLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/setlabels/AsyncSetLabelsLRO.java
new file mode 100644
index 000000000000..db6535704f50
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/setlabels/AsyncSetLabelsLRO.java
@@ -0,0 +1,54 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_ForwardingRules_SetLabels_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.ForwardingRulesClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.RegionSetLabelsRequest;
+import com.google.cloud.compute.v1.SetLabelsForwardingRuleRequest;
+
+public class AsyncSetLabelsLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncSetLabelsLRO();
+ }
+
+ public static void asyncSetLabelsLRO() 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 (ForwardingRulesClient forwardingRulesClient = ForwardingRulesClient.create()) {
+ SetLabelsForwardingRuleRequest request =
+ SetLabelsForwardingRuleRequest.newBuilder()
+ .setProject("project-309310695")
+ .setRegion("region-934795532")
+ .setRegionSetLabelsRequestResource(RegionSetLabelsRequest.newBuilder().build())
+ .setRequestId("requestId693933066")
+ .setResource("resource-341064690")
+ .build();
+ OperationFuture future =
+ forwardingRulesClient.setLabelsOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_ForwardingRules_SetLabels_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/setlabels/SyncSetLabels.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/setlabels/SyncSetLabels.java
new file mode 100644
index 000000000000..df2fefdd9bf5
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/setlabels/SyncSetLabels.java
@@ -0,0 +1,50 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_ForwardingRules_SetLabels_sync]
+import com.google.cloud.compute.v1.ForwardingRulesClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.RegionSetLabelsRequest;
+import com.google.cloud.compute.v1.SetLabelsForwardingRuleRequest;
+
+public class SyncSetLabels {
+
+ public static void main(String[] args) throws Exception {
+ syncSetLabels();
+ }
+
+ public static void syncSetLabels() 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 (ForwardingRulesClient forwardingRulesClient = ForwardingRulesClient.create()) {
+ SetLabelsForwardingRuleRequest request =
+ SetLabelsForwardingRuleRequest.newBuilder()
+ .setProject("project-309310695")
+ .setRegion("region-934795532")
+ .setRegionSetLabelsRequestResource(RegionSetLabelsRequest.newBuilder().build())
+ .setRequestId("requestId693933066")
+ .setResource("resource-341064690")
+ .build();
+ Operation response = forwardingRulesClient.setLabelsAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_ForwardingRules_SetLabels_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/setlabels/SyncSetLabelsStringStringStringRegionsetlabelsrequest.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/setlabels/SyncSetLabelsStringStringStringRegionsetlabelsrequest.java
new file mode 100644
index 000000000000..1f4a78fde62a
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/setlabels/SyncSetLabelsStringStringStringRegionsetlabelsrequest.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.compute.v1.samples;
+
+// [START compute_v1_generated_ForwardingRules_SetLabels_StringStringStringRegionsetlabelsrequest_sync]
+import com.google.cloud.compute.v1.ForwardingRulesClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.RegionSetLabelsRequest;
+
+public class SyncSetLabelsStringStringStringRegionsetlabelsrequest {
+
+ public static void main(String[] args) throws Exception {
+ syncSetLabelsStringStringStringRegionsetlabelsrequest();
+ }
+
+ public static void syncSetLabelsStringStringStringRegionsetlabelsrequest() 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 (ForwardingRulesClient forwardingRulesClient = ForwardingRulesClient.create()) {
+ String project = "project-309310695";
+ String region = "region-934795532";
+ String resource = "resource-341064690";
+ RegionSetLabelsRequest regionSetLabelsRequestResource =
+ RegionSetLabelsRequest.newBuilder().build();
+ Operation response =
+ forwardingRulesClient
+ .setLabelsAsync(project, region, resource, regionSetLabelsRequestResource)
+ .get();
+ }
+ }
+}
+// [END compute_v1_generated_ForwardingRules_SetLabels_StringStringStringRegionsetlabelsrequest_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/settarget/AsyncSetTarget.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/settarget/AsyncSetTarget.java
new file mode 100644
index 000000000000..95defde4bdc4
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/settarget/AsyncSetTarget.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.compute.v1.samples;
+
+// [START compute_v1_generated_ForwardingRules_SetTarget_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.ForwardingRulesClient;
+import com.google.cloud.compute.v1.SetTargetForwardingRuleRequest;
+import com.google.cloud.compute.v1.TargetReference;
+import com.google.longrunning.Operation;
+
+public class AsyncSetTarget {
+
+ public static void main(String[] args) throws Exception {
+ asyncSetTarget();
+ }
+
+ public static void asyncSetTarget() 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 (ForwardingRulesClient forwardingRulesClient = ForwardingRulesClient.create()) {
+ SetTargetForwardingRuleRequest request =
+ SetTargetForwardingRuleRequest.newBuilder()
+ .setForwardingRule("forwardingRule-1429104743")
+ .setProject("project-309310695")
+ .setRegion("region-934795532")
+ .setRequestId("requestId693933066")
+ .setTargetReferenceResource(TargetReference.newBuilder().build())
+ .build();
+ ApiFuture future = forwardingRulesClient.setTargetCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_ForwardingRules_SetTarget_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/settarget/AsyncSetTargetLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/settarget/AsyncSetTargetLRO.java
new file mode 100644
index 000000000000..226caf3b785e
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/settarget/AsyncSetTargetLRO.java
@@ -0,0 +1,54 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_ForwardingRules_SetTarget_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.ForwardingRulesClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.SetTargetForwardingRuleRequest;
+import com.google.cloud.compute.v1.TargetReference;
+
+public class AsyncSetTargetLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncSetTargetLRO();
+ }
+
+ public static void asyncSetTargetLRO() 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 (ForwardingRulesClient forwardingRulesClient = ForwardingRulesClient.create()) {
+ SetTargetForwardingRuleRequest request =
+ SetTargetForwardingRuleRequest.newBuilder()
+ .setForwardingRule("forwardingRule-1429104743")
+ .setProject("project-309310695")
+ .setRegion("region-934795532")
+ .setRequestId("requestId693933066")
+ .setTargetReferenceResource(TargetReference.newBuilder().build())
+ .build();
+ OperationFuture future =
+ forwardingRulesClient.setTargetOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_ForwardingRules_SetTarget_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/settarget/SyncSetTarget.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/settarget/SyncSetTarget.java
new file mode 100644
index 000000000000..af69683db779
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/settarget/SyncSetTarget.java
@@ -0,0 +1,50 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_ForwardingRules_SetTarget_sync]
+import com.google.cloud.compute.v1.ForwardingRulesClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.SetTargetForwardingRuleRequest;
+import com.google.cloud.compute.v1.TargetReference;
+
+public class SyncSetTarget {
+
+ public static void main(String[] args) throws Exception {
+ syncSetTarget();
+ }
+
+ public static void syncSetTarget() 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 (ForwardingRulesClient forwardingRulesClient = ForwardingRulesClient.create()) {
+ SetTargetForwardingRuleRequest request =
+ SetTargetForwardingRuleRequest.newBuilder()
+ .setForwardingRule("forwardingRule-1429104743")
+ .setProject("project-309310695")
+ .setRegion("region-934795532")
+ .setRequestId("requestId693933066")
+ .setTargetReferenceResource(TargetReference.newBuilder().build())
+ .build();
+ Operation response = forwardingRulesClient.setTargetAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_ForwardingRules_SetTarget_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/settarget/SyncSetTargetStringStringStringTargetreference.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/settarget/SyncSetTargetStringStringStringTargetreference.java
new file mode 100644
index 000000000000..36496d5081dd
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrules/settarget/SyncSetTargetStringStringStringTargetreference.java
@@ -0,0 +1,48 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_ForwardingRules_SetTarget_StringStringStringTargetreference_sync]
+import com.google.cloud.compute.v1.ForwardingRulesClient;
+import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.TargetReference;
+
+public class SyncSetTargetStringStringStringTargetreference {
+
+ public static void main(String[] args) throws Exception {
+ syncSetTargetStringStringStringTargetreference();
+ }
+
+ public static void syncSetTargetStringStringStringTargetreference() 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 (ForwardingRulesClient forwardingRulesClient = ForwardingRulesClient.create()) {
+ String project = "project-309310695";
+ String region = "region-934795532";
+ String forwardingRule = "forwardingRule-1429104743";
+ TargetReference targetReferenceResource = TargetReference.newBuilder().build();
+ Operation response =
+ forwardingRulesClient
+ .setTargetAsync(project, region, forwardingRule, targetReferenceResource)
+ .get();
+ }
+ }
+}
+// [END compute_v1_generated_ForwardingRules_SetTarget_StringStringStringTargetreference_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrulessettings/get/SyncGet.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrulessettings/get/SyncGet.java
new file mode 100644
index 000000000000..c4a175d36c07
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/forwardingrulessettings/get/SyncGet.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.compute.v1.samples;
+
+// [START compute_v1_generated_ForwardingRulesSettings_Get_sync]
+import com.google.cloud.compute.v1.ForwardingRulesSettings;
+import java.time.Duration;
+
+public class SyncGet {
+
+ public static void main(String[] args) throws Exception {
+ syncGet();
+ }
+
+ public static void syncGet() 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
+ ForwardingRulesSettings.Builder forwardingRulesSettingsBuilder =
+ ForwardingRulesSettings.newBuilder();
+ forwardingRulesSettingsBuilder
+ .getSettings()
+ .setRetrySettings(
+ forwardingRulesSettingsBuilder
+ .getSettings()
+ .getRetrySettings()
+ .toBuilder()
+ .setTotalTimeout(Duration.ofSeconds(30))
+ .build());
+ ForwardingRulesSettings forwardingRulesSettings = forwardingRulesSettingsBuilder.build();
+ }
+}
+// [END compute_v1_generated_ForwardingRulesSettings_Get_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/globaladdresses/create/SyncCreateSetCredentialsProvider.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/globaladdresses/create/SyncCreateSetCredentialsProvider.java
new file mode 100644
index 000000000000..b3178c1a71fe
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/globaladdresses/create/SyncCreateSetCredentialsProvider.java
@@ -0,0 +1,45 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_GlobalAddresses_Create_SetCredentialsProvider_sync]
+import com.google.api.gax.core.FixedCredentialsProvider;
+import com.google.cloud.compute.v1.GlobalAddressesClient;
+import com.google.cloud.compute.v1.GlobalAddressesSettings;
+import com.google.cloud.compute.v1.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
+ GlobalAddressesSettings globalAddressesSettings =
+ GlobalAddressesSettings.newBuilder()
+ .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ .build();
+ GlobalAddressesClient globalAddressesClient =
+ GlobalAddressesClient.create(globalAddressesSettings);
+ }
+}
+// [END compute_v1_generated_GlobalAddresses_Create_SetCredentialsProvider_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/globaladdresses/create/SyncCreateSetEndpoint.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/globaladdresses/create/SyncCreateSetEndpoint.java
new file mode 100644
index 000000000000..80f464915772
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/globaladdresses/create/SyncCreateSetEndpoint.java
@@ -0,0 +1,42 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_GlobalAddresses_Create_SetEndpoint_sync]
+import com.google.cloud.compute.v1.GlobalAddressesClient;
+import com.google.cloud.compute.v1.GlobalAddressesSettings;
+import com.google.cloud.compute.v1.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
+ GlobalAddressesSettings globalAddressesSettings =
+ GlobalAddressesSettings.newBuilder().setEndpoint(myEndpoint).build();
+ GlobalAddressesClient globalAddressesClient =
+ GlobalAddressesClient.create(globalAddressesSettings);
+ }
+}
+// [END compute_v1_generated_GlobalAddresses_Create_SetEndpoint_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/globaladdresses/delete/AsyncDelete.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/globaladdresses/delete/AsyncDelete.java
new file mode 100644
index 000000000000..c5967d85defb
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/globaladdresses/delete/AsyncDelete.java
@@ -0,0 +1,50 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_GlobalAddresses_Delete_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.DeleteGlobalAddressRequest;
+import com.google.cloud.compute.v1.GlobalAddressesClient;
+import com.google.longrunning.Operation;
+
+public class AsyncDelete {
+
+ public static void main(String[] args) throws Exception {
+ asyncDelete();
+ }
+
+ public static void asyncDelete() 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 (GlobalAddressesClient globalAddressesClient = GlobalAddressesClient.create()) {
+ DeleteGlobalAddressRequest request =
+ DeleteGlobalAddressRequest.newBuilder()
+ .setAddress("address-1147692044")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ ApiFuture future = globalAddressesClient.deleteCallable().futureCall(request);
+ // Do something.
+ com.google.cloud.compute.v1.Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_GlobalAddresses_Delete_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/globaladdresses/delete/AsyncDeleteLRO.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/globaladdresses/delete/AsyncDeleteLRO.java
new file mode 100644
index 000000000000..836502968de0
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/globaladdresses/delete/AsyncDeleteLRO.java
@@ -0,0 +1,51 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_GlobalAddresses_Delete_LRO_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.compute.v1.DeleteGlobalAddressRequest;
+import com.google.cloud.compute.v1.GlobalAddressesClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class AsyncDeleteLRO {
+
+ public static void main(String[] args) throws Exception {
+ asyncDeleteLRO();
+ }
+
+ public static void asyncDeleteLRO() 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 (GlobalAddressesClient globalAddressesClient = GlobalAddressesClient.create()) {
+ DeleteGlobalAddressRequest request =
+ DeleteGlobalAddressRequest.newBuilder()
+ .setAddress("address-1147692044")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ OperationFuture future =
+ globalAddressesClient.deleteOperationCallable().futureCall(request);
+ // Do something.
+ Operation response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_GlobalAddresses_Delete_LRO_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/globaladdresses/delete/SyncDelete.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/globaladdresses/delete/SyncDelete.java
new file mode 100644
index 000000000000..cc1610a454f3
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/globaladdresses/delete/SyncDelete.java
@@ -0,0 +1,47 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_GlobalAddresses_Delete_sync]
+import com.google.cloud.compute.v1.DeleteGlobalAddressRequest;
+import com.google.cloud.compute.v1.GlobalAddressesClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncDelete {
+
+ public static void main(String[] args) throws Exception {
+ syncDelete();
+ }
+
+ public static void syncDelete() 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 (GlobalAddressesClient globalAddressesClient = GlobalAddressesClient.create()) {
+ DeleteGlobalAddressRequest request =
+ DeleteGlobalAddressRequest.newBuilder()
+ .setAddress("address-1147692044")
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ Operation response = globalAddressesClient.deleteAsync(request).get();
+ }
+ }
+}
+// [END compute_v1_generated_GlobalAddresses_Delete_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/globaladdresses/delete/SyncDeleteStringString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/globaladdresses/delete/SyncDeleteStringString.java
new file mode 100644
index 000000000000..8bfd28552c17
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/globaladdresses/delete/SyncDeleteStringString.java
@@ -0,0 +1,42 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_GlobalAddresses_Delete_StringString_sync]
+import com.google.cloud.compute.v1.GlobalAddressesClient;
+import com.google.cloud.compute.v1.Operation;
+
+public class SyncDeleteStringString {
+
+ public static void main(String[] args) throws Exception {
+ syncDeleteStringString();
+ }
+
+ public static void syncDeleteStringString() 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 (GlobalAddressesClient globalAddressesClient = GlobalAddressesClient.create()) {
+ String project = "project-309310695";
+ String address = "address-1147692044";
+ Operation response = globalAddressesClient.deleteAsync(project, address).get();
+ }
+ }
+}
+// [END compute_v1_generated_GlobalAddresses_Delete_StringString_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/globaladdresses/get/AsyncGet.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/globaladdresses/get/AsyncGet.java
new file mode 100644
index 000000000000..cc8006844f17
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/globaladdresses/get/AsyncGet.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.compute.v1.samples;
+
+// [START compute_v1_generated_GlobalAddresses_Get_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.Address;
+import com.google.cloud.compute.v1.GetGlobalAddressRequest;
+import com.google.cloud.compute.v1.GlobalAddressesClient;
+
+public class AsyncGet {
+
+ public static void main(String[] args) throws Exception {
+ asyncGet();
+ }
+
+ public static void asyncGet() 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 (GlobalAddressesClient globalAddressesClient = GlobalAddressesClient.create()) {
+ GetGlobalAddressRequest request =
+ GetGlobalAddressRequest.newBuilder()
+ .setAddress("address-1147692044")
+ .setProject("project-309310695")
+ .build();
+ ApiFuture future = globalAddressesClient.getCallable().futureCall(request);
+ // Do something.
+ Address response = future.get();
+ }
+ }
+}
+// [END compute_v1_generated_GlobalAddresses_Get_async]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/globaladdresses/get/SyncGet.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/globaladdresses/get/SyncGet.java
new file mode 100644
index 000000000000..85fbf88158d6
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/globaladdresses/get/SyncGet.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.compute.v1.samples;
+
+// [START compute_v1_generated_GlobalAddresses_Get_sync]
+import com.google.cloud.compute.v1.Address;
+import com.google.cloud.compute.v1.GetGlobalAddressRequest;
+import com.google.cloud.compute.v1.GlobalAddressesClient;
+
+public class SyncGet {
+
+ public static void main(String[] args) throws Exception {
+ syncGet();
+ }
+
+ public static void syncGet() 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 (GlobalAddressesClient globalAddressesClient = GlobalAddressesClient.create()) {
+ GetGlobalAddressRequest request =
+ GetGlobalAddressRequest.newBuilder()
+ .setAddress("address-1147692044")
+ .setProject("project-309310695")
+ .build();
+ Address response = globalAddressesClient.get(request);
+ }
+ }
+}
+// [END compute_v1_generated_GlobalAddresses_Get_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/globaladdresses/get/SyncGetStringString.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/globaladdresses/get/SyncGetStringString.java
new file mode 100644
index 000000000000..677dabec0ec2
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/globaladdresses/get/SyncGetStringString.java
@@ -0,0 +1,42 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_GlobalAddresses_Get_StringString_sync]
+import com.google.cloud.compute.v1.Address;
+import com.google.cloud.compute.v1.GlobalAddressesClient;
+
+public class SyncGetStringString {
+
+ public static void main(String[] args) throws Exception {
+ syncGetStringString();
+ }
+
+ public static void syncGetStringString() 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 (GlobalAddressesClient globalAddressesClient = GlobalAddressesClient.create()) {
+ String project = "project-309310695";
+ String address = "address-1147692044";
+ Address response = globalAddressesClient.get(project, address);
+ }
+ }
+}
+// [END compute_v1_generated_GlobalAddresses_Get_StringString_sync]
diff --git a/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/globaladdresses/insert/AsyncInsert.java b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/globaladdresses/insert/AsyncInsert.java
new file mode 100644
index 000000000000..a08415e6a91f
--- /dev/null
+++ b/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/globaladdresses/insert/AsyncInsert.java
@@ -0,0 +1,51 @@
+/*
+ * 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.compute.v1.samples;
+
+// [START compute_v1_generated_GlobalAddresses_Insert_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.compute.v1.Address;
+import com.google.cloud.compute.v1.GlobalAddressesClient;
+import com.google.cloud.compute.v1.InsertGlobalAddressRequest;
+import com.google.longrunning.Operation;
+
+public class AsyncInsert {
+
+ public static void main(String[] args) throws Exception {
+ asyncInsert();
+ }
+
+ public static void asyncInsert() 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 (GlobalAddressesClient globalAddressesClient = GlobalAddressesClient.create()) {
+ InsertGlobalAddressRequest request =
+ InsertGlobalAddressRequest.newBuilder()
+ .setAddressResource(Address.newBuilder().build())
+ .setProject("project-309310695")
+ .setRequestId("requestId693933066")
+ .build();
+ ApiFuture