// services/network/public/mojom/http_request_headers.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 SERVICES_NETWORK_PUBLIC_MOJOM_HTTP_REQUEST_HEADERS_MOJOM_DATA_VIEW_H_
#define SERVICES_NETWORK_PUBLIC_MOJOM_HTTP_REQUEST_HEADERS_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 "services/network/public/mojom/http_request_headers.mojom-shared-internal.h"
#include "mojo/public/mojom/base/byte_string.mojom-shared.h"


namespace network::mojom {
class HttpRequestHeaderKeyValuePairDataView;

class HttpRequestHeadersDataView;

class HttpRequestHeadersUpdateParamsDataView;



}  // network::mojom


namespace mojo {
namespace internal {

template <>
struct MojomTypeTraits<::network::mojom::HttpRequestHeaderKeyValuePairDataView> {
  using Data = ::network::mojom::internal::HttpRequestHeaderKeyValuePair_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::network::mojom::HttpRequestHeadersDataView> {
  using Data = ::network::mojom::internal::HttpRequestHeaders_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::network::mojom::HttpRequestHeadersUpdateParamsDataView> {
  using Data = ::network::mojom::internal::HttpRequestHeadersUpdateParams_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

}  // namespace internal
}  // namespace mojo


namespace network::mojom {


class HttpRequestHeaderKeyValuePairDataView {
 public:
  HttpRequestHeaderKeyValuePairDataView() = default;

  HttpRequestHeaderKeyValuePairDataView(
      internal::HttpRequestHeaderKeyValuePair_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  inline void GetKeyDataView(
      mojo::StringDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadKey(UserType* output) {
    
    auto* pointer = data_->key.Get();
    return mojo::internal::Deserialize<mojo::StringDataView>(
        pointer, output, message_);
  }
  inline void GetValueDataView(
      ::mojo_base::mojom::ByteStringDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadValue(UserType* output) {
    
    auto* pointer = data_->value.Get();
    return mojo::internal::Deserialize<::mojo_base::mojom::ByteStringDataView>(
        pointer, output, message_);
  }
 private:
  internal::HttpRequestHeaderKeyValuePair_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class HttpRequestHeadersDataView {
 public:
  HttpRequestHeadersDataView() = default;

  HttpRequestHeadersDataView(
      internal::HttpRequestHeaders_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

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

  template <typename UserType>
  [[nodiscard]] bool ReadHeaders(UserType* output) {
    
    auto* pointer = data_->headers.Get();
    return mojo::internal::Deserialize<mojo::ArrayDataView<::network::mojom::HttpRequestHeaderKeyValuePairDataView>>(
        pointer, output, message_);
  }
 private:
  internal::HttpRequestHeaders_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class HttpRequestHeadersUpdateParamsDataView {
 public:
  HttpRequestHeadersUpdateParamsDataView() = default;

  HttpRequestHeadersUpdateParamsDataView(
      internal::HttpRequestHeadersUpdateParams_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

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

  template <typename UserType>
  [[nodiscard]] bool ReadRemovedHeaders(UserType* output) {
    
    auto* pointer = data_->removed_headers.Get();
    return mojo::internal::Deserialize<mojo::ArrayDataView<mojo::StringDataView>>(
        pointer, output, message_);
  }
  inline void GetModifiedHeadersDataView(
      HttpRequestHeadersDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadModifiedHeaders(UserType* output) {
    
    auto* pointer = data_->modified_headers.Get();
    return mojo::internal::Deserialize<::network::mojom::HttpRequestHeadersDataView>(
        pointer, output, message_);
  }
  inline void GetModifiedCorsExemptHeadersDataView(
      HttpRequestHeadersDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadModifiedCorsExemptHeaders(UserType* output) {
    
    auto* pointer = data_->modified_cors_exempt_headers.Get();
    return mojo::internal::Deserialize<::network::mojom::HttpRequestHeadersDataView>(
        pointer, output, message_);
  }
 private:
  internal::HttpRequestHeadersUpdateParams_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


}  // network::mojom

#endif  // SERVICES_NETWORK_PUBLIC_MOJOM_HTTP_REQUEST_HEADERS_MOJOM_DATA_VIEW_H_