// third_party/blink/public/mojom/blob/data_element.mojom-params-data.h is auto generated by mojom_bindings_generator.py, do not edit

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

#ifndef THIRD_PARTY_BLINK_PUBLIC_MOJOM_BLOB_DATA_ELEMENT_MOJOM_PARAMS_DATA_H_
#define THIRD_PARTY_BLINK_PUBLIC_MOJOM_BLOB_DATA_ELEMENT_MOJOM_PARAMS_DATA_H_
#include "mojo/public/cpp/bindings/array_data_view.h"
#include "mojo/public/cpp/bindings/map_data_view.h"
#include "mojo/public/cpp/bindings/string_data_view.h"

#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif

namespace mojo::internal {
class ValidationContext;
}


namespace blink::mojom {
namespace internal {
class COMPONENT_EXPORT(MOJOM_SHARED_BLINK_COMMON_EXPORT) BytesProvider_RequestAsReply_Params_Data {
 public:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);

  mojo::internal::StructHeader header_;

 private:
  friend class mojo::internal::MessageFragment<BytesProvider_RequestAsReply_Params_Data>;

  BytesProvider_RequestAsReply_Params_Data();
  ~BytesProvider_RequestAsReply_Params_Data() = delete;
};
static_assert(sizeof(BytesProvider_RequestAsReply_Params_Data) == 8,
              "Bad sizeof(BytesProvider_RequestAsReply_Params_Data)");
class COMPONENT_EXPORT(MOJOM_SHARED_BLINK_COMMON_EXPORT) BytesProvider_RequestAsReply_ResponseParams_Data {
 public:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);

  mojo::internal::StructHeader header_;
  mojo::internal::Pointer<mojo::internal::Array_Data<uint8_t>> data;

 private:
  friend class mojo::internal::MessageFragment<BytesProvider_RequestAsReply_ResponseParams_Data>;

  BytesProvider_RequestAsReply_ResponseParams_Data();
  ~BytesProvider_RequestAsReply_ResponseParams_Data() = delete;
};
static_assert(sizeof(BytesProvider_RequestAsReply_ResponseParams_Data) == 16,
              "Bad sizeof(BytesProvider_RequestAsReply_ResponseParams_Data)");
class COMPONENT_EXPORT(MOJOM_SHARED_BLINK_COMMON_EXPORT) BytesProvider_RequestAsStream_Params_Data {
 public:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);

  mojo::internal::StructHeader header_;
  mojo::internal::Handle_Data pipe;
  uint8_t padfinal_[4];

 private:
  friend class mojo::internal::MessageFragment<BytesProvider_RequestAsStream_Params_Data>;

  BytesProvider_RequestAsStream_Params_Data();
  ~BytesProvider_RequestAsStream_Params_Data() = delete;
};
static_assert(sizeof(BytesProvider_RequestAsStream_Params_Data) == 16,
              "Bad sizeof(BytesProvider_RequestAsStream_Params_Data)");
class COMPONENT_EXPORT(MOJOM_SHARED_BLINK_COMMON_EXPORT) BytesProvider_RequestAsFile_Params_Data {
 public:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);

  mojo::internal::StructHeader header_;
  uint64_t source_offset;
  uint64_t source_size;
  mojo::internal::Pointer<::mojo_base::mojom::internal::File_Data> file;
  uint64_t file_offset;

 private:
  friend class mojo::internal::MessageFragment<BytesProvider_RequestAsFile_Params_Data>;

  BytesProvider_RequestAsFile_Params_Data();
  ~BytesProvider_RequestAsFile_Params_Data() = delete;
};
static_assert(sizeof(BytesProvider_RequestAsFile_Params_Data) == 40,
              "Bad sizeof(BytesProvider_RequestAsFile_Params_Data)");
class COMPONENT_EXPORT(MOJOM_SHARED_BLINK_COMMON_EXPORT) BytesProvider_RequestAsFile_ResponseParams_Data {
 public:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);

  mojo::internal::StructHeader header_;
  mojo::internal::Pointer<::mojo_base::mojom::internal::Time_Data> time_file_modified;

 private:
  friend class mojo::internal::MessageFragment<BytesProvider_RequestAsFile_ResponseParams_Data>;

  BytesProvider_RequestAsFile_ResponseParams_Data();
  ~BytesProvider_RequestAsFile_ResponseParams_Data() = delete;
};
static_assert(sizeof(BytesProvider_RequestAsFile_ResponseParams_Data) == 16,
              "Bad sizeof(BytesProvider_RequestAsFile_ResponseParams_Data)");

}  // namespace internal


