// third_party/blink/public/mojom/geolocation/geolocation_service.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_GEOLOCATION_GEOLOCATION_SERVICE_MOJOM_PARAMS_DATA_H_
#define THIRD_PARTY_BLINK_PUBLIC_MOJOM_GEOLOCATION_GEOLOCATION_SERVICE_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) GeolocationService_CreateGeolocation_Params_Data {
 public:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);

  mojo::internal::StructHeader header_;
  mojo::internal::Handle_Data receiver;
  uint8_t user_gesture : 1;
  uint8_t pad1_[3];
  int32_t accuracy;
  uint8_t padfinal_[4];

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

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

  mojo::internal::StructHeader header_;
  int32_t status;
  uint8_t padfinal_[4];

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

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

}  // namespace internal


class GeolocationService_CreateGeolocation_ParamsDataView {
 public:
  GeolocationService_CreateGeolocation_ParamsDataView() = default;

  GeolocationService_CreateGeolocation_ParamsDataView(
      internal::GeolocationService_CreateGeolocation_Params_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  template <typename UserType>
  UserType TakeReceiver() {
    UserType result;
    bool ret =
        mojo::internal::Deserialize<mojo::InterfaceRequestDataView<::device::mojom::GeolocationInterfaceBase>>(
            &data_->receiver, &result, message_);
    DCHECK(ret);
    return result;
  }
  bool user_gesture() const {
    return data_->user_gesture;
  }
  template <typename UserType>
  [[nodiscard]] bool ReadAccuracy(UserType* output) const {
    auto data_value = data_->accuracy;
    return mojo::internal::Deserialize<::blink::mojom::GeolocationAccuracy>(
        data_value, output);
  }
  ::blink::mojom::GeolocationAccuracy accuracy() const {
    return ::mojo::internal::ToKnownEnumValueHelper(
          static_cast<::blink::mojom::GeolocationAccuracy>(data_->accuracy));
  }
 private:
  internal::GeolocationService_CreateGeolocation_Params_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class GeolocationService_CreateGeolocation_ResponseParamsDataView {
 public:
  GeolocationService_CreateGeolocation_ResponseParamsDataView() = default;

  GeolocationService_CreateGeolocation_ResponseParamsDataView(
      internal::GeolocationService_CreateGeolocation_ResponseParams_Data* data,
      mojo::Message* message)
      : data_(data) {}

  bool is_null() const { return !data_; }
  template <typename UserType>
  [[nodiscard]] bool ReadStatus(UserType* output) const {
    auto data_value = data_->status;
    return mojo::internal::Deserialize<::blink::mojom::PermissionStatus>(
        data_value, output);
  }
  ::blink::mojom::PermissionStatus status() const {
    return ::mojo::internal::ToKnownEnumValueHelper(
          static_cast<::blink::mojom::PermissionStatus>(data_->status));
  }
 private:
  internal::GeolocationService_CreateGeolocation_ResponseParams_Data* data_ = nullptr;
};






}  // blink::mojom

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

#endif  // THIRD_PARTY_BLINK_PUBLIC_MOJOM_GEOLOCATION_GEOLOCATION_SERVICE_MOJOM_PARAMS_DATA_H_