chromium/components/attribution_reporting/summary_buckets.h

// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_ATTRIBUTION_REPORTING_SUMMARY_BUCKETS_H_
#define COMPONENTS_ATTRIBUTION_REPORTING_SUMMARY_BUCKETS_H_

#include <stdint.h>

#include "base/component_export.h"
#include "base/containers/flat_set.h"
#include "base/types/expected.h"
#include "base/values.h"
#include "components/attribution_reporting/source_registration_error.mojom-forward.h"
#include "components/attribution_reporting/summary_operator.mojom-forward.h"

namespace attribution_reporting {

class MaxEventLevelReports;

// Controls the bucketization of event-level triggers.
// Corresponds to
// https://wicg.github.io/attribution-reporting-api/#summary-bucket-list
class COMPONENT_EXPORT(ATTRIBUTION_REPORTING) SummaryBuckets {};

COMPONENT_EXPORT(ATTRIBUTION_REPORTING)
base::expected<mojom::SummaryOperator, mojom::SourceRegistrationError>
ParseSummaryOperator(const base::Value::Dict&);

COMPONENT_EXPORT(ATTRIBUTION_REPORTING)
void Serialize(mojom::SummaryOperator, base::Value::Dict&);

}  // namespace attribution_reporting

#endif  // COMPONENTS_ATTRIBUTION_REPORTING_SUMMARY_BUCKETS_H_