public ApiCall<TRequest, TResponse> WithCallSettingsOverlay(Func<TRequest, CallSettings> callSettingsOverlayFn)
Constructs a newApiCall<TRequest, TResponse>that applies an overlay to
the underlyingCallSettings. If a value exists in both the original and
the overlay, the overlay takes priority.
public ApiCall<TRequest, TResponse> WithGoogleRequestParam(string parameterName, Func<TRequest, string> valueSelector)
Constructs a newApiCall<TRequest, TResponse>that applies an x-goog-request-params header to each request,
using the specified parameter name and a value derived from the request.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eThis document provides the API reference for the \u003ccode\u003eApiCall<TRequest, TResponse>\u003c/code\u003e class, found in the \u003ccode\u003eGoogle.Api.Gax.Grpc\u003c/code\u003e namespace and \u003ccode\u003eGoogle.Api.Gax.Grpc.dll\u003c/code\u003e assembly, which is a bridge between RPC methods and higher-level abstractions.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eApiCall<TRequest, TResponse>\u003c/code\u003e class handles both synchronous (\u003ccode\u003eSync\u003c/code\u003e) and asynchronous (\u003ccode\u003eAsync\u003c/code\u003e) RPC calls, managing request and response types, and allowing application of call settings.\u003c/p\u003e\n"],["\u003cp\u003eThe class allows for the customization of calls via \u003ccode\u003eCallSettings\u003c/code\u003e where default settings can be overridden using \u003ccode\u003eBaseCallSettings\u003c/code\u003e and \u003ccode\u003eperCallCallSettings\u003c/code\u003e parameters in the \u003ccode\u003eAsync\u003c/code\u003e and \u003ccode\u003eSync\u003c/code\u003e methods, and through \u003ccode\u003eWithCallSettingsOverlay\u003c/code\u003e for applying overlays.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eWithExtractedGoogleRequestParam\u003c/code\u003e and \u003ccode\u003eWithGoogleRequestParam\u003c/code\u003e methods allow construction of new \u003ccode\u003eApiCall\u003c/code\u003e instances that apply x-goog-request-params headers to each request, using either an extractor or a function respectively, to determine the header value.\u003c/p\u003e\n"],["\u003cp\u003eThe API reference includes documentation for inherited members, type parameters (\u003ccode\u003eTRequest\u003c/code\u003e, \u003ccode\u003eTResponse\u003c/code\u003e), properties like \u003ccode\u003eBaseCallSettings\u003c/code\u003e, as well as available versions ranging from 3.2.0 to the latest 4.10.0.\u003c/p\u003e\n"]]],[],null,["# Class ApiCall<TRequest, TResponse> (4.10.0)\n\nVersion latestkeyboard_arrow_down\n\n- [4.10.0 (latest)](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ApiCall-2)\n- [4.8.0](/dotnet/docs/reference/Google.Api.Gax/4.8.0/Google.Api.Gax.Grpc.ApiCall-2)\n- [4.4.0](/dotnet/docs/reference/Google.Api.Gax/4.4.0/Google.Api.Gax.Grpc.ApiCall-2)\n- [4.3.1](/dotnet/docs/reference/Google.Api.Gax/4.3.1/Google.Api.Gax.Grpc.ApiCall-2)\n- [4.2.0](/dotnet/docs/reference/Google.Api.Gax/4.2.0/Google.Api.Gax.Grpc.ApiCall-2)\n- [4.0.0](/dotnet/docs/reference/Google.Api.Gax/4.0.0/Google.Api.Gax.Grpc.ApiCall-2)\n- [3.2.0](/dotnet/docs/reference/Google.Api.Gax/3.2.0/Google.Api.Gax.Grpc.ApiCall-2) \n\n public sealed class ApiCall\u003cTRequest, TResponse\u003e where TRequest : class, IMessage\u003cTRequest\u003e where TResponse : class, IMessage\u003cTResponse\u003e\n\nBridge between an RPC method (with synchronous and asynchronous variants) and higher level\nabstractions, applying call settings as required. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e ApiCall\\\u003cTRequest, TResponse\\\u003e \n\nInherited Members\n-----------------\n\n[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)) \n[object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) \n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Api.Gax.Grpc](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc)\n\nAssembly\n--------\n\nGoogle.Api.Gax.Grpc.dll\n\nProperties\n----------\n\n### BaseCallSettings\n\n public CallSettings BaseCallSettings { get; }\n\nThe base [CallSettings](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings) for this API call; these can be further overridden by providing\na `CallSettings` to [Async(TRequest, CallSettings)](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ApiCall-2#Google_Api_Gax_Grpc_ApiCall_2_Async__0_Google_Api_Gax_Grpc_CallSettings_) or [Sync(TRequest, CallSettings)](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ApiCall-2#Google_Api_Gax_Grpc_ApiCall_2_Sync__0_Google_Api_Gax_Grpc_CallSettings_).\n\nMethods\n-------\n\n### Async(TRequest, CallSettings)\n\n public Task\u003cTResponse\u003e Async(TRequest request, CallSettings perCallCallSettings)\n\nPerforms an RPC call asynchronously.\n\n### Sync(TRequest, CallSettings)\n\n public TResponse Sync(TRequest request, CallSettings perCallCallSettings)\n\nPerforms an RPC call synchronously.\n\n### WithCallSettingsOverlay(Func\\\u003cTRequest, CallSettings\\\u003e)\n\n public ApiCall\u003cTRequest, TResponse\u003e WithCallSettingsOverlay(Func\u003cTRequest, CallSettings\u003e callSettingsOverlayFn)\n\nConstructs a new [ApiCall\\\u003cTRequest, TResponse\\\u003e](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ApiCall-2) that applies an overlay to\nthe underlying [CallSettings](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings). If a value exists in both the original and\nthe overlay, the overlay takes priority.\n\n### WithExtractedGoogleRequestParam(RoutingHeaderExtractor\\\u003cTRequest\\\u003e)\n\n public ApiCall\u003cTRequest, TResponse\u003e WithExtractedGoogleRequestParam(RoutingHeaderExtractor\u003cTRequest\u003e extractor)\n\nConstructs a new [ApiCall\\\u003cTRequest, TResponse\\\u003e](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ApiCall-2) that applies an x-goog-request-params header to each request,\nusing the [RoutingHeaderExtractor\\\u003cTRequest\\\u003e](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.RoutingHeaderExtractor-1).\n\n**Remarks** \nValues produced by the function are URL-encoded.\n\n### WithGoogleRequestParam(string, Func\\\u003cTRequest, string\\\u003e)\n\n public ApiCall\u003cTRequest, TResponse\u003e WithGoogleRequestParam(string parameterName, Func\u003cTRequest, string\u003e valueSelector)\n\nConstructs a new [ApiCall\\\u003cTRequest, TResponse\\\u003e](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ApiCall-2) that applies an x-goog-request-params header to each request,\nusing the specified parameter name and a value derived from the request.\n\n**Remarks** \nValues produced by the function are URL-encoded; it is expected that `parameterName` is already URL-encoded."]]