Code generate Swift wrappers for protocol buffers.

pull/1/head
Matthew Chen 7 years ago
parent b164ce9403
commit 377634a1f7

@ -11,10 +11,8 @@ syntax = "proto2";
// iOS - package name determines class prefix // iOS - package name determines class prefix
package IOSProtos; package IOSProtos;
message BackupSnapshot message BackupSnapshot {
{ message BackupEntity {
message BackupEntity
{
enum Type { enum Type {
UNKNOWN = 0; UNKNOWN = 0;
MIGRATION = 1; MIGRATION = 1;

@ -14,8 +14,7 @@ package WebSocketProtos;
option java_package = "org.whispersystems.signalservice.internal.websocket"; option java_package = "org.whispersystems.signalservice.internal.websocket";
option java_outer_classname = "WebSocketProtos"; option java_outer_classname = "WebSocketProtos";
message WebSocketRequestMessage message WebSocketRequestMessage {
{
optional string verb = 1; optional string verb = 1;
optional string path = 2; optional string path = 2;
optional bytes body = 3; optional bytes body = 3;
@ -23,8 +22,7 @@ message WebSocketRequestMessage
optional uint64 requestId = 4; optional uint64 requestId = 4;
} }
message WebSocketResponseMessage message WebSocketResponseMessage {
{
optional uint64 requestId = 1; optional uint64 requestId = 1;
optional uint32 status = 2; optional uint32 status = 2;
optional string message = 3; optional string message = 3;
@ -32,8 +30,7 @@ message WebSocketResponseMessage
optional bytes body = 4; optional bytes body = 4;
} }
message WebSocketMessage message WebSocketMessage {
{
enum Type { enum Type {
UNKNOWN = 0; UNKNOWN = 0;
REQUEST = 1; REQUEST = 1;

@ -1,6 +1,10 @@
// DO NOT EDIT.
// //
// Copyright (c) 2018 Open Whisper Systems. All rights reserved. // Generated by the Swift generator plugin for the protocol buffer compiler.
// Source: Provisioning.proto
// //
// For information on using the generated types, please see the documenation:
// https://github.com/apple/swift-protobuf/
//* //*
// Copyright (C) 2014-2016 Open Whisper Systems // Copyright (C) 2014-2016 Open Whisper Systems
@ -18,7 +22,7 @@ import SwiftProtobuf
// incompatible with the version of SwiftProtobuf to which you are linking. // incompatible with the version of SwiftProtobuf to which you are linking.
// Please ensure that your are building against the same version of the API // Please ensure that your are building against the same version of the API
// that was used to generate this file. // that was used to generate this file.
private struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
typealias Version = _2 typealias Version = _2
} }
@ -51,8 +55,8 @@ struct ProvisioningProtos_ProvisionEnvelope {
init() {} init() {}
fileprivate var _publicKey: Data? fileprivate var _publicKey: Data? = nil
fileprivate var _body: Data? fileprivate var _body: Data? = nil
} }
struct ProvisioningProtos_ProvisionMessage { struct ProvisioningProtos_ProvisionMessage {
@ -127,24 +131,24 @@ struct ProvisioningProtos_ProvisionMessage {
init() {} init() {}
fileprivate var _identityKeyPublic: Data? fileprivate var _identityKeyPublic: Data? = nil
fileprivate var _identityKeyPrivate: Data? fileprivate var _identityKeyPrivate: Data? = nil
fileprivate var _number: String? fileprivate var _number: String? = nil
fileprivate var _provisioningCode: String? fileprivate var _provisioningCode: String? = nil
fileprivate var _userAgent: String? fileprivate var _userAgent: String? = nil
fileprivate var _profileKey: Data? fileprivate var _profileKey: Data? = nil
fileprivate var _readReceipts: Bool? fileprivate var _readReceipts: Bool? = nil
} }
// MARK: - Code below here is support for the SwiftProtobuf runtime. // MARK: - Code below here is support for the SwiftProtobuf runtime.
private let _protobuf_package = "ProvisioningProtos" fileprivate let _protobuf_package = "ProvisioningProtos"
extension ProvisioningProtos_ProvisionEnvelope: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { extension ProvisioningProtos_ProvisionEnvelope: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = _protobuf_package + ".ProvisionEnvelope" static let protoMessageName: String = _protobuf_package + ".ProvisionEnvelope"
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "publicKey"), 1: .same(proto: "publicKey"),
2: .same(proto: "body") 2: .same(proto: "body"),
] ]
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws { mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
@ -184,7 +188,7 @@ extension ProvisioningProtos_ProvisionMessage: SwiftProtobuf.Message, SwiftProto
4: .same(proto: "provisioningCode"), 4: .same(proto: "provisioningCode"),
5: .same(proto: "userAgent"), 5: .same(proto: "userAgent"),
6: .same(proto: "profileKey"), 6: .same(proto: "profileKey"),
7: .same(proto: "readReceipts") 7: .same(proto: "readReceipts"),
] ]
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws { mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {

Loading…
Cancel
Save