// services/device/public/mojom/public_ip_address_geolocation_provider.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_PUBLIC_IP_ADDRESS_GEOLOCATION_PROVIDER_MOJOM_PARAMS_DATA_H_
#define SERVICES_DEVICE_PUBLIC_MOJOM_PUBLIC_IP_ADDRESS_GEOLOCATION_PROVIDER_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  PublicIpAddressGeolocationProvider_CreateGeolocation_Params_Data {
 public:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);

  mojo::internal::StructHeader header_;
  mojo::internal::Pointer<::network::mojom::internal::MutablePartialNetworkTrafficAnnotationTag_Data> tag;
  mojo::internal::Handle_Data receiver;
  int32_t client_id;

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

  PublicIpAddressGeolocationProvider_CreateGeolocation_Params_Data();
  ~PublicIpAddressGeolocationProvider_CreateGeolocation_Params_Data() = delete;
};
static_assert(sizeof(PublicIpAddressGeolocationProvider_CreateGeolocation_Params_Data) == 24,
              "Bad sizeof(PublicIpAddressGeolocationProvider_CreateGeolocation_Params_Data)");

}  // namespace internal


class PublicIpAddressGeolocationProvider_CreateGeolocation_ParamsDataView {
 public:
  PublicIpAddressGeolocationProvider_CreateGeolocation_ParamsDataView() = default;

  PublicIpAddressGeolocationProvider_CreateGeolocation_ParamsDataView(
      internal::PublicIpAddressGeolocationProvider_CreateGeolocation_Params_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  inline void GetTagDataView(
      ::network::mojom::MutablePartialNetworkTrafficAnnotationTagDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadTag(UserType* output) {
    
    auto* pointer = data_->tag.Get();
    return mojo::internal::Deserialize<::network::mojom::MutablePartialNetworkTrafficAnnotationTagDataView>(
        pointer, output, message_);
  }
  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;
  }
  template <typename UserType>
  [[nodiscard]] bool ReadClientId(UserType* output) const {
    auto data_value = data_->client_id;
    return mojo::internal::Deserialize<::device::mojom::GeolocationClientId>(
        data_value, output);
  }
  ::device::mojom::GeolocationClientId client_id() const {
    return ::mojo::internal::ToKnownEnumValueHelper(
          static_cast<::device::mojom::GeolocationClientId>(data_->client_id));
  }
 private:
  internal::PublicIpAddressGeolocationProvider_CreateGeolocation_Params_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};

inline void PublicIpAddressGeolocationProvider_CreateGeolocation_ParamsDataView::GetTagDataView(
    ::network::mojom::MutablePartialNetworkTrafficAnnotationTagDataView* output) {
  auto pointer = data_->tag.Get();
  *output = ::network::mojom::MutablePartialNetworkTrafficAnnotationTagDataView(pointer, message_);
}



}  // device::mojom

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

#endif  // SERVICES_DEVICE_PUBLIC_MOJOM_PUBLIC_IP_ADDRESS_GEOLOCATION_PROVIDER_MOJOM_PARAMS_DATA_H_