#include "extensions/common/api/bluetooth_low_energy.h"
#include <memory>
#include <optional>
#include <ostream>
#include <string>
#include <string_view>
#include <utility>
#include <vector>
#include "base/check.h"
#include "base/check_op.h"
#include "base/notreached.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "tools/json_schema_compiler/util.h"
#include <string_view>
UTF8ToUTF16;
namespace extensions {
namespace api {
namespace bluetooth_low_energy {
const char* ToString(CharacteristicProperty enum_param) { … }
CharacteristicProperty ParseCharacteristicProperty(std::string_view enum_string) { … }
std::u16string GetCharacteristicPropertyParseError(std::string_view enum_string) { … }
const char* ToString(DescriptorPermission enum_param) { … }
DescriptorPermission ParseDescriptorPermission(std::string_view enum_string) { … }
std::u16string GetDescriptorPermissionParseError(std::string_view enum_string) { … }
const char* ToString(AdvertisementType enum_param) { … }
AdvertisementType ParseAdvertisementType(std::string_view enum_string) { … }
std::u16string GetAdvertisementTypeParseError(std::string_view enum_string) { … }
Device::Device()
{ … }
Device::~Device() = default;
Device::Device(Device&& rhs) noexcept = default;
Device& Device::operator=(Device&& rhs) noexcept = default;
Device Device::Clone() const { … }
bool Device::Populate(
const base::Value::Dict& dict, Device& out) { … }
bool Device::Populate(
const base::Value& value, Device& out) { … }
std::optional<Device> Device::FromValue(const base::Value::Dict& value) { … }
std::optional<Device> Device::FromValue(const base::Value& value) { … }
base::Value::Dict Device::ToValue() const { … }
Service::Service()
: … { … }
Service::~Service() = default;
Service::Service(Service&& rhs) noexcept = default;
Service& Service::operator=(Service&& rhs) noexcept = default;
Service Service::Clone() const { … }
bool Service::Populate(
const base::Value::Dict& dict, Service& out) { … }
bool Service::Populate(
const base::Value& value, Service& out) { … }
std::optional<Service> Service::FromValue(const base::Value::Dict& value) { … }
std::optional<Service> Service::FromValue(const base::Value& value) { … }
base::Value::Dict Service::ToValue() const { … }
Characteristic::Characteristic()
{ … }
Characteristic::~Characteristic() = default;
Characteristic::Characteristic(Characteristic&& rhs) noexcept = default;
Characteristic& Characteristic::operator=(Characteristic&& rhs) noexcept = default;
Characteristic Characteristic::Clone() const { … }
bool Characteristic::Populate(
const base::Value::Dict& dict, Characteristic& out) { … }
bool Characteristic::Populate(
const base::Value& value, Characteristic& out) { … }
std::optional<Characteristic> Characteristic::FromValue(const base::Value::Dict& value) { … }
std::optional<Characteristic> Characteristic::FromValue(const base::Value& value) { … }
base::Value::Dict Characteristic::ToValue() const { … }
Descriptor::Descriptor()
{ … }
Descriptor::~Descriptor() = default;
Descriptor::Descriptor(Descriptor&& rhs) noexcept = default;
Descriptor& Descriptor::operator=(Descriptor&& rhs) noexcept = default;
Descriptor Descriptor::Clone() const { … }
bool Descriptor::Populate(
const base::Value::Dict& dict, Descriptor& out) { … }
bool Descriptor::Populate(
const base::Value& value, Descriptor& out) { … }
std::optional<Descriptor> Descriptor::FromValue(const base::Value::Dict& value) { … }
std::optional<Descriptor> Descriptor::FromValue(const base::Value& value) { … }
base::Value::Dict Descriptor::ToValue() const { … }
ConnectProperties::ConnectProperties()
: … { … }
ConnectProperties::~ConnectProperties() = default;
ConnectProperties::ConnectProperties(ConnectProperties&& rhs) noexcept = default;
ConnectProperties& ConnectProperties::operator=(ConnectProperties&& rhs) noexcept = default;
ConnectProperties ConnectProperties::Clone() const { … }
bool ConnectProperties::Populate(
const base::Value::Dict& dict, ConnectProperties& out) { … }
bool ConnectProperties::Populate(
const base::Value& value, ConnectProperties& out) { … }
std::optional<ConnectProperties> ConnectProperties::FromValue(const base::Value::Dict& value) { … }
std::optional<ConnectProperties> ConnectProperties::FromValue(const base::Value& value) { … }
base::Value::Dict ConnectProperties::ToValue() const { … }
NotificationProperties::NotificationProperties()
: … { … }
NotificationProperties::~NotificationProperties() = default;
NotificationProperties::NotificationProperties(NotificationProperties&& rhs) noexcept = default;
NotificationProperties& NotificationProperties::operator=(NotificationProperties&& rhs) noexcept = default;
NotificationProperties NotificationProperties::Clone() const { … }
bool NotificationProperties::Populate(
const base::Value::Dict& dict, NotificationProperties& out) { … }
bool NotificationProperties::Populate(
const base::Value& value, NotificationProperties& out) { … }
std::optional<NotificationProperties> NotificationProperties::FromValue(const base::Value::Dict& value) { … }
std::optional<NotificationProperties> NotificationProperties::FromValue(const base::Value& value) { … }
base::Value::Dict NotificationProperties::ToValue() const { … }
ManufacturerData::ManufacturerData()
: … { … }
ManufacturerData::~ManufacturerData() = default;
ManufacturerData::ManufacturerData(ManufacturerData&& rhs) noexcept = default;
ManufacturerData& ManufacturerData::operator=(ManufacturerData&& rhs) noexcept = default;
ManufacturerData ManufacturerData::Clone() const { … }
bool ManufacturerData::Populate(
const base::Value::Dict& dict, ManufacturerData& out) { … }
bool ManufacturerData::Populate(
const base::Value& value, ManufacturerData& out) { … }
std::optional<ManufacturerData> ManufacturerData::FromValue(const base::Value::Dict& value) { … }
std::optional<ManufacturerData> ManufacturerData::FromValue(const base::Value& value) { … }
base::Value::Dict ManufacturerData::ToValue() const { … }
ServiceData::ServiceData()
{ … }
ServiceData::~ServiceData() = default;
ServiceData::ServiceData(ServiceData&& rhs) noexcept = default;
ServiceData& ServiceData::operator=(ServiceData&& rhs) noexcept = default;
ServiceData ServiceData::Clone() const { … }
bool ServiceData::Populate(
const base::Value::Dict& dict, ServiceData& out) { … }
bool ServiceData::Populate(
const base::Value& value, ServiceData& out) { … }
std::optional<ServiceData> ServiceData::FromValue(const base::Value::Dict& value) { … }
std::optional<ServiceData> ServiceData::FromValue(const base::Value& value) { … }
base::Value::Dict ServiceData::ToValue() const { … }
Advertisement::Advertisement()
: … { … }
Advertisement::~Advertisement() = default;
Advertisement::Advertisement(Advertisement&& rhs) noexcept = default;
Advertisement& Advertisement::operator=(Advertisement&& rhs) noexcept = default;
Advertisement Advertisement::Clone() const { … }
bool Advertisement::Populate(
const base::Value::Dict& dict, Advertisement& out) { … }
bool Advertisement::Populate(
const base::Value& value, Advertisement& out) { … }
std::optional<Advertisement> Advertisement::FromValue(const base::Value::Dict& value) { … }
std::optional<Advertisement> Advertisement::FromValue(const base::Value& value) { … }
base::Value::Dict Advertisement::ToValue() const { … }
Request::Request()
: … { … }
Request::~Request() = default;
Request::Request(Request&& rhs) noexcept = default;
Request& Request::operator=(Request&& rhs) noexcept = default;
Request Request::Clone() const { … }
bool Request::Populate(
const base::Value::Dict& dict, Request& out) { … }
bool Request::Populate(
const base::Value& value, Request& out) { … }
std::optional<Request> Request::FromValue(const base::Value::Dict& value) { … }
std::optional<Request> Request::FromValue(const base::Value& value) { … }
base::Value::Dict Request::ToValue() const { … }
Response::Response()
: … { … }
Response::~Response() = default;
Response::Response(Response&& rhs) noexcept = default;
Response& Response::operator=(Response&& rhs) noexcept = default;
Response Response::Clone() const { … }
bool Response::Populate(
const base::Value::Dict& dict, Response& out) { … }
bool Response::Populate(
const base::Value& value, Response& out) { … }
std::optional<Response> Response::FromValue(const base::Value::Dict& value) { … }
std::optional<Response> Response::FromValue(const base::Value& value) { … }
base::Value::Dict Response::ToValue() const { … }
Notification::Notification()
{ … }
Notification::~Notification() = default;
Notification::Notification(Notification&& rhs) noexcept = default;
Notification& Notification::operator=(Notification&& rhs) noexcept = default;
Notification Notification::Clone() const { … }
bool Notification::Populate(
const base::Value::Dict& dict, Notification& out) { … }
bool Notification::Populate(
const base::Value& value, Notification& out) { … }
std::optional<Notification> Notification::FromValue(const base::Value::Dict& value) { … }
std::optional<Notification> Notification::FromValue(const base::Value& value) { … }
base::Value::Dict Notification::ToValue() const { … }
namespace Connect {
Params::Params() = default;
Params::~Params() = default;
Params::Params(Params&& rhs) noexcept = default;
Params& Params::operator=(Params&& rhs) noexcept = default;
std::optional<Params> Params::Create(const base::Value::List& args) { … }
base::Value::List Results::Create() { … }
}
namespace Disconnect {
Params::Params() = default;
Params::~Params() = default;
Params::Params(Params&& rhs) noexcept = default;
Params& Params::operator=(Params&& rhs) noexcept = default;
std::optional<Params> Params::Create(const base::Value::List& args) { … }
base::Value::List Results::Create() { … }
}
namespace GetService {
Params::Params() = default;
Params::~Params() = default;
Params::Params(Params&& rhs) noexcept = default;
Params& Params::operator=(Params&& rhs) noexcept = default;
std::optional<Params> Params::Create(const base::Value::List& args) { … }
base::Value::List Results::Create(const Service& result) { … }
}
namespace CreateService {
Params::Params() = default;
Params::~Params() = default;
Params::Params(Params&& rhs) noexcept = default;
Params& Params::operator=(Params&& rhs) noexcept = default;
std::optional<Params> Params::Create(const base::Value::List& args) { … }
base::Value::List Results::Create(const std::string& service_id) { … }
}
namespace GetServices {
Params::Params() = default;
Params::~Params() = default;
Params::Params(Params&& rhs) noexcept = default;
Params& Params::operator=(Params&& rhs) noexcept = default;
std::optional<Params> Params::Create(const base::Value::List& args) { … }
base::Value::List Results::Create(const std::vector<Service>& result) { … }
}
namespace GetCharacteristic {
Params::Params() = default;
Params::~Params() = default;
Params::Params(Params&& rhs) noexcept = default;
Params& Params::operator=(Params&& rhs) noexcept = default;
std::optional<Params> Params::Create(const base::Value::List& args) { … }
base::Value::List Results::Create(const Characteristic& result) { … }
}
namespace CreateCharacteristic {
Params::Params() = default;
Params::~Params() = default;
Params::Params(Params&& rhs) noexcept = default;
Params& Params::operator=(Params&& rhs) noexcept = default;
std::optional<Params> Params::Create(const base::Value::List& args) { … }
base::Value::List Results::Create(const std::string& characteristic_id) { … }
}
namespace GetCharacteristics {
Params::Params() = default;
Params::~Params() = default;
Params::Params(Params&& rhs) noexcept = default;
Params& Params::operator=(Params&& rhs) noexcept = default;
std::optional<Params> Params::Create(const base::Value::List& args) { … }
base::Value::List Results::Create(const std::vector<Characteristic>& result) { … }
}
namespace GetIncludedServices {
Params::Params() = default;
Params::~Params() = default;
Params::Params(Params&& rhs) noexcept = default;
Params& Params::operator=(Params&& rhs) noexcept = default;
std::optional<Params> Params::Create(const base::Value::List& args) { … }
base::Value::List Results::Create(const std::vector<Service>& result) { … }
}
namespace GetDescriptor {
Params::Params() = default;
Params::~Params() = default;
Params::Params(Params&& rhs) noexcept = default;
Params& Params::operator=(Params&& rhs) noexcept = default;
std::optional<Params> Params::Create(const base::Value::List& args) { … }
base::Value::List Results::Create(const Descriptor& result) { … }
}
namespace CreateDescriptor {
Params::Params() = default;
Params::~Params() = default;
Params::Params(Params&& rhs) noexcept = default;
Params& Params::operator=(Params&& rhs) noexcept = default;
std::optional<Params> Params::Create(const base::Value::List& args) { … }
base::Value::List Results::Create(const std::string& descriptor_id) { … }
}
namespace GetDescriptors {
Params::Params() = default;
Params::~Params() = default;
Params::Params(Params&& rhs) noexcept = default;
Params& Params::operator=(Params&& rhs) noexcept = default;
std::optional<Params> Params::Create(const base::Value::List& args) { … }
base::Value::List Results::Create(const std::vector<Descriptor>& result) { … }
}
namespace ReadCharacteristicValue {
Params::Params() = default;
Params::~Params() = default;
Params::Params(Params&& rhs) noexcept = default;
Params& Params::operator=(Params&& rhs) noexcept = default;
std::optional<Params> Params::Create(const base::Value::List& args) { … }
base::Value::List Results::Create(const Characteristic& result) { … }
}
namespace WriteCharacteristicValue {
Params::Params() = default;
Params::~Params() = default;
Params::Params(Params&& rhs) noexcept = default;
Params& Params::operator=(Params&& rhs) noexcept = default;
std::optional<Params> Params::Create(const base::Value::List& args) { … }
base::Value::List Results::Create() { … }
}
namespace StartCharacteristicNotifications {
Params::Params() = default;
Params::~Params() = default;
Params::Params(Params&& rhs) noexcept = default;
Params& Params::operator=(Params&& rhs) noexcept = default;
std::optional<Params> Params::Create(const base::Value::List& args) { … }
base::Value::List Results::Create() { … }
}
namespace StopCharacteristicNotifications {
Params::Params() = default;
Params::~Params() = default;
Params::Params(Params&& rhs) noexcept = default;
Params& Params::operator=(Params&& rhs) noexcept = default;
std::optional<Params> Params::Create(const base::Value::List& args) { … }
base::Value::List Results::Create() { … }
}
namespace NotifyCharacteristicValueChanged {
Params::Params() = default;
Params::~Params() = default;
Params::Params(Params&& rhs) noexcept = default;
Params& Params::operator=(Params&& rhs) noexcept = default;
std::optional<Params> Params::Create(const base::Value::List& args) { … }
base::Value::List Results::Create() { … }
}
namespace ReadDescriptorValue {
Params::Params() = default;
Params::~Params() = default;
Params::Params(Params&& rhs) noexcept = default;
Params& Params::operator=(Params&& rhs) noexcept = default;
std::optional<Params> Params::Create(const base::Value::List& args) { … }
base::Value::List Results::Create(const Descriptor& result) { … }
}
namespace WriteDescriptorValue {
Params::Params() = default;
Params::~Params() = default;
Params::Params(Params&& rhs) noexcept = default;
Params& Params::operator=(Params&& rhs) noexcept = default;
std::optional<Params> Params::Create(const base::Value::List& args) { … }
base::Value::List Results::Create() { … }
}
namespace RegisterService {
Params::Params() = default;
Params::~Params() = default;
Params::Params(Params&& rhs) noexcept = default;
Params& Params::operator=(Params&& rhs) noexcept = default;
std::optional<Params> Params::Create(const base::Value::List& args) { … }
base::Value::List Results::Create() { … }
}
namespace UnregisterService {
Params::Params() = default;
Params::~Params() = default;
Params::Params(Params&& rhs) noexcept = default;
Params& Params::operator=(Params&& rhs) noexcept = default;
std::optional<Params> Params::Create(const base::Value::List& args) { … }
base::Value::List Results::Create() { … }
}
namespace RemoveService {
Params::Params() = default;
Params::~Params() = default;
Params::Params(Params&& rhs) noexcept = default;
Params& Params::operator=(Params&& rhs) noexcept = default;
std::optional<Params> Params::Create(const base::Value::List& args) { … }
base::Value::List Results::Create() { … }
}
namespace RegisterAdvertisement {
Params::Params() = default;
Params::~Params() = default;
Params::Params(Params&& rhs) noexcept = default;
Params& Params::operator=(Params&& rhs) noexcept = default;
std::optional<Params> Params::Create(const base::Value::List& args) { … }
base::Value::List Results::Create(int advertisement_id) { … }
}
namespace UnregisterAdvertisement {
Params::Params() = default;
Params::~Params() = default;
Params::Params(Params&& rhs) noexcept = default;
Params& Params::operator=(Params&& rhs) noexcept = default;
std::optional<Params> Params::Create(const base::Value::List& args) { … }
base::Value::List Results::Create() { … }
}
namespace ResetAdvertising {
base::Value::List Results::Create() { … }
}
namespace SetAdvertisingInterval {
Params::Params() = default;
Params::~Params() = default;
Params::Params(Params&& rhs) noexcept = default;
Params& Params::operator=(Params&& rhs) noexcept = default;
std::optional<Params> Params::Create(const base::Value::List& args) { … }
base::Value::List Results::Create() { … }
}
namespace SendRequestResponse {
Params::Params() = default;
Params::~Params() = default;
Params::Params(Params&& rhs) noexcept = default;
Params& Params::operator=(Params&& rhs) noexcept = default;
std::optional<Params> Params::Create(const base::Value::List& args) { … }
}
namespace OnServiceAdded {
const char kEventName[] = …;
base::Value::List Create(const Service& service) { … }
}
namespace OnServiceChanged {
const char kEventName[] = …;
base::Value::List Create(const Service& service) { … }
}
namespace OnServiceRemoved {
const char kEventName[] = …;
base::Value::List Create(const Service& service) { … }
}
namespace OnCharacteristicValueChanged {
const char kEventName[] = …;
base::Value::List Create(const Characteristic& characteristic) { … }
}
namespace OnDescriptorValueChanged {
const char kEventName[] = …;
base::Value::List Create(const Descriptor& descriptor) { … }
}
namespace OnCharacteristicReadRequest {
const char kEventName[] = …;
base::Value::List Create(const Request& request, const std::string& characteristic_id) { … }
}
namespace OnCharacteristicWriteRequest {
const char kEventName[] = …;
base::Value::List Create(const Request& request, const std::string& characteristic_id) { … }
}
namespace OnDescriptorReadRequest {
const char kEventName[] = …;
base::Value::List Create(const Request& request, const std::string& descriptor_id) { … }
}
namespace OnDescriptorWriteRequest {
const char kEventName[] = …;
base::Value::List Create(const Request& request, const std::string& descriptor_id) { … }
}
}
}
}