chromium/components/plus_addresses/plus_address_types.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_PLUS_ADDRESSES_PLUS_ADDRESS_TYPES_H_
#define COMPONENTS_PLUS_ADDRESSES_PLUS_ADDRESS_TYPES_H_

#include <iosfwd>
#include <map>
#include <optional>
#include <ostream>
#include <string>

#include "base/functional/callback_forward.h"
#include "base/time/time.h"
#include "base/types/expected.h"
#include "base/types/strong_alias.h"
#include "components/affiliations/core/browser/affiliation_utils.h"
#include "components/autofill/core/browser/autofill_plus_address_delegate.h"

// A common place for PlusAddress types to be defined.
namespace plus_addresses {

PlusAddress;

// A representation of a pre-allocated plus address as received from the server.
struct PreallocatedPlusAddress final {};

struct PlusProfile {};

struct PlusProfileFacetComparator {};

enum class PlusAddressRequestErrorType {};

class PlusAddressRequestError {};

class PlusAddressDataChange {};

// Only used by Autofill.
PlusAddressCallback;

// Holds either a PlusProfile or an error that prevented us from getting it.
PlusProfileOrError;
PlusAddressRequestCallback;

// Defined for use in metrics and to share code for certain network-requests.
enum class PlusAddressNetworkRequestType {};

std::ostream& operator<<(std::ostream& os,
                         const PreallocatedPlusAddress& address);
std::ostream& operator<<(std::ostream& os, PlusAddressRequestErrorType type);
std::ostream& operator<<(std::ostream& os,
                         const PlusAddressRequestError& error);
std::ostream& operator<<(std::ostream& os, const PlusProfile& profile);
std::ostream& operator<<(std::ostream& os, const PlusProfileOrError& profile);

}  // namespace plus_addresses

#endif  // COMPONENTS_PLUS_ADDRESSES_PLUS_ADDRESS_TYPES_H_