chromium/components/feed/core/v2/protocol_translator.h

// Copyright 2020 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_FEED_CORE_V2_PROTOCOL_TRANSLATOR_H_
#define COMPONENTS_FEED_CORE_V2_PROTOCOL_TRANSLATOR_H_

#include <memory>
#include <optional>
#include <vector>

#include "base/time/time.h"
#include "components/feed/core/proto/v2/packing.pb.h"
#include "components/feed/core/proto/v2/store.pb.h"
#include "components/feed/core/proto/v2/wire/data_operation.pb.h"
#include "components/feed/core/proto/v2/wire/response.pb.h"
#include "components/feed/core/v2/public/types.h"
#include "components/feed/core/v2/scheduling.h"
#include "components/feed/core/v2/types.h"

namespace feed {

// Data for updating StreamModel. This can be sourced from the network or
// persistent storage.
struct StreamModelUpdateRequest {};

struct RefreshResponseData {};

std::optional<feedstore::DataOperation> TranslateDataOperation(
    base::Time current_time,
    feedwire::DataOperation wire_operation);

RefreshResponseData TranslateWireResponse(
    feedwire::Response response,
    StreamModelUpdateRequest::Source source,
    const AccountInfo& account_info,
    base::Time current_time);

std::vector<feedstore::DataOperation> TranslateDismissData(
    base::Time current_time,
    feedpacking::DismissData data);

}  // namespace feed

#endif  // COMPONENTS_FEED_CORE_V2_PROTOCOL_TRANSLATOR_H_