// services/device/public/mojom/geolocation_internals.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 SERVICES_DEVICE_PUBLIC_MOJOM_GEOLOCATION_INTERNALS_MOJOM_PARAMS_DATA_H_
#define SERVICES_DEVICE_PUBLIC_MOJOM_GEOLOCATION_INTERNALS_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 device::mojom {
namespace internal {
class  GeolocationInternalsObserver_OnDiagnosticsChanged_Params_Data {
 public:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);

  mojo::internal::StructHeader header_;
  mojo::internal::Pointer<internal::GeolocationDiagnostics_Data> diagnostics;

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

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

  mojo::internal::StructHeader header_;
  mojo::internal::Pointer<mojo::internal::Array_Data<mojo::internal::Pointer<internal::AccessPointData_Data>>> access_point_data;

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

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

  mojo::internal::StructHeader header_;
  mojo::internal::Pointer<internal::NetworkLocationResponse_Data> response;

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

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

  mojo::internal::StructHeader header_;
  mojo::internal::Interface_Data observer;

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

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

  mojo::internal::StructHeader header_;
  mojo::internal::Pointer<internal::GeolocationDiagnostics_Data> diagnostics;

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

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

}  // namespace internal


class GeolocationInternalsObserver_OnDiagnosticsChanged_ParamsDataView {
 public:
  GeolocationInternalsObserver_OnDiagnosticsChanged_ParamsDataView() = default;

  GeolocationInternalsObserver_OnDiagnosticsChanged_ParamsDataView(
      internal::GeolocationInternalsObserver_OnDiagnosticsChanged_Params_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  inline void GetDiagnosticsDataView(
      GeolocationDiagnosticsDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadDiagnostics(UserType* output) {
    
    auto* pointer = data_->diagnostics.Get();
    return mojo::internal::Deserialize<::device::mojom::GeolocationDiagnosticsDataView>(
        pointer, output, message_);
  }
 private:
  internal::GeolocationInternalsObserver_OnDiagnosticsChanged_Params_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class GeolocationInternalsObserver_OnNetworkLocationRequested_ParamsDataView {
 public:
  GeolocationInternalsObserver_OnNetworkLocationRequested_ParamsDataView() = default;

  GeolocationInternalsObserver_OnNetworkLocationRequested_ParamsDataView(
      internal::GeolocationInternalsObserver_OnNetworkLocationRequested_Params_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

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

  template <typename UserType>
  [[nodiscard]] bool ReadAccessPointData(UserType* output) {
    
    auto* pointer = data_->access_point_data.Get();
    return mojo::internal::Deserialize<mojo::ArrayDataView<::device::mojom::AccessPointDataDataView>>(
        pointer, output, message_);
  }
 private:
  internal::GeolocationInternalsObserver_OnNetworkLocationRequested_Params_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class GeolocationInternalsObserver_OnNetworkLocationReceived_ParamsDataView {
 public:
  GeolocationInternalsObserver_OnNetworkLocationReceived_ParamsDataView() = default;

  GeolocationInternalsObserver_OnNetworkLocationReceived_ParamsDataView(
      internal::GeolocationInternalsObserver_OnNetworkLocationReceived_Params_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  inline void GetResponseDataView(
      NetworkLocationResponseDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadResponse(UserType* output) {
    
static_assert(
    mojo::internal::IsValidUserTypeForOptionalValue<
        ::device::mojom::NetworkLocationResponseDataView, UserType>(),
    "Attempting to read the optional `response` 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 `MaybeReadResponse` instead "
    "of `ReadResponse if you're fine with null values being "
    "silently ignored in this case.");
    auto* pointer = data_->response.Get();
    return mojo::internal::Deserialize<::device::mojom::NetworkLocationResponseDataView>(
        pointer, output, message_);
  }
 private:
  internal::GeolocationInternalsObserver_OnNetworkLocationReceived_Params_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class GeolocationInternals_AddInternalsObserver_ParamsDataView {
 public:
  GeolocationInternals_AddInternalsObserver_ParamsDataView() = default;

  GeolocationInternals_AddInternalsObserver_ParamsDataView(
      internal::GeolocationInternals_AddInternalsObserver_Params_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  template <typename UserType>
  UserType TakeObserver() {
    UserType result;
    bool ret =
        mojo::internal::Deserialize<mojo::InterfacePtrDataView<::device::mojom::GeolocationInternalsObserverInterfaceBase>>(
            &data_->observer, &result, message_);
    DCHECK(ret);
    return result;
  }
 private:
  internal::GeolocationInternals_AddInternalsObserver_Params_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class GeolocationInternals_AddInternalsObserver_ResponseParamsDataView {
 public:
  GeolocationInternals_AddInternalsObserver_ResponseParamsDataView() = default;

  GeolocationInternals_AddInternalsObserver_ResponseParamsDataView(
      internal::GeolocationInternals_AddInternalsObserver_ResponseParams_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  inline void GetDiagnosticsDataView(
      GeolocationDiagnosticsDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadDiagnostics(UserType* output) {
    
static_assert(
    mojo::internal::IsValidUserTypeForOptionalValue<
        ::device::mojom::GeolocationDiagnosticsDataView, UserType>(),
    "Attempting to read the optional `diagnostics` 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 `MaybeReadDiagnostics` instead "
    "of `ReadDiagnostics if you're fine with null values being "
    "silently ignored in this case.");
    auto* pointer = data_->diagnostics.Get();
    return mojo::internal::Deserialize<::device::mojom::GeolocationDiagnosticsDataView>(
        pointer, output, message_);
  }
 private:
  internal::GeolocationInternals_AddInternalsObserver_ResponseParams_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};

inline void GeolocationInternalsObserver_OnDiagnosticsChanged_ParamsDataView::GetDiagnosticsDataView(
    GeolocationDiagnosticsDataView* output) {
  auto pointer = data_->diagnostics.Get();
  *output = GeolocationDiagnosticsDataView(pointer, message_);
}


inline void GeolocationInternalsObserver_OnNetworkLocationRequested_ParamsDataView::GetAccessPointDataDataView(
    mojo::ArrayDataView<AccessPointDataDataView>* output) {
  auto pointer = data_->access_point_data.Get();
  *output = mojo::ArrayDataView<AccessPointDataDataView>(pointer, message_);
}


inline void GeolocationInternalsObserver_OnNetworkLocationReceived_ParamsDataView::GetResponseDataView(
    NetworkLocationResponseDataView* output) {
  auto pointer = data_->response.Get();
  *output = NetworkLocationResponseDataView(pointer, message_);
}




inline void GeolocationInternals_AddInternalsObserver_ResponseParamsDataView::GetDiagnosticsDataView(
    GeolocationDiagnosticsDataView* output) {
  auto pointer = data_->diagnostics.Get();
  *output = GeolocationDiagnosticsDataView(pointer, message_);
}



}  // device::mojom

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

#endif  // SERVICES_DEVICE_PUBLIC_MOJOM_GEOLOCATION_INTERNALS_MOJOM_PARAMS_DATA_H_