class BytesProvider_RequestAsReply_ParamsDataView {
 public:
  BytesProvider_RequestAsReply_ParamsDataView() = default;

  BytesProvider_RequestAsReply_ParamsDataView(
      internal::BytesProvider_RequestAsReply_Params_Data* data,
      mojo::Message* message)
      : data_(data) {}

  bool is_null() const { return !data_; }
 private:
  internal::BytesProvider_RequestAsReply_Params_Data* data_ = nullptr;
};


class BytesProvider_RequestAsReply_ResponseParamsDataView {
 public:
  BytesProvider_RequestAsReply_ResponseParamsDataView() = default;

  BytesProvider_RequestAsReply_ResponseParamsDataView(
      internal::BytesProvider_RequestAsReply_ResponseParams_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

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

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


class BytesProvider_RequestAsStream_ParamsDataView {
 public:
  BytesProvider_RequestAsStream_ParamsDataView() = default;

  BytesProvider_RequestAsStream_ParamsDataView(
      internal::BytesProvider_RequestAsStream_Params_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  mojo::ScopedDataPipeProducerHandle TakePipe() {
    mojo::ScopedDataPipeProducerHandle result;
    bool ret =
        mojo::internal::Deserialize<mojo::ScopedDataPipeProducerHandle>(
            &data_->pipe, &result, message_);
    DCHECK(ret);
    return result;
  }
 private:
  internal::BytesProvider_RequestAsStream_Params_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class BytesProvider_RequestAsFile_ParamsDataView {
 public:
  BytesProvider_RequestAsFile_ParamsDataView() = default;

  BytesProvider_RequestAsFile_ParamsDataView(
      internal::BytesProvider_RequestAsFile_Params_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  uint64_t source_offset() const {
    return data_->source_offset;
  }
  uint64_t source_size() const {
    return data_->source_size;
  }
  inline void GetFileDataView(
      ::mojo_base::mojom::FileDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadFile(UserType* output) {
    
    auto* pointer = data_->file.Get();
    return mojo::internal::Deserialize<::mojo_base::mojom::FileDataView>(
        pointer, output, message_);
  }
  uint64_t file_offset() const {
    return data_->file_offset;
  }
 private:
  internal::BytesProvider_RequestAsFile_Params_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class BytesProvider_RequestAsFile_ResponseParamsDataView {
 public:
  BytesProvider_RequestAsFile_ResponseParamsDataView() = default;

  BytesProvider_RequestAsFile_ResponseParamsDataView(
      internal::BytesProvider_RequestAsFile_ResponseParams_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  inline void GetTimeFileModifiedDataView(
      ::mojo_base::mojom::TimeDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadTimeFileModified(UserType* output) {
    
static_assert(
    mojo::internal::IsValidUserTypeForOptionalValue<
        ::mojo_base::mojom::TimeDataView, UserType>(),
    "Attempting to read the optional `time_file_modified` field into a type which "
    "cannot represent a null value. Either wrap the destination object "
    "with std::optional, ensure that any corresponding "
    "{Struct/Union/Array/String}Traits define the necessary IsNull and "
    "SetToNull methods, or use `MaybeReadTimeFileModified` instead "
    "of `ReadTimeFileModified if you're fine with null values being "
    "silently ignored in this case.");
    auto* pointer = data_->time_file_modified.Get();
    return mojo::internal::Deserialize<::mojo_base::mojom::TimeDataView>(
        pointer, output, message_);
  }
 private:
  internal::BytesProvider_RequestAsFile_ResponseParams_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};



inline void BytesProvider_RequestAsReply_ResponseParamsDataView::GetDataDataView(
    mojo::ArrayDataView<uint8_t>* output) {
  auto pointer = data_->data.Get();
  *output = mojo::ArrayDataView<uint8_t>(pointer, message_);
}




inline void BytesProvider_RequestAsFile_ParamsDataView::GetFileDataView(
    ::mojo_base::mojom::FileDataView* output) {
  auto pointer = data_->file.Get();
  *output = ::mojo_base::mojom::FileDataView(pointer, message_);
}


inline void BytesProvider_RequestAsFile_ResponseParamsDataView::GetTimeFileModifiedDataView(
    ::mojo_base::mojom::TimeDataView* output) {
  auto pointer = data_->time_file_modified.Get();
  *output = ::mojo_base::mojom::TimeDataView(pointer, message_);
}



}  // blink::mojom

#if defined(__clang__)
#pragma clang diagnostic pop
#endif

#endif  // THIRD_PARTY_BLINK_PUBLIC_MOJOM_BLOB_DATA_ELEMENT_MOJOM_PARAMS_DATA_H_