// -*- mode: C++ -*-
// AUTOGENERATED BY glean_parser. DO NOT EDIT.
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_GleanIpprotectionMetrics_h
#define mozilla_GleanIpprotectionMetrics_h
#include "mozilla/glean/bindings/MetricTypes.h"
namespace mozilla::glean {
namespace ipprotection {
/**
* generated from ipprotection.alert_button_clicked
*/
struct AlertButtonClickedExtra {
mozilla::Maybe<uint32_t> buttontype;
mozilla::Maybe<nsCString> reason;
std::tuple<nsTArray<nsCString>, nsTArray<nsCString>> ToFfiExtra() const {
nsTArray<nsCString> extraKeys;
nsTArray<nsCString> extraValues;
if (buttontype) {
extraKeys.AppendElement()->AssignASCII("buttonType");
extraValues.AppendElement()->AppendInt(buttontype.value());
}
if (reason) {
extraKeys.AppendElement()->AssignASCII("reason");
extraValues.EmplaceBack(reason.value());
}
return std::make_tuple(std::move(extraKeys), std::move(extraValues));
}
};
/**
* Recorded when a user clicks "Continue without VPN" or "Close all tabs" in the VPN alert.
*/
constexpr impl::EventMetric<AlertButtonClickedExtra> alert_button_clicked(456);
/**
* generated from ipprotection.bandwidth_used_threshold
*/
struct BandwidthUsedThresholdExtra {
mozilla::Maybe<uint32_t> percentage;
std::tuple<nsTArray<nsCString>, nsTArray<nsCString>> ToFfiExtra() const {
nsTArray<nsCString> extraKeys;
nsTArray<nsCString> extraValues;
if (percentage) {
extraKeys.AppendElement()->AssignASCII("percentage");
extraValues.AppendElement()->AppendInt(percentage.value());
}
return std::make_tuple(std::move(extraKeys), std::move(extraValues));
}
};
/**
* Recorded when the percentage of bandwidth used crosses a threshold of 50, 75, or 90%.
*/
constexpr impl::EventMetric<BandwidthUsedThresholdExtra> bandwidth_used_threshold(457);
/**
* generated from ipprotection.click_upgrade_button
*/
/**
* This is recorded when a user clicks the upgrade button in the VPN panel.
*/
constexpr impl::EventMetric<NoExtraKeys> click_upgrade_button(458);
/**
* generated from ipprotection.enrollment
*/
struct EnrollmentExtra {
mozilla::Maybe<bool> enrolled;
std::tuple<nsTArray<nsCString>, nsTArray<nsCString>> ToFfiExtra() const {
nsTArray<nsCString> extraKeys;
nsTArray<nsCString> extraValues;
if (enrolled) {
extraKeys.AppendElement()->AssignASCII("enrolled");
extraValues.AppendElement()->AssignASCII(enrolled.value() ? "true" : "false");
}
return std::make_tuple(std::move(extraKeys), std::move(extraValues));
}
};
/**
* Recorded when an account has been enrolled after completing the sign up flow.
*/
constexpr impl::EventMetric<EnrollmentExtra> enrollment(459);
/**
* generated from ipprotection.exclusion_toggled
*/
struct ExclusionToggledExtra {
mozilla::Maybe<bool> excluded;
std::tuple<nsTArray<nsCString>, nsTArray<nsCString>> ToFfiExtra() const {
nsTArray<nsCString> extraKeys;
nsTArray<nsCString> extraValues;
if (excluded) {
extraKeys.AppendElement()->AssignASCII("excluded");
extraValues.AppendElement()->AssignASCII(excluded.value() ? "true" : "false");
}
return std::make_tuple(std::move(extraKeys), std::move(extraValues));
}
};
/**
* Recorded when a site exclusion is added or removed using the panel toggle UI.
*/
constexpr impl::EventMetric<ExclusionToggledExtra> exclusion_toggled(460);
/**
* generated from ipprotection.get_started
*/
/**
* Recorded when the user clicks the get started button in the panel or settings.
*/
constexpr impl::EventMetric<NoExtraKeys> get_started(461);
/**
* generated from ipprotection.removed_from_toolbar
*/
/**
* Recorded when the IP Protection widget is removed from the toolbar.
*/
constexpr impl::EventMetric<NoExtraKeys> removed_from_toolbar(462);
/**
* generated from ipprotection.error
*/
struct ErrorExtra {
mozilla::Maybe<nsCString> source;
std::tuple<nsTArray<nsCString>, nsTArray<nsCString>> ToFfiExtra() const {
nsTArray<nsCString> extraKeys;
nsTArray<nsCString> extraValues;
if (source) {
extraKeys.AppendElement()->AssignASCII("source");
extraValues.EmplaceBack(source.value());
}
return std::make_tuple(std::move(extraKeys), std::move(extraValues));
}
};
/**
* Recorded when the in-panel error message is triggered.
*/
constexpr impl::EventMetric<ErrorExtra> error(463);
/**
* generated from ipprotection.exclusion_added
* Recorded when a site exclusion is added.
*/
constexpr impl::CounterMetric<impl::CounterType::eBaseOrLabeled> exclusion_added(464);
/**
* generated from ipprotection.paused
*/
struct PausedExtra {
mozilla::Maybe<bool> wasactive;
std::tuple<nsTArray<nsCString>, nsTArray<nsCString>> ToFfiExtra() const {
nsTArray<nsCString> extraKeys;
nsTArray<nsCString> extraValues;
if (wasactive) {
extraKeys.AppendElement()->AssignASCII("wasActive");
extraValues.AppendElement()->AssignASCII(wasactive.value() ? "true" : "false");
}
return std::make_tuple(std::move(extraKeys), std::move(extraValues));
}
};
/**
* Recorded when the IPP Proxy manager is set to the paused state.
*/
constexpr impl::EventMetric<PausedExtra> paused(465);
/**
* generated from ipprotection.started
*/
struct StartedExtra {
mozilla::Maybe<bool> inprivatebrowsing;
mozilla::Maybe<bool> useraction;
std::tuple<nsTArray<nsCString>, nsTArray<nsCString>> ToFfiExtra() const {
nsTArray<nsCString> extraKeys;
nsTArray<nsCString> extraValues;
if (inprivatebrowsing) {
extraKeys.AppendElement()->AssignASCII("inPrivateBrowsing");
extraValues.AppendElement()->AssignASCII(inprivatebrowsing.value() ? "true" : "false");
}
if (useraction) {
extraKeys.AppendElement()->AssignASCII("userAction");
extraValues.AppendElement()->AssignASCII(useraction.value() ? "true" : "false");
}
return std::make_tuple(std::move(extraKeys), std::move(extraValues));
}
};
/**
* Recorded when IP Protection is started.
*/
constexpr impl::EventMetric<StartedExtra> started(466);
/**
* generated from ipprotection.stopped
*/
struct StoppedExtra {
mozilla::Maybe<nsCString> duration;
mozilla::Maybe<bool> useraction;
std::tuple<nsTArray<nsCString>, nsTArray<nsCString>> ToFfiExtra() const {
nsTArray<nsCString> extraKeys;
nsTArray<nsCString> extraValues;
if (duration) {
extraKeys.AppendElement()->AssignASCII("duration");
extraValues.EmplaceBack(duration.value());
}
if (useraction) {
extraKeys.AppendElement()->AssignASCII("userAction");
extraValues.AppendElement()->AssignASCII(useraction.value() ? "true" : "false");
}
return std::make_tuple(std::move(extraKeys), std::move(extraValues));
}
};
/**
* Recorded when IP Protection is stopped.
*/
constexpr impl::EventMetric<StoppedExtra> stopped(467);
}
} // namespace mozilla::glean
#endif // mozilla_GleanIpprotectionMetrics_h