/// <summary> /// Creates a <see cref="AnswerRecordsClient"/> 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="AnswerRecordsSettings"/>.</param> /// <returns>The created <see cref="AnswerRecordsClient"/>.</returns> internal static AnswerRecordsClient Create(grpccore::CallInvoker callInvoker, AnswerRecordsSettings settings = null) { gax::GaxPreconditions.CheckNotNull(callInvoker, nameof(callInvoker)); grpcinter::Interceptor interceptor = settings?.Interceptor; if (interceptor != null) { callInvoker = grpcinter::CallInvokerExtensions.Intercept(callInvoker, interceptor); } AnswerRecords.AnswerRecordsClient grpcClient = new AnswerRecords.AnswerRecordsClient(callInvoker); return(new AnswerRecordsClientImpl(grpcClient, settings)); }
/// <summary> /// Constructs a client wrapper for the AnswerRecords service, with the specified gRPC client and settings. /// </summary> /// <param name="grpcClient">The underlying gRPC client.</param> /// <param name="settings">The base <see cref="AnswerRecordsSettings"/> used within this client.</param> public AnswerRecordsClientImpl(AnswerRecords.AnswerRecordsClient grpcClient, AnswerRecordsSettings settings) { GrpcClient = grpcClient; AnswerRecordsSettings effectiveSettings = settings ?? AnswerRecordsSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); _callListAnswerRecords = clientHelper.BuildApiCall <ListAnswerRecordsRequest, ListAnswerRecordsResponse>(grpcClient.ListAnswerRecordsAsync, grpcClient.ListAnswerRecords, effectiveSettings.ListAnswerRecordsSettings).WithGoogleRequestParam("parent", request => request.Parent); Modify_ApiCall(ref _callListAnswerRecords); Modify_ListAnswerRecordsApiCall(ref _callListAnswerRecords); _callUpdateAnswerRecord = clientHelper.BuildApiCall <UpdateAnswerRecordRequest, AnswerRecord>(grpcClient.UpdateAnswerRecordAsync, grpcClient.UpdateAnswerRecord, effectiveSettings.UpdateAnswerRecordSettings).WithGoogleRequestParam("answer_record.name", request => request.AnswerRecord?.Name); Modify_ApiCall(ref _callUpdateAnswerRecord); Modify_UpdateAnswerRecordApiCall(ref _callUpdateAnswerRecord); OnConstruction(grpcClient, effectiveSettings, clientHelper); }
partial void OnConstruction(AnswerRecords.AnswerRecordsClient grpcClient, AnswerRecordsSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);