/// <summary> /// Creates a <see cref="ApplicationsClient"/> 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="ApplicationsSettings"/>.</param> /// <returns>The created <see cref="ApplicationsClient"/>.</returns> internal static ApplicationsClient Create(grpccore::CallInvoker callInvoker, ApplicationsSettings settings = null) { gax::GaxPreconditions.CheckNotNull(callInvoker, nameof(callInvoker)); grpcinter::Interceptor interceptor = settings?.Interceptor; if (interceptor != null) { callInvoker = grpcinter::CallInvokerExtensions.Intercept(callInvoker, interceptor); } Applications.ApplicationsClient grpcClient = new Applications.ApplicationsClient(callInvoker); return(new ApplicationsClientImpl(grpcClient, settings)); }
/// <summary> /// Constructs a client wrapper for the Applications service, with the specified gRPC client and settings. /// </summary> /// <param name="grpcClient">The underlying gRPC client.</param> /// <param name="settings">The base <see cref="ApplicationsSettings"/> used within this client.</param> public ApplicationsClientImpl(Applications.ApplicationsClient grpcClient, ApplicationsSettings settings) { GrpcClient = grpcClient; ApplicationsSettings effectiveSettings = settings ?? ApplicationsSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); CreateApplicationOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClient(), effectiveSettings.CreateApplicationOperationsSettings); UpdateApplicationOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClient(), effectiveSettings.UpdateApplicationOperationsSettings); RepairApplicationOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClient(), effectiveSettings.RepairApplicationOperationsSettings); _callGetApplication = clientHelper.BuildApiCall <GetApplicationRequest, Application>(grpcClient.GetApplicationAsync, grpcClient.GetApplication, effectiveSettings.GetApplicationSettings).WithGoogleRequestParam("name", request => request.Name); Modify_ApiCall(ref _callGetApplication); Modify_GetApplicationApiCall(ref _callGetApplication); _callCreateApplication = clientHelper.BuildApiCall <CreateApplicationRequest, lro::Operation>(grpcClient.CreateApplicationAsync, grpcClient.CreateApplication, effectiveSettings.CreateApplicationSettings); Modify_ApiCall(ref _callCreateApplication); Modify_CreateApplicationApiCall(ref _callCreateApplication); _callUpdateApplication = clientHelper.BuildApiCall <UpdateApplicationRequest, lro::Operation>(grpcClient.UpdateApplicationAsync, grpcClient.UpdateApplication, effectiveSettings.UpdateApplicationSettings).WithGoogleRequestParam("name", request => request.Name); Modify_ApiCall(ref _callUpdateApplication); Modify_UpdateApplicationApiCall(ref _callUpdateApplication); _callRepairApplication = clientHelper.BuildApiCall <RepairApplicationRequest, lro::Operation>(grpcClient.RepairApplicationAsync, grpcClient.RepairApplication, effectiveSettings.RepairApplicationSettings).WithGoogleRequestParam("name", request => request.Name); Modify_ApiCall(ref _callRepairApplication); Modify_RepairApplicationApiCall(ref _callRepairApplication); OnConstruction(grpcClient, effectiveSettings, clientHelper); }
partial void OnConstruction(Applications.ApplicationsClient grpcClient, ApplicationsSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);