UserAgentGenerator compatibility for previously published EventHubs (#6063)

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
This commit is contained in:
Anton Kolesnyk 2024-10-03 19:48:47 -07:00 committed by GitHub
parent 54e5e22b1a
commit 9aa25a063d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -11,6 +11,8 @@
#include <string>
namespace Azure { namespace Core { namespace Http { namespace _detail {
// NOTE: Treat Azure::Core::Http::_detail::UserAgentGenerator::GenerateUserAgent() as _internal -
// it is being/has been used by eventhubs.
class UserAgentGenerator {
public:
static std::string GenerateUserAgent(
@ -18,5 +20,16 @@ namespace Azure { namespace Core { namespace Http { namespace _detail {
std::string const& componentVersion,
std::string const& applicationId,
long cplusplusValue);
[[deprecated("Use an overload with additional cplusplusValue parameter.")]] static std::string
GenerateUserAgent(
std::string const& componentName,
std::string const& componentVersion,
std::string const& applicationId)
{
// The value of -3L is to signify that an old version of signature has been used (older
// version of eventhubs); we can't rely on cpp version reported by it.
return GenerateUserAgent(componentName, componentVersion, applicationId, -3L);
}
};
}}}} // namespace Azure::Core::Http::_detail