private ModelServiceSettings(ModelServiceSettings existing) : base(existing) { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); GetModelSettings = existing.GetModelSettings; ListModelsSettings = existing.ListModelsSettings; PatchModelSettings = existing.PatchModelSettings; DeleteModelSettings = existing.DeleteModelSettings; OnCopy(existing); }
/// <summary> /// Creates a <see cref="ModelServiceClient"/> which uses the specified call invoker for remote operations. /// </summary> /// <param name="callInvoker"> /// The <see cref="grpccore::CallInvoker"/> for remote operations. Must not be null. /// </param> /// <param name="settings">Optional <see cref="ModelServiceSettings"/>.</param> /// <returns>The created <see cref="ModelServiceClient"/>.</returns> internal static ModelServiceClient Create(grpccore::CallInvoker callInvoker, ModelServiceSettings settings = null) { gax::GaxPreconditions.CheckNotNull(callInvoker, nameof(callInvoker)); grpcinter::Interceptor interceptor = settings?.Interceptor; if (interceptor != null) { callInvoker = grpcinter::CallInvokerExtensions.Intercept(callInvoker, interceptor); } ModelService.ModelServiceClient grpcClient = new ModelService.ModelServiceClient(callInvoker); return(new ModelServiceClientImpl(grpcClient, settings)); }
/// <summary> /// Constructs a client wrapper for the ModelService service, with the specified gRPC client and settings. /// </summary> /// <param name="grpcClient">The underlying gRPC client.</param> /// <param name="settings">The base <see cref="ModelServiceSettings"/> used within this client.</param> public ModelServiceClientImpl(ModelService.ModelServiceClient grpcClient, ModelServiceSettings settings) { GrpcClient = grpcClient; ModelServiceSettings effectiveSettings = settings ?? ModelServiceSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); _callGetModel = clientHelper.BuildApiCall <GetModelRequest, Model>(grpcClient.GetModelAsync, grpcClient.GetModel, effectiveSettings.GetModelSettings); Modify_ApiCall(ref _callGetModel); Modify_GetModelApiCall(ref _callGetModel); _callListModels = clientHelper.BuildApiCall <ListModelsRequest, ListModelsResponse>(grpcClient.ListModelsAsync, grpcClient.ListModels, effectiveSettings.ListModelsSettings); Modify_ApiCall(ref _callListModels); Modify_ListModelsApiCall(ref _callListModels); _callPatchModel = clientHelper.BuildApiCall <PatchModelRequest, Model>(grpcClient.PatchModelAsync, grpcClient.PatchModel, effectiveSettings.PatchModelSettings); Modify_ApiCall(ref _callPatchModel); Modify_PatchModelApiCall(ref _callPatchModel); _callDeleteModel = clientHelper.BuildApiCall <DeleteModelRequest, wkt::Empty>(grpcClient.DeleteModelAsync, grpcClient.DeleteModel, effectiveSettings.DeleteModelSettings); Modify_ApiCall(ref _callDeleteModel); Modify_DeleteModelApiCall(ref _callDeleteModel); OnConstruction(grpcClient, effectiveSettings, clientHelper); }
partial void OnConstruction(ModelService.ModelServiceClient grpcClient, ModelServiceSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);
partial void OnCopy(ModelServiceSettings existing);