Encapsulates client state, including executor, credentials, and transport channel.
UnlikeClientSettingswhich allows users to configure the client,ClientContextis intended to be used in generated code. Most users will not need to use it.
The objects that need to be closed in order to clean up the resources created in the process of
creating this ClientContext. This will include the closeables from the transport context.
[[["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 webpage lists the documentation for various versions of the \u003ccode\u003eClientContext\u003c/code\u003e class, with version 2.63.1 being the most recent and 2.7.1 being the oldest.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eClientContext\u003c/code\u003e class is an abstract class that encapsulates client state, including the executor, credentials, and transport channel.\u003c/p\u003e\n"],["\u003cp\u003eUnlike \u003ccode\u003eClientSettings\u003c/code\u003e, the \u003ccode\u003eClientContext\u003c/code\u003e class is designed for use in generated code and is typically not needed by most users.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eClientContext\u003c/code\u003e class provides static methods to create new instances and a builder, and it provides methods to retrieve objects such as the background resources, clock, credentials, executor, headers, and transport channel, among other things.\u003c/p\u003e\n"],["\u003cp\u003eIt is possible to create a \u003ccode\u003eClientContext\u003c/code\u003e from either \u003ccode\u003eClientSettings\u003c/code\u003e or \u003ccode\u003eStubSettings\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,[]]