// device/bluetooth/public/mojom/gatt_characteristic_properties.mojom-blink.cc is auto generated by mojom_bindings_generator.py, do not edit

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

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

#include "device/bluetooth/public/mojom/gatt_characteristic_properties.mojom-blink.h"
#include <stdint.h>
#include <utility>
#include "mojo/public/cpp/bindings/lib/default_construct_tag_internal.h"
#include "mojo/public/cpp/bindings/lib/serialization.h"
#include "mojo/public/cpp/bindings/lib/validate_params.h"
#include "mojo/public/cpp/bindings/lib/validation_errors.h"
#include "mojo/public/cpp/bindings/mojo_buildflags.h"
#include "third_party/perfetto/include/perfetto/tracing/traced_value.h"

#include "device/bluetooth/public/mojom/gatt_characteristic_properties.mojom-params-data.h"
#include "device/bluetooth/public/mojom/gatt_characteristic_properties.mojom-shared-message-ids.h"

#include "device/bluetooth/public/mojom/gatt_characteristic_properties.mojom-blink-import-headers.h"
#include "device/bluetooth/public/mojom/gatt_characteristic_properties.mojom-blink-test-utils.h"
#include "mojo/public/cpp/bindings/lib/wtf_serialization.h"


namespace bluetooth::mojom::blink {
GattCharacteristicProperties::GattCharacteristicProperties()
    : broadcast(),
      read(),
      write_without_response(),
      write(),
      notify(),
      indicate(),
      authenticated_signed_writes(),
      extended_properties(),
      reliable_write(),
      writable_auxiliaries(),
      read_encrypted(),
      write_encrypted(),
      read_encrypted_authenticated(),
      write_encrypted_authenticated() {}

GattCharacteristicProperties::GattCharacteristicProperties(
    bool broadcast_in,
    bool read_in,
    bool write_without_response_in,
    bool write_in,
    bool notify_in,
    bool indicate_in,
    bool authenticated_signed_writes_in,
    bool extended_properties_in,
    bool reliable_write_in,
    bool writable_auxiliaries_in,
    bool read_encrypted_in,
    bool write_encrypted_in,
    bool read_encrypted_authenticated_in,
    bool write_encrypted_authenticated_in)
    : broadcast(std::move(broadcast_in)),
      read(std::move(read_in)),
      write_without_response(std::move(write_without_response_in)),
      write(std::move(write_in)),
      notify(std::move(notify_in)),
      indicate(std::move(indicate_in)),
      authenticated_signed_writes(std::move(authenticated_signed_writes_in)),
      extended_properties(std::move(extended_properties_in)),
      reliable_write(std::move(reliable_write_in)),
      writable_auxiliaries(std::move(writable_auxiliaries_in)),
      read_encrypted(std::move(read_encrypted_in)),
      write_encrypted(std::move(write_encrypted_in)),
      read_encrypted_authenticated(std::move(read_encrypted_authenticated_in)),
      write_encrypted_authenticated(std::move(write_encrypted_authenticated_in)) {}

GattCharacteristicProperties::~GattCharacteristicProperties() = default;
size_t GattCharacteristicProperties::Hash(size_t seed) const {
  seed = mojo::internal::WTFHash(seed, this->broadcast);
  seed = mojo::internal::WTFHash(seed, this->read);
  seed = mojo::internal::WTFHash(seed, this->write_without_response);
  seed = mojo::internal::WTFHash(seed, this->write);
  seed = mojo::internal::WTFHash(seed, this->notify);
  seed = mojo::internal::WTFHash(seed, this->indicate);
  seed = mojo::internal::WTFHash(seed, this->authenticated_signed_writes);
  seed = mojo::internal::WTFHash(seed, this->extended_properties);
  seed = mojo::internal::WTFHash(seed, this->reliable_write);
  seed = mojo::internal::WTFHash(seed, this->writable_auxiliaries);
  seed = mojo::internal::WTFHash(seed, this->read_encrypted);
  seed = mojo::internal::WTFHash(seed, this->write_encrypted);
  seed = mojo::internal::WTFHash(seed, this->read_encrypted_authenticated);
  seed = mojo::internal::WTFHash(seed, this->write_encrypted_authenticated);
  return seed;
}

void GattCharacteristicProperties::WriteIntoTrace(
    perfetto::TracedValue traced_context) const {
  [[maybe_unused]] auto dict = std::move(traced_context).WriteDictionary();
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "broadcast"), this->broadcast,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "read"), this->read,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "write_without_response"), this->write_without_response,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "write"), this->write,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "notify"), this->notify,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "indicate"), this->indicate,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "authenticated_signed_writes"), this->authenticated_signed_writes,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "extended_properties"), this->extended_properties,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "reliable_write"), this->reliable_write,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "writable_auxiliaries"), this->writable_auxiliaries,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "read_encrypted"), this->read_encrypted,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "write_encrypted"), this->write_encrypted,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "read_encrypted_authenticated"), this->read_encrypted_authenticated,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "write_encrypted_authenticated"), this->write_encrypted_authenticated,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
}

bool GattCharacteristicProperties::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}


}  // bluetooth::mojom::blink


namespace mojo {


// static
bool StructTraits<::bluetooth::mojom::blink::GattCharacteristicProperties::DataView, ::bluetooth::mojom::blink::GattCharacteristicPropertiesPtr>::Read(
    ::bluetooth::mojom::blink::GattCharacteristicProperties::DataView input,
    ::bluetooth::mojom::blink::GattCharacteristicPropertiesPtr* output) {
  bool success = true;
  ::bluetooth::mojom::blink::GattCharacteristicPropertiesPtr result(::bluetooth::mojom::blink::GattCharacteristicProperties::New());
  
      if (success)
        result->broadcast = input.broadcast();
      if (success)
        result->read = input.read();
      if (success)
        result->write_without_response = input.write_without_response();
      if (success)
        result->write = input.write();
      if (success)
        result->notify = input.notify();
      if (success)
        result->indicate = input.indicate();
      if (success)
        result->authenticated_signed_writes = input.authenticated_signed_writes();
      if (success)
        result->extended_properties = input.extended_properties();
      if (success)
        result->reliable_write = input.reliable_write();
      if (success)
        result->writable_auxiliaries = input.writable_auxiliaries();
      if (success)
        result->read_encrypted = input.read_encrypted();
      if (success)
        result->write_encrypted = input.write_encrypted();
      if (success)
        result->read_encrypted_authenticated = input.read_encrypted_authenticated();
      if (success)
        result->write_encrypted_authenticated = input.write_encrypted_authenticated();
  *output = std::move(result);
  return success;
}

}  // namespace mojo


// Symbols declared in the -test-utils.h header are defined here instead of a
// separate .cc file to save compile time.


namespace bluetooth::mojom::blink {




}  // bluetooth::mojom::blink


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