@@ -249,7 +249,7 @@ std::string Messaging::listSubscribers(const std::string &topicId,
249249
250250 std::string url = Config::API_BASE_URL + " /messaging/topics/" + topicId +
251251 " /subscribers" + queries.to_string ();
252- ;
252+
253253
254254 std::vector<std::string> headers = Config::getHeaders (projectId);
255255 headers.push_back (" X-Appwrite-Key: " + apiKey);
@@ -544,6 +544,27 @@ std::string Messaging::deleteProvider(const std::string &providerId) {
544544 return " provider deleted successfully." ;
545545 } else {
546546 throw AppwriteException (" Failed to delete provider. Status code: " +
547+ std::to_string (statusCode) +
548+ " \n Response: " + response);
549+ }
550+ }
551+
552+ std::string Messaging::getProvider (const std::string &providerId) {
553+ if (providerId.empty ()) {
554+ throw AppwriteException (" Missing required parameter: providerId" );
555+ }
556+ std::string url =
557+ Config::API_BASE_URL + " /messaging/providers/" + providerId;
558+ std::vector<std::string> headers = Config::getHeaders (projectId);
559+ headers.push_back (" X-Appwrite-Key: " + apiKey);
560+ std::string response;
561+ int statusCode = Utils::getRequest (url, headers, response);
562+ if (statusCode == HttpStatus::OK ) {
563+ return response;
564+ } else {
565+ throw AppwriteException (" Error fetching provider. Status code: " +
566+ std::to_string (statusCode) +
567+ " \n Response: " + response);
547568 }
548569}
549570
@@ -628,5 +649,5 @@ std::string Messaging::listTargets(const std::string &messageId,
628649 " Error fetching message targets. Status code: " + std::to_string (statusCode) +
629650 " \n\n Response: " + response);
630651 }
631-
632652}
653+
0 commit comments