// components/private_ai/mojom/oak_session.mojom-data-view.h is auto generated by mojom_bindings_generator.py, do not edit

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

// This file defines XDataView for type traits and can be included in
// _mojom_traits.h definitions but otherwise please use .mojom-forward.h,
// .mojom-shared.h or .mojom.h.

// IWYU pragma: private
// IWYU pragma: friend "traits"

#ifndef COMPONENTS_PRIVATE_AI_MOJOM_OAK_SESSION_MOJOM_DATA_VIEW_H_
#define COMPONENTS_PRIVATE_AI_MOJOM_OAK_SESSION_MOJOM_DATA_VIEW_H_

#include <stdint.h>

#include <functional>
#include <iosfwd>
#include <type_traits>
#include <utility>
#include "mojo/public/cpp/bindings/array_data_view.h"
#include "mojo/public/cpp/bindings/string_data_view.h"
#include "mojo/public/cpp/bindings/lib/serialization.h"

#include "components/private_ai/mojom/oak_session.mojom-shared-internal.h"
#include "sandbox/policy/mojom/sandbox.mojom-shared.h"


namespace private_ai::mojom {
class HandshakeMessageDataView;



}  // private_ai::mojom


namespace mojo {
namespace internal {

template <>
struct MojomTypeTraits<::private_ai::mojom::HandshakeMessageDataView> {
  using Data = ::private_ai::mojom::internal::HandshakeMessage_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

}  // namespace internal
}  // namespace mojo


namespace private_ai::mojom {
// Interface base classes. They are used for type safety check.
class OakSessionInterfaceBase {};

using OakSessionPtrDataView =
    mojo::InterfacePtrDataView<OakSessionInterfaceBase>;
using OakSessionRequestDataView =
    mojo::InterfaceRequestDataView<OakSessionInterfaceBase>;
using OakSessionAssociatedPtrInfoDataView =
    mojo::AssociatedInterfacePtrInfoDataView<OakSessionInterfaceBase>;
using OakSessionAssociatedRequestDataView =
    mojo::AssociatedInterfaceRequestDataView<OakSessionInterfaceBase>;


class HandshakeMessageDataView {
 public:
  HandshakeMessageDataView() = default;

  HandshakeMessageDataView(
      internal::HandshakeMessage_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  inline void GetEphemeralPublicKeyDataView(
      mojo::ArrayDataView<uint8_t>* output);

  template <typename UserType>
  [[nodiscard]] bool ReadEphemeralPublicKey(UserType* output) {
    
    auto* pointer = data_->ephemeral_public_key.Get();
    return mojo::internal::Deserialize<mojo::ArrayDataView<uint8_t>>(
        pointer, output, message_);
  }
  inline void GetCiphertextDataView(
      mojo::ArrayDataView<uint8_t>* output);

  template <typename UserType>
  [[nodiscard]] bool ReadCiphertext(UserType* output) {
    
    auto* pointer = data_->ciphertext.Get();
    return mojo::internal::Deserialize<mojo::ArrayDataView<uint8_t>>(
        pointer, output, message_);
  }
 private:
  internal::HandshakeMessage_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


}  // private_ai::mojom

#endif  // COMPONENTS_PRIVATE_AI_MOJOM_OAK_SESSION_MOJOM_DATA_VIEW_H_