// device/bluetooth/public/mojom/gatt_characteristic_permissions.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 DEVICE_BLUETOOTH_PUBLIC_MOJOM_GATT_CHARACTERISTIC_PERMISSIONS_MOJOM_DATA_VIEW_H_
#define DEVICE_BLUETOOTH_PUBLIC_MOJOM_GATT_CHARACTERISTIC_PERMISSIONS_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 "device/bluetooth/public/mojom/gatt_characteristic_permissions.mojom-shared-internal.h"


namespace bluetooth::mojom {
class GattCharacteristicPermissionsDataView;



}  // bluetooth::mojom


namespace mojo {
namespace internal {

template <>
struct MojomTypeTraits<::bluetooth::mojom::GattCharacteristicPermissionsDataView> {
  using Data = ::bluetooth::mojom::internal::GattCharacteristicPermissions_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

}  // namespace internal
}  // namespace mojo


namespace bluetooth::mojom {


class GattCharacteristicPermissionsDataView {
 public:
  GattCharacteristicPermissionsDataView() = default;

  GattCharacteristicPermissionsDataView(
      internal::GattCharacteristicPermissions_Data* data,
      mojo::Message* message)
      : data_(data) {}

  bool is_null() const { return !data_; }
  bool read() const {
    return data_->read;
  }
  bool write() const {
    return data_->write;
  }
  bool read_encrypted() const {
    return data_->read_encrypted;
  }
  bool write_encrypted() const {
    return data_->write_encrypted;
  }
  bool read_encrypted_authenticated() const {
    return data_->read_encrypted_authenticated;
  }
  bool write_encrypted_authenticated() const {
    return data_->write_encrypted_authenticated;
  }
 private:
  internal::GattCharacteristicPermissions_Data* data_ = nullptr;
};


}  // bluetooth::mojom

#endif  // DEVICE_BLUETOOTH_PUBLIC_MOJOM_GATT_CHARACTERISTIC_PERMISSIONS_MOJOM_DATA_VIEW_H_