The returned connection object should not be used directly; instead it should be passed as an argument to the constructor of DocumentProcessorServiceClient.
The optional options argument may be used to configure aspects of the returned DocumentProcessorServiceConnection. Expected options are any of the types in the following option lists:
[[["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-08-28 UTC."],[[["\u003cp\u003eThe latest version available for the Document AI C++ library is 2.37.0-rc, with numerous previous versions also listed, ranging from 2.36.0 down to 2.11.0.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eDocumentProcessorServiceClient\u003c/code\u003e class is available to call Document AI for processing documents, while the \u003ccode\u003eDocumentProcessorServiceConnection\u003c/code\u003e is the connection object used by the client.\u003c/p\u003e\n"],["\u003cp\u003eSeveral retry policy classes such as \u003ccode\u003eDocumentProcessorServiceLimitedErrorCountRetryPolicy\u003c/code\u003e, \u003ccode\u003eDocumentProcessorServiceLimitedTimeRetryPolicy\u003c/code\u003e, and \u003ccode\u003eDocumentProcessorServiceRetryPolicy\u003c/code\u003e are available for the \u003ccode\u003eDocumentProcessorServiceConnection\u003c/code\u003e to handle connection errors.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eMakeDocumentProcessorServiceConnection\u003c/code\u003e factory function constructs a \u003ccode\u003eDocumentProcessorServiceConnection\u003c/code\u003e object and takes parameters for location and options to customize the connection.\u003c/p\u003e\n"],["\u003cp\u003eThere are multiple struct and options such as \u003ccode\u003eDocumentProcessorServiceBackoffPolicyOption\u003c/code\u003e, \u003ccode\u003eDocumentProcessorServiceConnectionIdempotencyPolicyOption\u003c/code\u003e, and \u003ccode\u003eDocumentProcessorServiceRetryPolicyOption\u003c/code\u003e to assist in configuring how a connection is setup and handled.\u003c/p\u003e\n"]]],[],null,["# Namespace google::cloud::documentai_v1 (2.42.0-rc)\n\nVersion latestkeyboard_arrow_down\n\n- [2.42.0-rc (latest)](/cpp/docs/reference/documentai/latest/namespacegoogle_1_1cloud_1_1documentai__v1)\n- [2.41.0](/cpp/docs/reference/documentai/2.41.0/namespacegoogle_1_1cloud_1_1documentai__v1)\n- [2.40.0](/cpp/docs/reference/documentai/2.40.0/namespacegoogle_1_1cloud_1_1documentai__v1)\n- [2.39.0](/cpp/docs/reference/documentai/2.39.0/namespacegoogle_1_1cloud_1_1documentai__v1)\n- [2.38.0](/cpp/docs/reference/documentai/2.38.0/namespacegoogle_1_1cloud_1_1documentai__v1)\n- [2.37.0](/cpp/docs/reference/documentai/2.37.0/namespacegoogle_1_1cloud_1_1documentai__v1)\n- [2.36.0](/cpp/docs/reference/documentai/2.36.0/namespacegoogle_1_1cloud_1_1documentai__v1)\n- [2.35.0](/cpp/docs/reference/documentai/2.35.0/namespacegoogle_1_1cloud_1_1documentai__v1)\n- [2.34.0](/cpp/docs/reference/documentai/2.34.0/namespacegoogle_1_1cloud_1_1documentai__v1)\n- [2.33.0](/cpp/docs/reference/documentai/2.33.0/namespacegoogle_1_1cloud_1_1documentai__v1)\n- [2.32.0](/cpp/docs/reference/documentai/2.32.0/namespacegoogle_1_1cloud_1_1documentai__v1)\n- [2.31.0](/cpp/docs/reference/documentai/2.31.0/namespacegoogle_1_1cloud_1_1documentai__v1)\n- [2.30.0](/cpp/docs/reference/documentai/2.30.0/namespacegoogle_1_1cloud_1_1documentai__v1)\n- [2.29.0](/cpp/docs/reference/documentai/2.29.0/namespacegoogle_1_1cloud_1_1documentai__v1)\n- [2.28.0](/cpp/docs/reference/documentai/2.28.0/namespacegoogle_1_1cloud_1_1documentai__v1)\n- [2.27.0](/cpp/docs/reference/documentai/2.27.0/namespacegoogle_1_1cloud_1_1documentai__v1)\n- [2.26.0](/cpp/docs/reference/documentai/2.26.0/namespacegoogle_1_1cloud_1_1documentai__v1)\n- [2.25.1](/cpp/docs/reference/documentai/2.25.1/namespacegoogle_1_1cloud_1_1documentai__v1)\n- [2.24.0](/cpp/docs/reference/documentai/2.24.0/namespacegoogle_1_1cloud_1_1documentai__v1)\n- [2.23.0](/cpp/docs/reference/documentai/2.23.0/namespacegoogle_1_1cloud_1_1documentai__v1)\n- [2.22.1](/cpp/docs/reference/documentai/2.22.1/namespacegoogle_1_1cloud_1_1documentai__v1)\n- [2.21.0](/cpp/docs/reference/documentai/2.21.0/namespacegoogle_1_1cloud_1_1documentai__v1)\n- [2.20.0](/cpp/docs/reference/documentai/2.20.0/namespacegoogle_1_1cloud_1_1documentai__v1)\n- [2.19.0](/cpp/docs/reference/documentai/2.19.0/namespacegoogle_1_1cloud_1_1documentai__v1)\n- [2.18.0](/cpp/docs/reference/documentai/2.18.0/namespacegoogle_1_1cloud_1_1documentai__v1)\n- [2.17.0](/cpp/docs/reference/documentai/2.17.0/namespacegoogle_1_1cloud_1_1documentai__v1)\n- [2.16.0](/cpp/docs/reference/documentai/2.16.0/namespacegoogle_1_1cloud_1_1documentai__v1)\n- [2.15.1](/cpp/docs/reference/documentai/2.15.1/namespacegoogle_1_1cloud_1_1documentai__v1)\n- [2.14.0](/cpp/docs/reference/documentai/2.14.0/namespacegoogle_1_1cloud_1_1documentai__v1)\n- [2.13.0](/cpp/docs/reference/documentai/2.13.0/namespacegoogle_1_1cloud_1_1documentai__v1)\n- [2.12.0](/cpp/docs/reference/documentai/2.12.0/namespacegoogle_1_1cloud_1_1documentai__v1)\n- [2.11.0](/cpp/docs/reference/documentai/2.11.0/namespacegoogle_1_1cloud_1_1documentai__v1) \n\nClasses\n-------\n\n### [DocumentProcessorServiceClient](/cpp/docs/reference/documentai/latest/classgoogle_1_1cloud_1_1documentai__v1_1_1DocumentProcessorServiceClient)\n\nService to call Document AI to process documents according to the processor's definition.\n\n### [DocumentProcessorServiceConnection](/cpp/docs/reference/documentai/latest/classgoogle_1_1cloud_1_1documentai__v1_1_1DocumentProcessorServiceConnection)\n\nThe [`DocumentProcessorServiceConnection`](/cpp/docs/reference/documentai/latest/classgoogle_1_1cloud_1_1documentai__v1_1_1DocumentProcessorServiceConnection) object for [`DocumentProcessorServiceClient`](/cpp/docs/reference/documentai/latest/classgoogle_1_1cloud_1_1documentai__v1_1_1DocumentProcessorServiceClient).\n\n### [DocumentProcessorServiceConnectionIdempotencyPolicy](/cpp/docs/reference/documentai/latest/classgoogle_1_1cloud_1_1documentai__v1_1_1DocumentProcessorServiceConnectionIdempotencyPolicy)\n\n### [DocumentProcessorServiceLimitedErrorCountRetryPolicy](/cpp/docs/reference/documentai/latest/classgoogle_1_1cloud_1_1documentai__v1_1_1DocumentProcessorServiceLimitedErrorCountRetryPolicy)\n\nA retry policy for [`DocumentProcessorServiceConnection`](/cpp/docs/reference/documentai/latest/classgoogle_1_1cloud_1_1documentai__v1_1_1DocumentProcessorServiceConnection) based on counting errors.\n\n### [DocumentProcessorServiceLimitedTimeRetryPolicy](/cpp/docs/reference/documentai/latest/classgoogle_1_1cloud_1_1documentai__v1_1_1DocumentProcessorServiceLimitedTimeRetryPolicy)\n\nA retry policy for [`DocumentProcessorServiceConnection`](/cpp/docs/reference/documentai/latest/classgoogle_1_1cloud_1_1documentai__v1_1_1DocumentProcessorServiceConnection) based on elapsed time.\n\n### [DocumentProcessorServiceRetryPolicy](/cpp/docs/reference/documentai/latest/classgoogle_1_1cloud_1_1documentai__v1_1_1DocumentProcessorServiceRetryPolicy)\n\nThe retry policy for [`DocumentProcessorServiceConnection`](/cpp/docs/reference/documentai/latest/classgoogle_1_1cloud_1_1documentai__v1_1_1DocumentProcessorServiceConnection).\n\nStructs\n-------\n\n### [DocumentProcessorServiceBackoffPolicyOption](/cpp/docs/reference/documentai/latest/structgoogle_1_1cloud_1_1documentai__v1_1_1DocumentProcessorServiceBackoffPolicyOption)\n\nUse with [`google::cloud::Options`](https://cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1Options.html) to configure the backoff policy.\n\n### [DocumentProcessorServiceConnectionIdempotencyPolicyOption](/cpp/docs/reference/documentai/latest/structgoogle_1_1cloud_1_1documentai__v1_1_1DocumentProcessorServiceConnectionIdempotencyPolicyOption)\n\nUse with [`google::cloud::Options`](https://cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1Options.html) to configure which operations are retried.\n\n### [DocumentProcessorServicePollingPolicyOption](/cpp/docs/reference/documentai/latest/structgoogle_1_1cloud_1_1documentai__v1_1_1DocumentProcessorServicePollingPolicyOption)\n\nUse with [`google::cloud::Options`](https://cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1Options.html) to configure the long-running operations polling policy.\n\n### [DocumentProcessorServiceRetryPolicyOption](/cpp/docs/reference/documentai/latest/structgoogle_1_1cloud_1_1documentai__v1_1_1DocumentProcessorServiceRetryPolicyOption)\n\nUse with [`google::cloud::Options`](https://cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1Options.html) to configure the retry policy.\n\nFunctions\n---------\n\n### MakeDocumentProcessorServiceConnection(std::string const \\&, Options)\n\nA factory function to construct an object of type [`DocumentProcessorServiceConnection`](/cpp/docs/reference/documentai/latest/classgoogle_1_1cloud_1_1documentai__v1_1_1DocumentProcessorServiceConnection). \nThe returned connection object should not be used directly; instead it should be passed as an argument to the constructor of [DocumentProcessorServiceClient](/cpp/docs/reference/documentai/latest/classgoogle_1_1cloud_1_1documentai__v1_1_1DocumentProcessorServiceClient).\n\nThe optional `options` argument may be used to configure aspects of the returned [`DocumentProcessorServiceConnection`](/cpp/docs/reference/documentai/latest/classgoogle_1_1cloud_1_1documentai__v1_1_1DocumentProcessorServiceConnection). Expected options are any of the types in the following option lists:\n\n- [`google::cloud::CommonOptionList`](https://cloud.google.com/cpp/docs/reference/common/latest/namespacegoogle_1_1cloud.html)\n- [`google::cloud::GrpcOptionList`](https://cloud.google.com/cpp/docs/reference/common/latest/namespacegoogle_1_1cloud.html)\n- [`google::cloud::UnifiedCredentialsOptionList`](about:invalid#zCSafez)\n- [`google::cloud::documentai_v1::DocumentProcessorServicePolicyOptionList`](about:invalid#zCSafez)\n\n| **Note:** Unexpected options will be ignored. To log unexpected options instead, set `GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes` in the environment.\n\n### MakeDocumentProcessorServiceConnection(Options)\n\nA backwards-compatible version of the previous factory function. \nUnless the service also offers a global endpoint, the default value of the [`EndpointOption`](https://cloud.google.com/cpp/docs/reference/common/latest/structgoogle_1_1cloud_1_1EndpointOption.html) may be useless, in which case it must be overridden.\n| **Deprecated:** Please use the `location` overload instead.\n\n### MakeDefaultDocumentProcessorServiceConnectionIdempotencyPolicy()"]]