A connection to Cloud Pub/Sub for topic-related administrative operations.
This interface defines pure-virtual functions for each of the user-facing overload sets in TopicAdminClient. That is, all of TopicAdminClient's overloads will forward to the one pure-virtual function declared in this interface. This allows users to inject custom behavior (e.g., with a Google Mock object) in a TopicAdminClient object for use in their own tests.
To create a concrete instance that connects you to the real Cloud Pub/Sub service, see MakeTopicAdminConnection().
The *Params nested classes
Applications may define classes derived from TopicAdminConnection, for example, because they want to mock the class. To avoid breaking all such derived classes when we change the number or type of the arguments to the member functions we define lightweight structures to pass the arguments.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Class TopicAdminConnection (2.39.0)\n\nVersion 2.39.0keyboard_arrow_down\n\n- [2.42.0-rc (latest)](/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminConnection)\n- [2.41.0](/cpp/docs/reference/pubsub/2.41.0/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminConnection)\n- [2.40.0](/cpp/docs/reference/pubsub/2.40.0/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminConnection)\n- [2.39.0](/cpp/docs/reference/pubsub/2.39.0/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminConnection)\n- [2.38.0](/cpp/docs/reference/pubsub/2.38.0/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminConnection)\n- [2.37.0](/cpp/docs/reference/pubsub/2.37.0/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminConnection)\n- [2.36.0](/cpp/docs/reference/pubsub/2.36.0/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminConnection)\n- [2.35.0](/cpp/docs/reference/pubsub/2.35.0/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminConnection)\n- [2.34.0](/cpp/docs/reference/pubsub/2.34.0/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminConnection)\n- [2.33.0](/cpp/docs/reference/pubsub/2.33.0/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminConnection)\n- [2.32.0](/cpp/docs/reference/pubsub/2.32.0/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminConnection)\n- [2.31.0](/cpp/docs/reference/pubsub/2.31.0/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminConnection)\n- [2.30.0](/cpp/docs/reference/pubsub/2.30.0/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminConnection)\n- [2.29.0](/cpp/docs/reference/pubsub/2.29.0/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminConnection)\n- [2.28.0](/cpp/docs/reference/pubsub/2.28.0/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminConnection)\n- [2.27.0](/cpp/docs/reference/pubsub/2.27.0/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminConnection)\n- [2.26.0](/cpp/docs/reference/pubsub/2.26.0/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminConnection)\n- [2.25.1](/cpp/docs/reference/pubsub/2.25.1/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminConnection)\n- [2.24.0](/cpp/docs/reference/pubsub/2.24.0/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminConnection)\n- [2.23.0](/cpp/docs/reference/pubsub/2.23.0/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminConnection)\n- [2.22.1](/cpp/docs/reference/pubsub/2.22.1/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminConnection)\n- [2.21.0](/cpp/docs/reference/pubsub/2.21.0/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminConnection)\n- [2.20.0](/cpp/docs/reference/pubsub/2.20.0/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminConnection)\n- [2.19.0](/cpp/docs/reference/pubsub/2.19.0/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminConnection)\n- [2.18.0](/cpp/docs/reference/pubsub/2.18.0/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminConnection)\n- [2.17.0](/cpp/docs/reference/pubsub/2.17.0/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminConnection)\n- [2.16.0](/cpp/docs/reference/pubsub/2.16.0/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminConnection)\n- [2.15.1](/cpp/docs/reference/pubsub/2.15.1/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminConnection)\n- [2.14.0](/cpp/docs/reference/pubsub/2.14.0/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminConnection)\n- [2.13.0](/cpp/docs/reference/pubsub/2.13.0/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminConnection)\n- [2.12.0](/cpp/docs/reference/pubsub/2.12.0/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminConnection)\n- [2.11.0](/cpp/docs/reference/pubsub/2.11.0/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminConnection) \nA connection to Cloud Pub/Sub for topic-related administrative operations. \n| **Deprecated:** Please use [`google::cloud::pubsub_admin::SubscriptionAdminClient`](/cpp/docs/reference/pubsub/2.39.0/classgoogle_1_1cloud_1_1pubsub__admin_1_1SubscriptionAdminClient) and [`google::cloud::pubsub_admin::SubscriptionAdminClient`](/cpp/docs/reference/pubsub/2.39.0/classgoogle_1_1cloud_1_1pubsub__admin_1_1SubscriptionAdminClient) instead.\n\nThis interface defines pure-virtual functions for each of the user-facing overload sets in [`TopicAdminClient`](/cpp/docs/reference/pubsub/2.39.0/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminClient). That is, all of [`TopicAdminClient`](/cpp/docs/reference/pubsub/2.39.0/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminClient)'s overloads will forward to the one pure-virtual function declared in this interface. This allows users to inject custom behavior (e.g., with a Google Mock object) in a [`TopicAdminClient`](/cpp/docs/reference/pubsub/2.39.0/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminClient) object for use in their own tests.\n\nTo create a concrete instance that connects you to the real Cloud Pub/Sub service, see [`MakeTopicAdminConnection()`](/cpp/docs/reference/pubsub/2.39.0/namespacegoogle_1_1cloud_1_1pubsub).\n\n###### The \\*Params nested classes\n\nApplications may define classes derived from [`TopicAdminConnection`](/cpp/docs/reference/pubsub/2.39.0/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminConnection), for example, because they want to mock the class. To avoid breaking all such derived classes when we change the number or type of the arguments to the member functions we define lightweight structures to pass the arguments.\n\nFunctions\n---------\n\n### virtual CreateTopic(CreateTopicParams)\n\nDefines the interface for [`TopicAdminClient::CreateTopic()`](/cpp/docs/reference/pubsub/2.39.0/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminClient#classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminClient_1a037c6df1e7d340d349a803e90415f8d6)\n\n### virtual GetTopic(GetTopicParams)\n\nDefines the interface for [`TopicAdminClient::GetTopic()`](/cpp/docs/reference/pubsub/2.39.0/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminClient#classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminClient_1a57b52eb0fcabb1844626ca101dce603b)\n\n### virtual UpdateTopic(UpdateTopicParams)\n\nDefines the interface for [`TopicAdminClient::UpdateTopic()`](/cpp/docs/reference/pubsub/2.39.0/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminClient#classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminClient_1a118443518613705b058eb7f1f3f3086c)\n\n### virtual ListTopics(ListTopicsParams)\n\nDefines the interface for [`TopicAdminClient::ListTopics()`](/cpp/docs/reference/pubsub/2.39.0/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminClient#classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminClient_1a65681f1a6f2b4969bf4124add6a332c6)\n\n### virtual DeleteTopic(DeleteTopicParams)\n\nDefines the interface for [`TopicAdminClient::DeleteTopic()`](/cpp/docs/reference/pubsub/2.39.0/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminClient#classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminClient_1adf7d71657613223f2c5fa77ef7567038)\n\n### virtual DetachSubscription(DetachSubscriptionParams)\n\nDefines the interface for `TopicAdminClient::DetachSubscriptions()`\n\n### virtual ListTopicSubscriptions(ListTopicSubscriptionsParams)\n\nDefines the interface for [`TopicAdminClient::ListTopicSubscriptions()`](/cpp/docs/reference/pubsub/2.39.0/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminClient#classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminClient_1a56e35c0ff68bc0091d6d1dd617271b0c)\n\n### virtual ListTopicSnapshots(ListTopicSnapshotsParams)\n\nDefines the interface for [`TopicAdminClient::ListTopicSnapshots()`](/cpp/docs/reference/pubsub/2.39.0/classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminClient#classgoogle_1_1cloud_1_1pubsub_1_1TopicAdminClient_1a2e9b1ea2b5fdd1ae8c54051654863eef)\n\n### virtual options() const\n\nReturns the options used to create the connection."]]