blob: a98a462cc4452b69ea781fa480c8280e60904edc [file] [log] [blame]
Alex Kingsborough20cc27c2024-01-03 23:05:111// Copyright 2023 The Chromium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "components/push_notification/push_notification_client_id.h"
6
7namespace push_notification {
8
9std::optional<std::string> GetClientIdStr(ClientId id) {
10 switch (id) {
11 case ClientId::kNearbyPresence:
12 return kNearbyPresenceClientId;
13 default:
14 return std::nullopt;
15 }
16}
17
Alex Kingsborough06fa5252024-01-09 21:26:1018std::optional<ClientId> GetClientIdFromStr(const std::string& id_string) {
Alex Kingsborough20cc27c2024-01-03 23:05:1119 if (id_string == kNearbyPresenceClientId) {
20 return ClientId::kNearbyPresence;
21 }
Alex Kingsborough06fa5252024-01-09 21:26:1022 return std::nullopt;
Alex Kingsborough20cc27c2024-01-03 23:05:1123}
24
25} // namespace push_notification