#include "extensions/common/api/serial.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 serial {
DeviceInfo::DeviceInfo()
{ … }
DeviceInfo::~DeviceInfo() = default;
DeviceInfo::DeviceInfo(DeviceInfo&& rhs) noexcept = default;
DeviceInfo& DeviceInfo::operator=(DeviceInfo&& rhs) noexcept = default;
DeviceInfo DeviceInfo::Clone() const { … }
bool DeviceInfo::Populate(
const base::Value::Dict& dict, DeviceInfo& out) { … }
bool DeviceInfo::Populate(
const base::Value& value, DeviceInfo& out) { … }
std::optional<DeviceInfo> DeviceInfo::FromValue(const base::Value::Dict& value) { … }
std::optional<DeviceInfo> DeviceInfo::FromValue(const base::Value& value) { … }
base::Value::Dict DeviceInfo::ToValue() const { … }
const char* ToString(DataBits enum_param) { … }
DataBits ParseDataBits(std::string_view enum_string) { … }
std::u16string GetDataBitsParseError(std::string_view enum_string) { … }
const char* ToString(ParityBit enum_param) { … }
ParityBit ParseParityBit(std::string_view enum_string) { … }
std::u16string GetParityBitParseError(std::string_view enum_string) { … }
const char* ToString(StopBits enum_param) { … }
StopBits ParseStopBits(std::string_view enum_string) { … }
std::u16string GetStopBitsParseError(std::string_view enum_string) { … }
ConnectionOptions::ConnectionOptions()
: … { … }
ConnectionOptions::~ConnectionOptions() = default;
ConnectionOptions::ConnectionOptions(ConnectionOptions&& rhs) noexcept = default;
ConnectionOptions& ConnectionOptions::operator=(ConnectionOptions&& rhs) noexcept = default;
ConnectionOptions ConnectionOptions::Clone() const { … }
bool ConnectionOptions::Populate(
const base::Value::Dict& dict, ConnectionOptions& out) { … }
bool ConnectionOptions::Populate(
const base::Value& value, ConnectionOptions& out) { … }
std::optional<ConnectionOptions> ConnectionOptions::FromValue(const base::Value::Dict& value) { … }
std::optional<ConnectionOptions> ConnectionOptions::FromValue(const base::Value& value) { … }
base::Value::Dict ConnectionOptions::ToValue() const { … }
ConnectionInfo::ConnectionInfo()
: … { … }
ConnectionInfo::~ConnectionInfo() = default;
ConnectionInfo::ConnectionInfo(ConnectionInfo&& rhs) noexcept = default;
ConnectionInfo& ConnectionInfo::operator=(ConnectionInfo&& rhs) noexcept = default;
ConnectionInfo ConnectionInfo::Clone() const { … }
bool ConnectionInfo::Populate(
const base::Value::Dict& dict, ConnectionInfo& out) { … }
bool ConnectionInfo::Populate(
const base::Value& value, ConnectionInfo& out) { … }
std::optional<ConnectionInfo> ConnectionInfo::FromValue(const base::Value::Dict& value) { … }
std::optional<ConnectionInfo> ConnectionInfo::FromValue(const base::Value& value) { … }
base::Value::Dict ConnectionInfo::ToValue() const { … }
const char* ToString(SendError enum_param) { … }
SendError ParseSendError(std::string_view enum_string) { … }
std::u16string GetSendErrorParseError(std::string_view enum_string) { … }
SendInfo::SendInfo()
: … { … }
SendInfo::~SendInfo() = default;
SendInfo::SendInfo(SendInfo&& rhs) noexcept = default;
SendInfo& SendInfo::operator=(SendInfo&& rhs) noexcept = default;
SendInfo SendInfo::Clone() const { … }
bool SendInfo::Populate(
const base::Value::Dict& dict, SendInfo& out) { … }
bool SendInfo::Populate(
const base::Value& value, SendInfo& out) { … }
std::optional<SendInfo> SendInfo::FromValue(const base::Value::Dict& value) { … }
std::optional<SendInfo> SendInfo::FromValue(const base::Value& value) { … }
base::Value::Dict SendInfo::ToValue() const { … }
HostControlSignals::HostControlSignals()
{ … }
HostControlSignals::~HostControlSignals() = default;
HostControlSignals::HostControlSignals(HostControlSignals&& rhs) noexcept = default;
HostControlSignals& HostControlSignals::operator=(HostControlSignals&& rhs) noexcept = default;
HostControlSignals HostControlSignals::Clone() const { … }
bool HostControlSignals::Populate(
const base::Value::Dict& dict, HostControlSignals& out) { … }
bool HostControlSignals::Populate(
const base::Value& value, HostControlSignals& out) { … }
std::optional<HostControlSignals> HostControlSignals::FromValue(const base::Value::Dict& value) { … }
std::optional<HostControlSignals> HostControlSignals::FromValue(const base::Value& value) { … }
base::Value::Dict HostControlSignals::ToValue() const { … }
DeviceControlSignals::DeviceControlSignals()
: … { … }
DeviceControlSignals::~DeviceControlSignals() = default;
DeviceControlSignals::DeviceControlSignals(DeviceControlSignals&& rhs) noexcept = default;
DeviceControlSignals& DeviceControlSignals::operator=(DeviceControlSignals&& rhs) noexcept = default;
DeviceControlSignals DeviceControlSignals::Clone() const { … }
bool DeviceControlSignals::Populate(
const base::Value::Dict& dict, DeviceControlSignals& out) { … }
bool DeviceControlSignals::Populate(
const base::Value& value, DeviceControlSignals& out) { … }
std::optional<DeviceControlSignals> DeviceControlSignals::FromValue(const base::Value::Dict& value) { … }
std::optional<DeviceControlSignals> DeviceControlSignals::FromValue(const base::Value& value) { … }
base::Value::Dict DeviceControlSignals::ToValue() const { … }
ReceiveInfo::ReceiveInfo()
: … { … }
ReceiveInfo::~ReceiveInfo() = default;
ReceiveInfo::ReceiveInfo(ReceiveInfo&& rhs) noexcept = default;
ReceiveInfo& ReceiveInfo::operator=(ReceiveInfo&& rhs) noexcept = default;
ReceiveInfo ReceiveInfo::Clone() const { … }
bool ReceiveInfo::Populate(
const base::Value::Dict& dict, ReceiveInfo& out) { … }
bool ReceiveInfo::Populate(
const base::Value& value, ReceiveInfo& out) { … }
std::optional<ReceiveInfo> ReceiveInfo::FromValue(const base::Value::Dict& value) { … }
std::optional<ReceiveInfo> ReceiveInfo::FromValue(const base::Value& value) { … }
base::Value::Dict ReceiveInfo::ToValue() const { … }
const char* ToString(ReceiveError enum_param) { … }
ReceiveError ParseReceiveError(std::string_view enum_string) { … }
std::u16string GetReceiveErrorParseError(std::string_view enum_string) { … }
ReceiveErrorInfo::ReceiveErrorInfo()
: … { … }
ReceiveErrorInfo::~ReceiveErrorInfo() = default;
ReceiveErrorInfo::ReceiveErrorInfo(ReceiveErrorInfo&& rhs) noexcept = default;
ReceiveErrorInfo& ReceiveErrorInfo::operator=(ReceiveErrorInfo&& rhs) noexcept = default;
ReceiveErrorInfo ReceiveErrorInfo::Clone() const { … }
bool ReceiveErrorInfo::Populate(
const base::Value::Dict& dict, ReceiveErrorInfo& out) { … }
bool ReceiveErrorInfo::Populate(
const base::Value& value, ReceiveErrorInfo& out) { … }
std::optional<ReceiveErrorInfo> ReceiveErrorInfo::FromValue(const base::Value::Dict& value) { … }
std::optional<ReceiveErrorInfo> ReceiveErrorInfo::FromValue(const base::Value& value) { … }
base::Value::Dict ReceiveErrorInfo::ToValue() const { … }
namespace GetDevices {
base::Value::List Results::Create(const std::vector<DeviceInfo>& ports) { … }
}
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(const ConnectionInfo& connection_info) { … }
}
namespace Update {
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(bool result) { … }
}
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(bool result) { … }
}
namespace SetPaused {
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 GetInfo {
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 ConnectionInfo& connection_info) { … }
}
namespace GetConnections {
base::Value::List Results::Create(const std::vector<ConnectionInfo>& connection_infos) { … }
}
namespace Send {
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 SendInfo& send_info) { … }
}
namespace Flush {
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(bool result) { … }
}
namespace GetControlSignals {
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 DeviceControlSignals& signals) { … }
}
namespace SetControlSignals {
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(bool result) { … }
}
namespace SetBreak {
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(bool result) { … }
}
namespace ClearBreak {
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(bool result) { … }
}
namespace OnReceive {
const char kEventName[] = …;
base::Value::List Create(const ReceiveInfo& info) { … }
}
namespace OnReceiveError {
const char kEventName[] = …;
base::Value::List Create(const ReceiveErrorInfo& info) { … }
}
}
}
}