C++ Client-Side SDK
LaunchDarkly SDK
events_builder.hpp
1 #pragma once
2 
3 #include <launchdarkly/attribute_reference.hpp>
4 #include <launchdarkly/config/shared/built/events.hpp>
5 #include <launchdarkly/error.hpp>
6 
7 #include "tl/expected.hpp"
8 
9 #include <memory>
10 #include <optional>
11 #include <string>
12 #include <unordered_map>
13 
14 namespace launchdarkly::config::shared::builders {
15 
16 template <typename SDK>
17 class EventsBuilder;
18 
19 template <typename SDK>
20 bool operator==(EventsBuilder<SDK> const& lhs, EventsBuilder<SDK> const& rhs);
21 
28 template <typename SDK>
30  public:
31  friend bool operator==
32  <SDK>(EventsBuilder<SDK> const& lhs, EventsBuilder<SDK> const& rhs);
36  EventsBuilder();
37 
44  EventsBuilder& Enabled(bool enabled);
45 
51 
59  EventsBuilder& Capacity(std::size_t capacity);
60 
68  EventsBuilder& FlushInterval(std::chrono::milliseconds interval);
69 
93  EventsBuilder& AllAttributesPrivate(bool all_attributes_private);
94 
100  EventsBuilder& PrivateAttributes(AttributeReference::SetType private_attrs);
101 
109 
122  EventsBuilder& ContextKeysCapacity(std::size_t capacity);
123 
128  [[nodiscard]] tl::expected<built::Events, Error> Build() const;
129 
130  private:
131  built::Events config_;
132 };
133 
134 } // namespace launchdarkly::config::shared::builders
Definition: attribute_reference.hpp:34
EventsBuilder & Enabled(bool enabled)
Definition: events_builder.cpp:12
EventsBuilder & PrivateAttribute(AttributeReference attribute)
Definition: events_builder.cpp:56
EventsBuilder & ContextKeysCapacity(std::size_t capacity)
Specifies the number of unique context keys that can be remembered by the index event generation logi...
Definition: events_builder.cpp:29
EventsBuilder()
Definition: events_builder.cpp:9
EventsBuilder & FlushInterval(std::chrono::milliseconds interval)
Definition: events_builder.cpp:36
EventsBuilder & AllAttributesPrivate(bool all_attributes_private)
Definition: events_builder.cpp:43
tl::expected< built::Events, Error > Build() const
Definition: events_builder.cpp:63
EventsBuilder & Capacity(std::size_t capacity)
Definition: events_builder.cpp:23
EventsBuilder & PrivateAttributes(AttributeReference::SetType private_attrs)
Definition: events_builder.cpp:49
EventsBuilder & Disable()
Definition: events_builder.cpp:18