All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.cloud.baremetalsolution.v2.stub.HttpJsonBareMetalSolutionStub Maven / Gradle / Ivy

Go to download

Bare Metal SOlution Bring your Oracle workloads to Google Cloud with Bare Metal Solution and jumpstart your cloud journey with minimal risk.

There is a newer version: 0.55.0
Show newest version
/*
 * Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.cloud.baremetalsolution.v2.stub;

import static com.google.cloud.baremetalsolution.v2.BareMetalSolutionClient.ListInstancesPagedResponse;
import static com.google.cloud.baremetalsolution.v2.BareMetalSolutionClient.ListLocationsPagedResponse;
import static com.google.cloud.baremetalsolution.v2.BareMetalSolutionClient.ListLunsPagedResponse;
import static com.google.cloud.baremetalsolution.v2.BareMetalSolutionClient.ListNetworksPagedResponse;
import static com.google.cloud.baremetalsolution.v2.BareMetalSolutionClient.ListNfsSharesPagedResponse;
import static com.google.cloud.baremetalsolution.v2.BareMetalSolutionClient.ListOSImagesPagedResponse;
import static com.google.cloud.baremetalsolution.v2.BareMetalSolutionClient.ListProvisioningQuotasPagedResponse;
import static com.google.cloud.baremetalsolution.v2.BareMetalSolutionClient.ListSSHKeysPagedResponse;
import static com.google.cloud.baremetalsolution.v2.BareMetalSolutionClient.ListVolumeSnapshotsPagedResponse;
import static com.google.cloud.baremetalsolution.v2.BareMetalSolutionClient.ListVolumesPagedResponse;

import com.google.api.core.InternalApi;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.core.BackgroundResourceAggregation;
import com.google.api.gax.httpjson.ApiMethodDescriptor;
import com.google.api.gax.httpjson.HttpJsonCallSettings;
import com.google.api.gax.httpjson.HttpJsonOperationSnapshot;
import com.google.api.gax.httpjson.HttpJsonStubCallableFactory;
import com.google.api.gax.httpjson.ProtoMessageRequestFormatter;
import com.google.api.gax.httpjson.ProtoMessageResponseParser;
import com.google.api.gax.httpjson.ProtoRestSerializer;
import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.OperationCallable;
import com.google.api.gax.rpc.RequestParamsBuilder;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.baremetalsolution.v2.CreateNfsShareRequest;
import com.google.cloud.baremetalsolution.v2.CreateProvisioningConfigRequest;
import com.google.cloud.baremetalsolution.v2.CreateSSHKeyRequest;
import com.google.cloud.baremetalsolution.v2.CreateVolumeSnapshotRequest;
import com.google.cloud.baremetalsolution.v2.DeleteNfsShareRequest;
import com.google.cloud.baremetalsolution.v2.DeleteSSHKeyRequest;
import com.google.cloud.baremetalsolution.v2.DeleteVolumeSnapshotRequest;
import com.google.cloud.baremetalsolution.v2.DetachLunRequest;
import com.google.cloud.baremetalsolution.v2.DisableInteractiveSerialConsoleRequest;
import com.google.cloud.baremetalsolution.v2.DisableInteractiveSerialConsoleResponse;
import com.google.cloud.baremetalsolution.v2.EnableInteractiveSerialConsoleRequest;
import com.google.cloud.baremetalsolution.v2.EnableInteractiveSerialConsoleResponse;
import com.google.cloud.baremetalsolution.v2.EvictLunRequest;
import com.google.cloud.baremetalsolution.v2.EvictVolumeRequest;
import com.google.cloud.baremetalsolution.v2.GetInstanceRequest;
import com.google.cloud.baremetalsolution.v2.GetLunRequest;
import com.google.cloud.baremetalsolution.v2.GetNetworkRequest;
import com.google.cloud.baremetalsolution.v2.GetNfsShareRequest;
import com.google.cloud.baremetalsolution.v2.GetProvisioningConfigRequest;
import com.google.cloud.baremetalsolution.v2.GetVolumeRequest;
import com.google.cloud.baremetalsolution.v2.GetVolumeSnapshotRequest;
import com.google.cloud.baremetalsolution.v2.Instance;
import com.google.cloud.baremetalsolution.v2.ListInstancesRequest;
import com.google.cloud.baremetalsolution.v2.ListInstancesResponse;
import com.google.cloud.baremetalsolution.v2.ListLunsRequest;
import com.google.cloud.baremetalsolution.v2.ListLunsResponse;
import com.google.cloud.baremetalsolution.v2.ListNetworkUsageRequest;
import com.google.cloud.baremetalsolution.v2.ListNetworkUsageResponse;
import com.google.cloud.baremetalsolution.v2.ListNetworksRequest;
import com.google.cloud.baremetalsolution.v2.ListNetworksResponse;
import com.google.cloud.baremetalsolution.v2.ListNfsSharesRequest;
import com.google.cloud.baremetalsolution.v2.ListNfsSharesResponse;
import com.google.cloud.baremetalsolution.v2.ListOSImagesRequest;
import com.google.cloud.baremetalsolution.v2.ListOSImagesResponse;
import com.google.cloud.baremetalsolution.v2.ListProvisioningQuotasRequest;
import com.google.cloud.baremetalsolution.v2.ListProvisioningQuotasResponse;
import com.google.cloud.baremetalsolution.v2.ListSSHKeysRequest;
import com.google.cloud.baremetalsolution.v2.ListSSHKeysResponse;
import com.google.cloud.baremetalsolution.v2.ListVolumeSnapshotsRequest;
import com.google.cloud.baremetalsolution.v2.ListVolumeSnapshotsResponse;
import com.google.cloud.baremetalsolution.v2.ListVolumesRequest;
import com.google.cloud.baremetalsolution.v2.ListVolumesResponse;
import com.google.cloud.baremetalsolution.v2.Lun;
import com.google.cloud.baremetalsolution.v2.Network;
import com.google.cloud.baremetalsolution.v2.NfsShare;
import com.google.cloud.baremetalsolution.v2.OperationMetadata;
import com.google.cloud.baremetalsolution.v2.ProvisioningConfig;
import com.google.cloud.baremetalsolution.v2.RenameInstanceRequest;
import com.google.cloud.baremetalsolution.v2.RenameNetworkRequest;
import com.google.cloud.baremetalsolution.v2.RenameNfsShareRequest;
import com.google.cloud.baremetalsolution.v2.RenameVolumeRequest;
import com.google.cloud.baremetalsolution.v2.ResetInstanceRequest;
import com.google.cloud.baremetalsolution.v2.ResetInstanceResponse;
import com.google.cloud.baremetalsolution.v2.ResizeVolumeRequest;
import com.google.cloud.baremetalsolution.v2.RestoreVolumeSnapshotRequest;
import com.google.cloud.baremetalsolution.v2.SSHKey;
import com.google.cloud.baremetalsolution.v2.StartInstanceRequest;
import com.google.cloud.baremetalsolution.v2.StartInstanceResponse;
import com.google.cloud.baremetalsolution.v2.StopInstanceRequest;
import com.google.cloud.baremetalsolution.v2.StopInstanceResponse;
import com.google.cloud.baremetalsolution.v2.SubmitProvisioningConfigRequest;
import com.google.cloud.baremetalsolution.v2.SubmitProvisioningConfigResponse;
import com.google.cloud.baremetalsolution.v2.UpdateInstanceRequest;
import com.google.cloud.baremetalsolution.v2.UpdateNetworkRequest;
import com.google.cloud.baremetalsolution.v2.UpdateNfsShareRequest;
import com.google.cloud.baremetalsolution.v2.UpdateProvisioningConfigRequest;
import com.google.cloud.baremetalsolution.v2.UpdateVolumeRequest;
import com.google.cloud.baremetalsolution.v2.Volume;
import com.google.cloud.baremetalsolution.v2.VolumeSnapshot;
import com.google.cloud.location.GetLocationRequest;
import com.google.cloud.location.ListLocationsRequest;
import com.google.cloud.location.ListLocationsResponse;
import com.google.cloud.location.Location;
import com.google.longrunning.Operation;
import com.google.protobuf.Empty;
import com.google.protobuf.TypeRegistry;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import javax.annotation.Generated;

// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
 * REST stub implementation for the BareMetalSolution service API.
 *
 * 

This class is for advanced usage and reflects the underlying API directly. */ @Generated("by gapic-generator-java") public class HttpJsonBareMetalSolutionStub extends BareMetalSolutionStub { private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder() .add(StartInstanceResponse.getDescriptor()) .add(ResetInstanceResponse.getDescriptor()) .add(Empty.getDescriptor()) .add(Volume.getDescriptor()) .add(StopInstanceResponse.getDescriptor()) .add(EnableInteractiveSerialConsoleResponse.getDescriptor()) .add(NfsShare.getDescriptor()) .add(OperationMetadata.getDescriptor()) .add(VolumeSnapshot.getDescriptor()) .add(Instance.getDescriptor()) .add(DisableInteractiveSerialConsoleResponse.getDescriptor()) .add(Network.getDescriptor()) .build(); private static final ApiMethodDescriptor listInstancesMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName( "google.cloud.baremetalsolution.v2.BareMetalSolution/ListInstances") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{parent=projects/*/locations/*}/instances", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "parent", request.getParent()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "filter", request.getFilter()); serializer.putQueryParam(fields, "pageSize", request.getPageSize()); serializer.putQueryParam(fields, "pageToken", request.getPageToken()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(ListInstancesResponse.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor getInstanceMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.baremetalsolution.v2.BareMetalSolution/GetInstance") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{name=projects/*/locations/*/instances/*}", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "name", request.getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Instance.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor updateInstanceMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName( "google.cloud.baremetalsolution.v2.BareMetalSolution/UpdateInstance") .setHttpMethod("PATCH") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{instance.name=projects/*/locations/*/instances/*}", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam( fields, "instance.name", request.getInstance().getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("instance", request.getInstance(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Operation.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .setOperationSnapshotFactory( (UpdateInstanceRequest request, Operation response) -> HttpJsonOperationSnapshot.create(response)) .build(); private static final ApiMethodDescriptor renameInstanceMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName( "google.cloud.baremetalsolution.v2.BareMetalSolution/RenameInstance") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{name=projects/*/locations/*/instances/*}:rename", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "name", request.getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("*", request.toBuilder().clearName().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Instance.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor resetInstanceMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName( "google.cloud.baremetalsolution.v2.BareMetalSolution/ResetInstance") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{name=projects/*/locations/*/instances/*}:reset", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "name", request.getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("*", request.toBuilder().clearName().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Operation.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .setOperationSnapshotFactory( (ResetInstanceRequest request, Operation response) -> HttpJsonOperationSnapshot.create(response)) .build(); private static final ApiMethodDescriptor startInstanceMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName( "google.cloud.baremetalsolution.v2.BareMetalSolution/StartInstance") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{name=projects/*/locations/*/instances/*}:start", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "name", request.getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("*", request.toBuilder().clearName().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Operation.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .setOperationSnapshotFactory( (StartInstanceRequest request, Operation response) -> HttpJsonOperationSnapshot.create(response)) .build(); private static final ApiMethodDescriptor stopInstanceMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.baremetalsolution.v2.BareMetalSolution/StopInstance") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{name=projects/*/locations/*/instances/*}:stop", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "name", request.getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("*", request.toBuilder().clearName().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Operation.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .setOperationSnapshotFactory( (StopInstanceRequest request, Operation response) -> HttpJsonOperationSnapshot.create(response)) .build(); private static final ApiMethodDescriptor enableInteractiveSerialConsoleMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName( "google.cloud.baremetalsolution.v2.BareMetalSolution/EnableInteractiveSerialConsole") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{name=projects/*/locations/*/instances/*}:enableInteractiveSerialConsole", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "name", request.getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("*", request.toBuilder().clearName().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Operation.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .setOperationSnapshotFactory( (EnableInteractiveSerialConsoleRequest request, Operation response) -> HttpJsonOperationSnapshot.create(response)) .build(); private static final ApiMethodDescriptor disableInteractiveSerialConsoleMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName( "google.cloud.baremetalsolution.v2.BareMetalSolution/DisableInteractiveSerialConsole") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{name=projects/*/locations/*/instances/*}:disableInteractiveSerialConsole", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "name", request.getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("*", request.toBuilder().clearName().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Operation.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .setOperationSnapshotFactory( (DisableInteractiveSerialConsoleRequest request, Operation response) -> HttpJsonOperationSnapshot.create(response)) .build(); private static final ApiMethodDescriptor detachLunMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.baremetalsolution.v2.BareMetalSolution/DetachLun") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{instance=projects/*/locations/*/instances/*}:detachLun", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "instance", request.getInstance()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("*", request.toBuilder().clearInstance().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Operation.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .setOperationSnapshotFactory( (DetachLunRequest request, Operation response) -> HttpJsonOperationSnapshot.create(response)) .build(); private static final ApiMethodDescriptor listSSHKeysMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.baremetalsolution.v2.BareMetalSolution/ListSSHKeys") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{parent=projects/*/locations/*}/sshKeys", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "parent", request.getParent()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "pageSize", request.getPageSize()); serializer.putQueryParam(fields, "pageToken", request.getPageToken()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(ListSSHKeysResponse.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor createSSHKeyMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.baremetalsolution.v2.BareMetalSolution/CreateSSHKey") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{parent=projects/*/locations/*}/sshKeys", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "parent", request.getParent()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "sshKeyId", request.getSshKeyId()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("sshKey", request.getSshKey(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(SSHKey.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor deleteSSHKeyMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.baremetalsolution.v2.BareMetalSolution/DeleteSSHKey") .setHttpMethod("DELETE") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{name=projects/*/locations/*/sshKeys/*}", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "name", request.getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Empty.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor listVolumesMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.baremetalsolution.v2.BareMetalSolution/ListVolumes") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{parent=projects/*/locations/*}/volumes", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "parent", request.getParent()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "filter", request.getFilter()); serializer.putQueryParam(fields, "pageSize", request.getPageSize()); serializer.putQueryParam(fields, "pageToken", request.getPageToken()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(ListVolumesResponse.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor getVolumeMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.baremetalsolution.v2.BareMetalSolution/GetVolume") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{name=projects/*/locations/*/volumes/*}", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "name", request.getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Volume.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor updateVolumeMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.baremetalsolution.v2.BareMetalSolution/UpdateVolume") .setHttpMethod("PATCH") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{volume.name=projects/*/locations/*/volumes/*}", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam( fields, "volume.name", request.getVolume().getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("volume", request.getVolume(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Operation.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .setOperationSnapshotFactory( (UpdateVolumeRequest request, Operation response) -> HttpJsonOperationSnapshot.create(response)) .build(); private static final ApiMethodDescriptor renameVolumeMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.baremetalsolution.v2.BareMetalSolution/RenameVolume") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{name=projects/*/locations/*/volumes/*}:rename", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "name", request.getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("*", request.toBuilder().clearName().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Volume.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor evictVolumeMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.baremetalsolution.v2.BareMetalSolution/EvictVolume") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{name=projects/*/locations/*/volumes/*}:evict", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "name", request.getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("*", request.toBuilder().clearName().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Operation.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .setOperationSnapshotFactory( (EvictVolumeRequest request, Operation response) -> HttpJsonOperationSnapshot.create(response)) .build(); private static final ApiMethodDescriptor resizeVolumeMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.baremetalsolution.v2.BareMetalSolution/ResizeVolume") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{volume=projects/*/locations/*/volumes/*}:resize", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "volume", request.getVolume()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("*", request.toBuilder().clearVolume().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Operation.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .setOperationSnapshotFactory( (ResizeVolumeRequest request, Operation response) -> HttpJsonOperationSnapshot.create(response)) .build(); private static final ApiMethodDescriptor listNetworksMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.baremetalsolution.v2.BareMetalSolution/ListNetworks") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{parent=projects/*/locations/*}/networks", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "parent", request.getParent()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "filter", request.getFilter()); serializer.putQueryParam(fields, "pageSize", request.getPageSize()); serializer.putQueryParam(fields, "pageToken", request.getPageToken()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(ListNetworksResponse.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor listNetworkUsageMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName( "google.cloud.baremetalsolution.v2.BareMetalSolution/ListNetworkUsage") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{location=projects/*/locations/*}/networks:listNetworkUsage", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "location", request.getLocation()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(ListNetworkUsageResponse.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor getNetworkMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.baremetalsolution.v2.BareMetalSolution/GetNetwork") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{name=projects/*/locations/*/networks/*}", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "name", request.getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Network.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor updateNetworkMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName( "google.cloud.baremetalsolution.v2.BareMetalSolution/UpdateNetwork") .setHttpMethod("PATCH") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{network.name=projects/*/locations/*/networks/*}", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam( fields, "network.name", request.getNetwork().getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("network", request.getNetwork(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Operation.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .setOperationSnapshotFactory( (UpdateNetworkRequest request, Operation response) -> HttpJsonOperationSnapshot.create(response)) .build(); private static final ApiMethodDescriptor createVolumeSnapshotMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName( "google.cloud.baremetalsolution.v2.BareMetalSolution/CreateVolumeSnapshot") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{parent=projects/*/locations/*/volumes/*}/snapshots", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "parent", request.getParent()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("volumeSnapshot", request.getVolumeSnapshot(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(VolumeSnapshot.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor restoreVolumeSnapshotMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName( "google.cloud.baremetalsolution.v2.BareMetalSolution/RestoreVolumeSnapshot") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{volumeSnapshot=projects/*/locations/*/volumes/*/snapshots/*}:restoreVolumeSnapshot", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam( fields, "volumeSnapshot", request.getVolumeSnapshot()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody( "*", request.toBuilder().clearVolumeSnapshot().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Operation.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .setOperationSnapshotFactory( (RestoreVolumeSnapshotRequest request, Operation response) -> HttpJsonOperationSnapshot.create(response)) .build(); private static final ApiMethodDescriptor deleteVolumeSnapshotMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName( "google.cloud.baremetalsolution.v2.BareMetalSolution/DeleteVolumeSnapshot") .setHttpMethod("DELETE") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{name=projects/*/locations/*/volumes/*/snapshots/*}", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "name", request.getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Empty.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor getVolumeSnapshotMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName( "google.cloud.baremetalsolution.v2.BareMetalSolution/GetVolumeSnapshot") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{name=projects/*/locations/*/volumes/*/snapshots/*}", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "name", request.getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(VolumeSnapshot.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor listVolumeSnapshotsMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName( "google.cloud.baremetalsolution.v2.BareMetalSolution/ListVolumeSnapshots") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{parent=projects/*/locations/*/volumes/*}/snapshots", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "parent", request.getParent()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "pageSize", request.getPageSize()); serializer.putQueryParam(fields, "pageToken", request.getPageToken()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(ListVolumeSnapshotsResponse.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor getLunMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.baremetalsolution.v2.BareMetalSolution/GetLun") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{name=projects/*/locations/*/volumes/*/luns/*}", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "name", request.getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Lun.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor listLunsMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.baremetalsolution.v2.BareMetalSolution/ListLuns") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{parent=projects/*/locations/*/volumes/*}/luns", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "parent", request.getParent()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "pageSize", request.getPageSize()); serializer.putQueryParam(fields, "pageToken", request.getPageToken()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(ListLunsResponse.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor evictLunMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.baremetalsolution.v2.BareMetalSolution/EvictLun") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{name=projects/*/locations/*/volumes/*/luns/*}:evict", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "name", request.getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("*", request.toBuilder().clearName().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Operation.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .setOperationSnapshotFactory( (EvictLunRequest request, Operation response) -> HttpJsonOperationSnapshot.create(response)) .build(); private static final ApiMethodDescriptor getNfsShareMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.baremetalsolution.v2.BareMetalSolution/GetNfsShare") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{name=projects/*/locations/*/nfsShares/*}", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "name", request.getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(NfsShare.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor listNfsSharesMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName( "google.cloud.baremetalsolution.v2.BareMetalSolution/ListNfsShares") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{parent=projects/*/locations/*}/nfsShares", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "parent", request.getParent()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "filter", request.getFilter()); serializer.putQueryParam(fields, "pageSize", request.getPageSize()); serializer.putQueryParam(fields, "pageToken", request.getPageToken()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(ListNfsSharesResponse.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor updateNfsShareMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName( "google.cloud.baremetalsolution.v2.BareMetalSolution/UpdateNfsShare") .setHttpMethod("PATCH") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{nfsShare.name=projects/*/locations/*/nfsShares/*}", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam( fields, "nfsShare.name", request.getNfsShare().getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("nfsShare", request.getNfsShare(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Operation.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .setOperationSnapshotFactory( (UpdateNfsShareRequest request, Operation response) -> HttpJsonOperationSnapshot.create(response)) .build(); private static final ApiMethodDescriptor createNfsShareMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName( "google.cloud.baremetalsolution.v2.BareMetalSolution/CreateNfsShare") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{parent=projects/*/locations/*}/nfsShares", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "parent", request.getParent()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("nfsShare", request.getNfsShare(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Operation.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .setOperationSnapshotFactory( (CreateNfsShareRequest request, Operation response) -> HttpJsonOperationSnapshot.create(response)) .build(); private static final ApiMethodDescriptor renameNfsShareMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName( "google.cloud.baremetalsolution.v2.BareMetalSolution/RenameNfsShare") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{name=projects/*/locations/*/nfsShares/*}:rename", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "name", request.getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("*", request.toBuilder().clearName().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(NfsShare.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor deleteNfsShareMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName( "google.cloud.baremetalsolution.v2.BareMetalSolution/DeleteNfsShare") .setHttpMethod("DELETE") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{name=projects/*/locations/*/nfsShares/*}", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "name", request.getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Operation.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .setOperationSnapshotFactory( (DeleteNfsShareRequest request, Operation response) -> HttpJsonOperationSnapshot.create(response)) .build(); private static final ApiMethodDescriptor< ListProvisioningQuotasRequest, ListProvisioningQuotasResponse> listProvisioningQuotasMethodDescriptor = ApiMethodDescriptor .newBuilder() .setFullMethodName( "google.cloud.baremetalsolution.v2.BareMetalSolution/ListProvisioningQuotas") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{parent=projects/*/locations/*}/provisioningQuotas", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "parent", request.getParent()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "pageSize", request.getPageSize()); serializer.putQueryParam(fields, "pageToken", request.getPageToken()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(ListProvisioningQuotasResponse.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor< SubmitProvisioningConfigRequest, SubmitProvisioningConfigResponse> submitProvisioningConfigMethodDescriptor = ApiMethodDescriptor .newBuilder() .setFullMethodName( "google.cloud.baremetalsolution.v2.BareMetalSolution/SubmitProvisioningConfig") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{parent=projects/*/locations/*}/provisioningConfigs:submit", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "parent", request.getParent()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("*", request.toBuilder().clearParent().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(SubmitProvisioningConfigResponse.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor getProvisioningConfigMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName( "google.cloud.baremetalsolution.v2.BareMetalSolution/GetProvisioningConfig") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{name=projects/*/locations/*/provisioningConfigs/*}", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "name", request.getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(ProvisioningConfig.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor createProvisioningConfigMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName( "google.cloud.baremetalsolution.v2.BareMetalSolution/CreateProvisioningConfig") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{parent=projects/*/locations/*}/provisioningConfigs", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "parent", request.getParent()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "email", request.getEmail()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody( "provisioningConfig", request.getProvisioningConfig(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(ProvisioningConfig.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor updateProvisioningConfigMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName( "google.cloud.baremetalsolution.v2.BareMetalSolution/UpdateProvisioningConfig") .setHttpMethod("PATCH") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{provisioningConfig.name=projects/*/locations/*/provisioningConfigs/*}", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam( fields, "provisioningConfig.name", request.getProvisioningConfig().getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "email", request.getEmail()); serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody( "provisioningConfig", request.getProvisioningConfig(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(ProvisioningConfig.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor renameNetworkMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName( "google.cloud.baremetalsolution.v2.BareMetalSolution/RenameNetwork") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{name=projects/*/locations/*/networks/*}:rename", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "name", request.getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("*", request.toBuilder().clearName().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Network.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor listOSImagesMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.baremetalsolution.v2.BareMetalSolution/ListOSImages") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{parent=projects/*/locations/*}/osImages", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "parent", request.getParent()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "pageSize", request.getPageSize()); serializer.putQueryParam(fields, "pageToken", request.getPageToken()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(ListOSImagesResponse.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor listLocationsMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.location.Locations/ListLocations") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{name=projects/*}/locations", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "name", request.getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor getLocationMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.location.Locations/GetLocation") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v2/{name=projects/*/locations/*}", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "name", request.getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Location.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private final UnaryCallable listInstancesCallable; private final UnaryCallable listInstancesPagedCallable; private final UnaryCallable getInstanceCallable; private final UnaryCallable updateInstanceCallable; private final OperationCallable updateInstanceOperationCallable; private final UnaryCallable renameInstanceCallable; private final UnaryCallable resetInstanceCallable; private final OperationCallable resetInstanceOperationCallable; private final UnaryCallable startInstanceCallable; private final OperationCallable startInstanceOperationCallable; private final UnaryCallable stopInstanceCallable; private final OperationCallable stopInstanceOperationCallable; private final UnaryCallable enableInteractiveSerialConsoleCallable; private final OperationCallable< EnableInteractiveSerialConsoleRequest, EnableInteractiveSerialConsoleResponse, OperationMetadata> enableInteractiveSerialConsoleOperationCallable; private final UnaryCallable disableInteractiveSerialConsoleCallable; private final OperationCallable< DisableInteractiveSerialConsoleRequest, DisableInteractiveSerialConsoleResponse, OperationMetadata> disableInteractiveSerialConsoleOperationCallable; private final UnaryCallable detachLunCallable; private final OperationCallable detachLunOperationCallable; private final UnaryCallable listSSHKeysCallable; private final UnaryCallable listSSHKeysPagedCallable; private final UnaryCallable createSSHKeyCallable; private final UnaryCallable deleteSSHKeyCallable; private final UnaryCallable listVolumesCallable; private final UnaryCallable listVolumesPagedCallable; private final UnaryCallable getVolumeCallable; private final UnaryCallable updateVolumeCallable; private final OperationCallable updateVolumeOperationCallable; private final UnaryCallable renameVolumeCallable; private final UnaryCallable evictVolumeCallable; private final OperationCallable evictVolumeOperationCallable; private final UnaryCallable resizeVolumeCallable; private final OperationCallable resizeVolumeOperationCallable; private final UnaryCallable listNetworksCallable; private final UnaryCallable listNetworksPagedCallable; private final UnaryCallable listNetworkUsageCallable; private final UnaryCallable getNetworkCallable; private final UnaryCallable updateNetworkCallable; private final OperationCallable updateNetworkOperationCallable; private final UnaryCallable createVolumeSnapshotCallable; private final UnaryCallable restoreVolumeSnapshotCallable; private final OperationCallable restoreVolumeSnapshotOperationCallable; private final UnaryCallable deleteVolumeSnapshotCallable; private final UnaryCallable getVolumeSnapshotCallable; private final UnaryCallable listVolumeSnapshotsCallable; private final UnaryCallable listVolumeSnapshotsPagedCallable; private final UnaryCallable getLunCallable; private final UnaryCallable listLunsCallable; private final UnaryCallable listLunsPagedCallable; private final UnaryCallable evictLunCallable; private final OperationCallable evictLunOperationCallable; private final UnaryCallable getNfsShareCallable; private final UnaryCallable listNfsSharesCallable; private final UnaryCallable listNfsSharesPagedCallable; private final UnaryCallable updateNfsShareCallable; private final OperationCallable updateNfsShareOperationCallable; private final UnaryCallable createNfsShareCallable; private final OperationCallable createNfsShareOperationCallable; private final UnaryCallable renameNfsShareCallable; private final UnaryCallable deleteNfsShareCallable; private final OperationCallable deleteNfsShareOperationCallable; private final UnaryCallable listProvisioningQuotasCallable; private final UnaryCallable listProvisioningQuotasPagedCallable; private final UnaryCallable submitProvisioningConfigCallable; private final UnaryCallable getProvisioningConfigCallable; private final UnaryCallable createProvisioningConfigCallable; private final UnaryCallable updateProvisioningConfigCallable; private final UnaryCallable renameNetworkCallable; private final UnaryCallable listOSImagesCallable; private final UnaryCallable listOSImagesPagedCallable; private final UnaryCallable listLocationsCallable; private final UnaryCallable listLocationsPagedCallable; private final UnaryCallable getLocationCallable; private final BackgroundResource backgroundResources; private final HttpJsonOperationsStub httpJsonOperationsStub; private final HttpJsonStubCallableFactory callableFactory; public static final HttpJsonBareMetalSolutionStub create(BareMetalSolutionStubSettings settings) throws IOException { return new HttpJsonBareMetalSolutionStub(settings, ClientContext.create(settings)); } public static final HttpJsonBareMetalSolutionStub create(ClientContext clientContext) throws IOException { return new HttpJsonBareMetalSolutionStub( BareMetalSolutionStubSettings.newHttpJsonBuilder().build(), clientContext); } public static final HttpJsonBareMetalSolutionStub create( ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { return new HttpJsonBareMetalSolutionStub( BareMetalSolutionStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); } /** * Constructs an instance of HttpJsonBareMetalSolutionStub, using the given settings. This is * protected so that it is easy to make a subclass, but otherwise, the static factory methods * should be preferred. */ protected HttpJsonBareMetalSolutionStub( BareMetalSolutionStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new HttpJsonBareMetalSolutionCallableFactory()); } /** * Constructs an instance of HttpJsonBareMetalSolutionStub, using the given settings. This is * protected so that it is easy to make a subclass, but otherwise, the static factory methods * should be preferred. */ protected HttpJsonBareMetalSolutionStub( BareMetalSolutionStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { this.callableFactory = callableFactory; this.httpJsonOperationsStub = HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); HttpJsonCallSettings listInstancesTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listInstancesMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); HttpJsonCallSettings getInstanceTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getInstanceMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings updateInstanceTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(updateInstanceMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("instance.name", String.valueOf(request.getInstance().getName())); return builder.build(); }) .build(); HttpJsonCallSettings renameInstanceTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(renameInstanceMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings resetInstanceTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(resetInstanceMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings startInstanceTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(startInstanceMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings stopInstanceTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(stopInstanceMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings enableInteractiveSerialConsoleTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(enableInteractiveSerialConsoleMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings disableInteractiveSerialConsoleTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(disableInteractiveSerialConsoleMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings detachLunTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(detachLunMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("instance", String.valueOf(request.getInstance())); return builder.build(); }) .build(); HttpJsonCallSettings listSSHKeysTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listSSHKeysMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); HttpJsonCallSettings createSSHKeyTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(createSSHKeyMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); HttpJsonCallSettings deleteSSHKeyTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(deleteSSHKeyMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings listVolumesTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listVolumesMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); HttpJsonCallSettings getVolumeTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getVolumeMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings updateVolumeTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(updateVolumeMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("volume.name", String.valueOf(request.getVolume().getName())); return builder.build(); }) .build(); HttpJsonCallSettings renameVolumeTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(renameVolumeMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings evictVolumeTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(evictVolumeMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings resizeVolumeTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(resizeVolumeMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("volume", String.valueOf(request.getVolume())); return builder.build(); }) .build(); HttpJsonCallSettings listNetworksTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listNetworksMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); HttpJsonCallSettings listNetworkUsageTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listNetworkUsageMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("location", String.valueOf(request.getLocation())); return builder.build(); }) .build(); HttpJsonCallSettings getNetworkTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getNetworkMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings updateNetworkTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(updateNetworkMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("network.name", String.valueOf(request.getNetwork().getName())); return builder.build(); }) .build(); HttpJsonCallSettings createVolumeSnapshotTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(createVolumeSnapshotMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); HttpJsonCallSettings restoreVolumeSnapshotTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(restoreVolumeSnapshotMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("volume_snapshot", String.valueOf(request.getVolumeSnapshot())); return builder.build(); }) .build(); HttpJsonCallSettings deleteVolumeSnapshotTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(deleteVolumeSnapshotMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings getVolumeSnapshotTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getVolumeSnapshotMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings listVolumeSnapshotsTransportSettings = HttpJsonCallSettings .newBuilder() .setMethodDescriptor(listVolumeSnapshotsMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); HttpJsonCallSettings getLunTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getLunMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings listLunsTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listLunsMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); HttpJsonCallSettings evictLunTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(evictLunMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings getNfsShareTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getNfsShareMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings listNfsSharesTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listNfsSharesMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); HttpJsonCallSettings updateNfsShareTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(updateNfsShareMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("nfs_share.name", String.valueOf(request.getNfsShare().getName())); return builder.build(); }) .build(); HttpJsonCallSettings createNfsShareTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(createNfsShareMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); HttpJsonCallSettings renameNfsShareTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(renameNfsShareMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings deleteNfsShareTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(deleteNfsShareMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings listProvisioningQuotasTransportSettings = HttpJsonCallSettings .newBuilder() .setMethodDescriptor(listProvisioningQuotasMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); HttpJsonCallSettings submitProvisioningConfigTransportSettings = HttpJsonCallSettings .newBuilder() .setMethodDescriptor(submitProvisioningConfigMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); HttpJsonCallSettings getProvisioningConfigTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getProvisioningConfigMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings createProvisioningConfigTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(createProvisioningConfigMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); HttpJsonCallSettings updateProvisioningConfigTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(updateProvisioningConfigMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add( "provisioning_config.name", String.valueOf(request.getProvisioningConfig().getName())); return builder.build(); }) .build(); HttpJsonCallSettings renameNetworkTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(renameNetworkMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings listOSImagesTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listOSImagesMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); HttpJsonCallSettings listLocationsTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listLocationsMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings getLocationTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getLocationMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); this.listInstancesCallable = callableFactory.createUnaryCallable( listInstancesTransportSettings, settings.listInstancesSettings(), clientContext); this.listInstancesPagedCallable = callableFactory.createPagedCallable( listInstancesTransportSettings, settings.listInstancesSettings(), clientContext); this.getInstanceCallable = callableFactory.createUnaryCallable( getInstanceTransportSettings, settings.getInstanceSettings(), clientContext); this.updateInstanceCallable = callableFactory.createUnaryCallable( updateInstanceTransportSettings, settings.updateInstanceSettings(), clientContext); this.updateInstanceOperationCallable = callableFactory.createOperationCallable( updateInstanceTransportSettings, settings.updateInstanceOperationSettings(), clientContext, httpJsonOperationsStub); this.renameInstanceCallable = callableFactory.createUnaryCallable( renameInstanceTransportSettings, settings.renameInstanceSettings(), clientContext); this.resetInstanceCallable = callableFactory.createUnaryCallable( resetInstanceTransportSettings, settings.resetInstanceSettings(), clientContext); this.resetInstanceOperationCallable = callableFactory.createOperationCallable( resetInstanceTransportSettings, settings.resetInstanceOperationSettings(), clientContext, httpJsonOperationsStub); this.startInstanceCallable = callableFactory.createUnaryCallable( startInstanceTransportSettings, settings.startInstanceSettings(), clientContext); this.startInstanceOperationCallable = callableFactory.createOperationCallable( startInstanceTransportSettings, settings.startInstanceOperationSettings(), clientContext, httpJsonOperationsStub); this.stopInstanceCallable = callableFactory.createUnaryCallable( stopInstanceTransportSettings, settings.stopInstanceSettings(), clientContext); this.stopInstanceOperationCallable = callableFactory.createOperationCallable( stopInstanceTransportSettings, settings.stopInstanceOperationSettings(), clientContext, httpJsonOperationsStub); this.enableInteractiveSerialConsoleCallable = callableFactory.createUnaryCallable( enableInteractiveSerialConsoleTransportSettings, settings.enableInteractiveSerialConsoleSettings(), clientContext); this.enableInteractiveSerialConsoleOperationCallable = callableFactory.createOperationCallable( enableInteractiveSerialConsoleTransportSettings, settings.enableInteractiveSerialConsoleOperationSettings(), clientContext, httpJsonOperationsStub); this.disableInteractiveSerialConsoleCallable = callableFactory.createUnaryCallable( disableInteractiveSerialConsoleTransportSettings, settings.disableInteractiveSerialConsoleSettings(), clientContext); this.disableInteractiveSerialConsoleOperationCallable = callableFactory.createOperationCallable( disableInteractiveSerialConsoleTransportSettings, settings.disableInteractiveSerialConsoleOperationSettings(), clientContext, httpJsonOperationsStub); this.detachLunCallable = callableFactory.createUnaryCallable( detachLunTransportSettings, settings.detachLunSettings(), clientContext); this.detachLunOperationCallable = callableFactory.createOperationCallable( detachLunTransportSettings, settings.detachLunOperationSettings(), clientContext, httpJsonOperationsStub); this.listSSHKeysCallable = callableFactory.createUnaryCallable( listSSHKeysTransportSettings, settings.listSSHKeysSettings(), clientContext); this.listSSHKeysPagedCallable = callableFactory.createPagedCallable( listSSHKeysTransportSettings, settings.listSSHKeysSettings(), clientContext); this.createSSHKeyCallable = callableFactory.createUnaryCallable( createSSHKeyTransportSettings, settings.createSSHKeySettings(), clientContext); this.deleteSSHKeyCallable = callableFactory.createUnaryCallable( deleteSSHKeyTransportSettings, settings.deleteSSHKeySettings(), clientContext); this.listVolumesCallable = callableFactory.createUnaryCallable( listVolumesTransportSettings, settings.listVolumesSettings(), clientContext); this.listVolumesPagedCallable = callableFactory.createPagedCallable( listVolumesTransportSettings, settings.listVolumesSettings(), clientContext); this.getVolumeCallable = callableFactory.createUnaryCallable( getVolumeTransportSettings, settings.getVolumeSettings(), clientContext); this.updateVolumeCallable = callableFactory.createUnaryCallable( updateVolumeTransportSettings, settings.updateVolumeSettings(), clientContext); this.updateVolumeOperationCallable = callableFactory.createOperationCallable( updateVolumeTransportSettings, settings.updateVolumeOperationSettings(), clientContext, httpJsonOperationsStub); this.renameVolumeCallable = callableFactory.createUnaryCallable( renameVolumeTransportSettings, settings.renameVolumeSettings(), clientContext); this.evictVolumeCallable = callableFactory.createUnaryCallable( evictVolumeTransportSettings, settings.evictVolumeSettings(), clientContext); this.evictVolumeOperationCallable = callableFactory.createOperationCallable( evictVolumeTransportSettings, settings.evictVolumeOperationSettings(), clientContext, httpJsonOperationsStub); this.resizeVolumeCallable = callableFactory.createUnaryCallable( resizeVolumeTransportSettings, settings.resizeVolumeSettings(), clientContext); this.resizeVolumeOperationCallable = callableFactory.createOperationCallable( resizeVolumeTransportSettings, settings.resizeVolumeOperationSettings(), clientContext, httpJsonOperationsStub); this.listNetworksCallable = callableFactory.createUnaryCallable( listNetworksTransportSettings, settings.listNetworksSettings(), clientContext); this.listNetworksPagedCallable = callableFactory.createPagedCallable( listNetworksTransportSettings, settings.listNetworksSettings(), clientContext); this.listNetworkUsageCallable = callableFactory.createUnaryCallable( listNetworkUsageTransportSettings, settings.listNetworkUsageSettings(), clientContext); this.getNetworkCallable = callableFactory.createUnaryCallable( getNetworkTransportSettings, settings.getNetworkSettings(), clientContext); this.updateNetworkCallable = callableFactory.createUnaryCallable( updateNetworkTransportSettings, settings.updateNetworkSettings(), clientContext); this.updateNetworkOperationCallable = callableFactory.createOperationCallable( updateNetworkTransportSettings, settings.updateNetworkOperationSettings(), clientContext, httpJsonOperationsStub); this.createVolumeSnapshotCallable = callableFactory.createUnaryCallable( createVolumeSnapshotTransportSettings, settings.createVolumeSnapshotSettings(), clientContext); this.restoreVolumeSnapshotCallable = callableFactory.createUnaryCallable( restoreVolumeSnapshotTransportSettings, settings.restoreVolumeSnapshotSettings(), clientContext); this.restoreVolumeSnapshotOperationCallable = callableFactory.createOperationCallable( restoreVolumeSnapshotTransportSettings, settings.restoreVolumeSnapshotOperationSettings(), clientContext, httpJsonOperationsStub); this.deleteVolumeSnapshotCallable = callableFactory.createUnaryCallable( deleteVolumeSnapshotTransportSettings, settings.deleteVolumeSnapshotSettings(), clientContext); this.getVolumeSnapshotCallable = callableFactory.createUnaryCallable( getVolumeSnapshotTransportSettings, settings.getVolumeSnapshotSettings(), clientContext); this.listVolumeSnapshotsCallable = callableFactory.createUnaryCallable( listVolumeSnapshotsTransportSettings, settings.listVolumeSnapshotsSettings(), clientContext); this.listVolumeSnapshotsPagedCallable = callableFactory.createPagedCallable( listVolumeSnapshotsTransportSettings, settings.listVolumeSnapshotsSettings(), clientContext); this.getLunCallable = callableFactory.createUnaryCallable( getLunTransportSettings, settings.getLunSettings(), clientContext); this.listLunsCallable = callableFactory.createUnaryCallable( listLunsTransportSettings, settings.listLunsSettings(), clientContext); this.listLunsPagedCallable = callableFactory.createPagedCallable( listLunsTransportSettings, settings.listLunsSettings(), clientContext); this.evictLunCallable = callableFactory.createUnaryCallable( evictLunTransportSettings, settings.evictLunSettings(), clientContext); this.evictLunOperationCallable = callableFactory.createOperationCallable( evictLunTransportSettings, settings.evictLunOperationSettings(), clientContext, httpJsonOperationsStub); this.getNfsShareCallable = callableFactory.createUnaryCallable( getNfsShareTransportSettings, settings.getNfsShareSettings(), clientContext); this.listNfsSharesCallable = callableFactory.createUnaryCallable( listNfsSharesTransportSettings, settings.listNfsSharesSettings(), clientContext); this.listNfsSharesPagedCallable = callableFactory.createPagedCallable( listNfsSharesTransportSettings, settings.listNfsSharesSettings(), clientContext); this.updateNfsShareCallable = callableFactory.createUnaryCallable( updateNfsShareTransportSettings, settings.updateNfsShareSettings(), clientContext); this.updateNfsShareOperationCallable = callableFactory.createOperationCallable( updateNfsShareTransportSettings, settings.updateNfsShareOperationSettings(), clientContext, httpJsonOperationsStub); this.createNfsShareCallable = callableFactory.createUnaryCallable( createNfsShareTransportSettings, settings.createNfsShareSettings(), clientContext); this.createNfsShareOperationCallable = callableFactory.createOperationCallable( createNfsShareTransportSettings, settings.createNfsShareOperationSettings(), clientContext, httpJsonOperationsStub); this.renameNfsShareCallable = callableFactory.createUnaryCallable( renameNfsShareTransportSettings, settings.renameNfsShareSettings(), clientContext); this.deleteNfsShareCallable = callableFactory.createUnaryCallable( deleteNfsShareTransportSettings, settings.deleteNfsShareSettings(), clientContext); this.deleteNfsShareOperationCallable = callableFactory.createOperationCallable( deleteNfsShareTransportSettings, settings.deleteNfsShareOperationSettings(), clientContext, httpJsonOperationsStub); this.listProvisioningQuotasCallable = callableFactory.createUnaryCallable( listProvisioningQuotasTransportSettings, settings.listProvisioningQuotasSettings(), clientContext); this.listProvisioningQuotasPagedCallable = callableFactory.createPagedCallable( listProvisioningQuotasTransportSettings, settings.listProvisioningQuotasSettings(), clientContext); this.submitProvisioningConfigCallable = callableFactory.createUnaryCallable( submitProvisioningConfigTransportSettings, settings.submitProvisioningConfigSettings(), clientContext); this.getProvisioningConfigCallable = callableFactory.createUnaryCallable( getProvisioningConfigTransportSettings, settings.getProvisioningConfigSettings(), clientContext); this.createProvisioningConfigCallable = callableFactory.createUnaryCallable( createProvisioningConfigTransportSettings, settings.createProvisioningConfigSettings(), clientContext); this.updateProvisioningConfigCallable = callableFactory.createUnaryCallable( updateProvisioningConfigTransportSettings, settings.updateProvisioningConfigSettings(), clientContext); this.renameNetworkCallable = callableFactory.createUnaryCallable( renameNetworkTransportSettings, settings.renameNetworkSettings(), clientContext); this.listOSImagesCallable = callableFactory.createUnaryCallable( listOSImagesTransportSettings, settings.listOSImagesSettings(), clientContext); this.listOSImagesPagedCallable = callableFactory.createPagedCallable( listOSImagesTransportSettings, settings.listOSImagesSettings(), clientContext); this.listLocationsCallable = callableFactory.createUnaryCallable( listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); this.listLocationsPagedCallable = callableFactory.createPagedCallable( listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); this.getLocationCallable = callableFactory.createUnaryCallable( getLocationTransportSettings, settings.getLocationSettings(), clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @InternalApi public static List getMethodDescriptors() { List methodDescriptors = new ArrayList<>(); methodDescriptors.add(listInstancesMethodDescriptor); methodDescriptors.add(getInstanceMethodDescriptor); methodDescriptors.add(updateInstanceMethodDescriptor); methodDescriptors.add(renameInstanceMethodDescriptor); methodDescriptors.add(resetInstanceMethodDescriptor); methodDescriptors.add(startInstanceMethodDescriptor); methodDescriptors.add(stopInstanceMethodDescriptor); methodDescriptors.add(enableInteractiveSerialConsoleMethodDescriptor); methodDescriptors.add(disableInteractiveSerialConsoleMethodDescriptor); methodDescriptors.add(detachLunMethodDescriptor); methodDescriptors.add(listSSHKeysMethodDescriptor); methodDescriptors.add(createSSHKeyMethodDescriptor); methodDescriptors.add(deleteSSHKeyMethodDescriptor); methodDescriptors.add(listVolumesMethodDescriptor); methodDescriptors.add(getVolumeMethodDescriptor); methodDescriptors.add(updateVolumeMethodDescriptor); methodDescriptors.add(renameVolumeMethodDescriptor); methodDescriptors.add(evictVolumeMethodDescriptor); methodDescriptors.add(resizeVolumeMethodDescriptor); methodDescriptors.add(listNetworksMethodDescriptor); methodDescriptors.add(listNetworkUsageMethodDescriptor); methodDescriptors.add(getNetworkMethodDescriptor); methodDescriptors.add(updateNetworkMethodDescriptor); methodDescriptors.add(createVolumeSnapshotMethodDescriptor); methodDescriptors.add(restoreVolumeSnapshotMethodDescriptor); methodDescriptors.add(deleteVolumeSnapshotMethodDescriptor); methodDescriptors.add(getVolumeSnapshotMethodDescriptor); methodDescriptors.add(listVolumeSnapshotsMethodDescriptor); methodDescriptors.add(getLunMethodDescriptor); methodDescriptors.add(listLunsMethodDescriptor); methodDescriptors.add(evictLunMethodDescriptor); methodDescriptors.add(getNfsShareMethodDescriptor); methodDescriptors.add(listNfsSharesMethodDescriptor); methodDescriptors.add(updateNfsShareMethodDescriptor); methodDescriptors.add(createNfsShareMethodDescriptor); methodDescriptors.add(renameNfsShareMethodDescriptor); methodDescriptors.add(deleteNfsShareMethodDescriptor); methodDescriptors.add(listProvisioningQuotasMethodDescriptor); methodDescriptors.add(submitProvisioningConfigMethodDescriptor); methodDescriptors.add(getProvisioningConfigMethodDescriptor); methodDescriptors.add(createProvisioningConfigMethodDescriptor); methodDescriptors.add(updateProvisioningConfigMethodDescriptor); methodDescriptors.add(renameNetworkMethodDescriptor); methodDescriptors.add(listOSImagesMethodDescriptor); methodDescriptors.add(listLocationsMethodDescriptor); methodDescriptors.add(getLocationMethodDescriptor); return methodDescriptors; } public HttpJsonOperationsStub getHttpJsonOperationsStub() { return httpJsonOperationsStub; } @Override public UnaryCallable listInstancesCallable() { return listInstancesCallable; } @Override public UnaryCallable listInstancesPagedCallable() { return listInstancesPagedCallable; } @Override public UnaryCallable getInstanceCallable() { return getInstanceCallable; } @Override public UnaryCallable updateInstanceCallable() { return updateInstanceCallable; } @Override public OperationCallable updateInstanceOperationCallable() { return updateInstanceOperationCallable; } @Override public UnaryCallable renameInstanceCallable() { return renameInstanceCallable; } @Override public UnaryCallable resetInstanceCallable() { return resetInstanceCallable; } @Override public OperationCallable resetInstanceOperationCallable() { return resetInstanceOperationCallable; } @Override public UnaryCallable startInstanceCallable() { return startInstanceCallable; } @Override public OperationCallable startInstanceOperationCallable() { return startInstanceOperationCallable; } @Override public UnaryCallable stopInstanceCallable() { return stopInstanceCallable; } @Override public OperationCallable stopInstanceOperationCallable() { return stopInstanceOperationCallable; } @Override public UnaryCallable enableInteractiveSerialConsoleCallable() { return enableInteractiveSerialConsoleCallable; } @Override public OperationCallable< EnableInteractiveSerialConsoleRequest, EnableInteractiveSerialConsoleResponse, OperationMetadata> enableInteractiveSerialConsoleOperationCallable() { return enableInteractiveSerialConsoleOperationCallable; } @Override public UnaryCallable disableInteractiveSerialConsoleCallable() { return disableInteractiveSerialConsoleCallable; } @Override public OperationCallable< DisableInteractiveSerialConsoleRequest, DisableInteractiveSerialConsoleResponse, OperationMetadata> disableInteractiveSerialConsoleOperationCallable() { return disableInteractiveSerialConsoleOperationCallable; } @Override public UnaryCallable detachLunCallable() { return detachLunCallable; } @Override public OperationCallable detachLunOperationCallable() { return detachLunOperationCallable; } @Override public UnaryCallable listSSHKeysCallable() { return listSSHKeysCallable; } @Override public UnaryCallable listSSHKeysPagedCallable() { return listSSHKeysPagedCallable; } @Override public UnaryCallable createSSHKeyCallable() { return createSSHKeyCallable; } @Override public UnaryCallable deleteSSHKeyCallable() { return deleteSSHKeyCallable; } @Override public UnaryCallable listVolumesCallable() { return listVolumesCallable; } @Override public UnaryCallable listVolumesPagedCallable() { return listVolumesPagedCallable; } @Override public UnaryCallable getVolumeCallable() { return getVolumeCallable; } @Override public UnaryCallable updateVolumeCallable() { return updateVolumeCallable; } @Override public OperationCallable updateVolumeOperationCallable() { return updateVolumeOperationCallable; } @Override public UnaryCallable renameVolumeCallable() { return renameVolumeCallable; } @Override public UnaryCallable evictVolumeCallable() { return evictVolumeCallable; } @Override public OperationCallable evictVolumeOperationCallable() { return evictVolumeOperationCallable; } @Override public UnaryCallable resizeVolumeCallable() { return resizeVolumeCallable; } @Override public OperationCallable resizeVolumeOperationCallable() { return resizeVolumeOperationCallable; } @Override public UnaryCallable listNetworksCallable() { return listNetworksCallable; } @Override public UnaryCallable listNetworksPagedCallable() { return listNetworksPagedCallable; } @Override public UnaryCallable listNetworkUsageCallable() { return listNetworkUsageCallable; } @Override public UnaryCallable getNetworkCallable() { return getNetworkCallable; } @Override public UnaryCallable updateNetworkCallable() { return updateNetworkCallable; } @Override public OperationCallable updateNetworkOperationCallable() { return updateNetworkOperationCallable; } @Override public UnaryCallable createVolumeSnapshotCallable() { return createVolumeSnapshotCallable; } @Override public UnaryCallable restoreVolumeSnapshotCallable() { return restoreVolumeSnapshotCallable; } @Override public OperationCallable restoreVolumeSnapshotOperationCallable() { return restoreVolumeSnapshotOperationCallable; } @Override public UnaryCallable deleteVolumeSnapshotCallable() { return deleteVolumeSnapshotCallable; } @Override public UnaryCallable getVolumeSnapshotCallable() { return getVolumeSnapshotCallable; } @Override public UnaryCallable listVolumeSnapshotsCallable() { return listVolumeSnapshotsCallable; } @Override public UnaryCallable listVolumeSnapshotsPagedCallable() { return listVolumeSnapshotsPagedCallable; } @Override public UnaryCallable getLunCallable() { return getLunCallable; } @Override public UnaryCallable listLunsCallable() { return listLunsCallable; } @Override public UnaryCallable listLunsPagedCallable() { return listLunsPagedCallable; } @Override public UnaryCallable evictLunCallable() { return evictLunCallable; } @Override public OperationCallable evictLunOperationCallable() { return evictLunOperationCallable; } @Override public UnaryCallable getNfsShareCallable() { return getNfsShareCallable; } @Override public UnaryCallable listNfsSharesCallable() { return listNfsSharesCallable; } @Override public UnaryCallable listNfsSharesPagedCallable() { return listNfsSharesPagedCallable; } @Override public UnaryCallable updateNfsShareCallable() { return updateNfsShareCallable; } @Override public OperationCallable updateNfsShareOperationCallable() { return updateNfsShareOperationCallable; } @Override public UnaryCallable createNfsShareCallable() { return createNfsShareCallable; } @Override public OperationCallable createNfsShareOperationCallable() { return createNfsShareOperationCallable; } @Override public UnaryCallable renameNfsShareCallable() { return renameNfsShareCallable; } @Override public UnaryCallable deleteNfsShareCallable() { return deleteNfsShareCallable; } @Override public OperationCallable deleteNfsShareOperationCallable() { return deleteNfsShareOperationCallable; } @Override public UnaryCallable listProvisioningQuotasCallable() { return listProvisioningQuotasCallable; } @Override public UnaryCallable listProvisioningQuotasPagedCallable() { return listProvisioningQuotasPagedCallable; } @Override public UnaryCallable submitProvisioningConfigCallable() { return submitProvisioningConfigCallable; } @Override public UnaryCallable getProvisioningConfigCallable() { return getProvisioningConfigCallable; } @Override public UnaryCallable createProvisioningConfigCallable() { return createProvisioningConfigCallable; } @Override public UnaryCallable updateProvisioningConfigCallable() { return updateProvisioningConfigCallable; } @Override public UnaryCallable renameNetworkCallable() { return renameNetworkCallable; } @Override public UnaryCallable listOSImagesCallable() { return listOSImagesCallable; } @Override public UnaryCallable listOSImagesPagedCallable() { return listOSImagesPagedCallable; } @Override public UnaryCallable listLocationsCallable() { return listLocationsCallable; } @Override public UnaryCallable listLocationsPagedCallable() { return listLocationsPagedCallable; } @Override public UnaryCallable getLocationCallable() { return getLocationCallable; } @Override public final void close() { try { backgroundResources.close(); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new IllegalStateException("Failed to close resource", e); } } @Override public void shutdown() { backgroundResources.shutdown(); } @Override public boolean isShutdown() { return backgroundResources.isShutdown(); } @Override public boolean isTerminated() { return backgroundResources.isTerminated(); } @Override public void shutdownNow() { backgroundResources.shutdownNow(); } @Override public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy