Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
189 lines (160 sloc) 6.73 KB
// DO NOT EDIT.
//
// Generated by the Swift generator plugin for the protocol buffer compiler.
// Source: acquire_asset.proto
//
// For information on using the generated types, please see the documenation:
// https://github.com/apple/swift-protobuf/
import Foundation
import SwiftProtobuf
// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
// incompatible with the version of SwiftProtobuf to which you are linking.
// Please ensure that your are building against the same version of the API
// that was used to generate this file.
fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
typealias Version = _2
}
public struct ForgeAbi_AssetSpec {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
/// the address of the generated asset. The sender shall apply the spec to the
/// template to generate a structure of the asset, and then generate the
/// CreateAssetTx, and then calculate the address. SDK could help to alleviate
/// the process.
public var address: String = String()
/// json string that contains args for the asset factory template
public var data: String = String()
public var unknownFields = SwiftProtobuf.UnknownStorage()
public init() {}
}
public struct ForgeAbi_AcquireAssetTx {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
/// the address of the asset factory
public var to: String {
get {return _storage._to}
set {_uniqueStorage()._to = newValue}
}
/// asset spec
public var specs: [ForgeAbi_AssetSpec] {
get {return _storage._specs}
set {_uniqueStorage()._specs = newValue}
}
/// forge won't touch this field. Only forge app shall handle it.
public var data: SwiftProtobuf.Google_Protobuf_Any {
get {return _storage._data ?? SwiftProtobuf.Google_Protobuf_Any()}
set {_uniqueStorage()._data = newValue}
}
/// Returns true if `data` has been explicitly set.
public var hasData: Bool {return _storage._data != nil}
/// Clears the value of `data`. Subsequent reads from it will return its default value.
public mutating func clearData() {_uniqueStorage()._data = nil}
public var unknownFields = SwiftProtobuf.UnknownStorage()
public init() {}
fileprivate var _storage = _StorageClass.defaultInstance
}
// MARK: - Code below here is support for the SwiftProtobuf runtime.
fileprivate let _protobuf_package = "forge_abi"
extension ForgeAbi_AssetSpec: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
public static let protoMessageName: String = _protobuf_package + ".AssetSpec"
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "address"),
2: .same(proto: "data"),
]
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
switch fieldNumber {
case 1: try decoder.decodeSingularStringField(value: &self.address)
case 2: try decoder.decodeSingularStringField(value: &self.data)
default: break
}
}
}
public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
if !self.address.isEmpty {
try visitor.visitSingularStringField(value: self.address, fieldNumber: 1)
}
if !self.data.isEmpty {
try visitor.visitSingularStringField(value: self.data, fieldNumber: 2)
}
try unknownFields.traverse(visitor: &visitor)
}
public static func ==(lhs: ForgeAbi_AssetSpec, rhs: ForgeAbi_AssetSpec) -> Bool {
if lhs.address != rhs.address {return false}
if lhs.data != rhs.data {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}
extension ForgeAbi_AcquireAssetTx: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
public static let protoMessageName: String = _protobuf_package + ".AcquireAssetTx"
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "to"),
2: .same(proto: "specs"),
15: .same(proto: "data"),
]
fileprivate class _StorageClass {
var _to: String = String()
var _specs: [ForgeAbi_AssetSpec] = []
var _data: SwiftProtobuf.Google_Protobuf_Any? = nil
static let defaultInstance = _StorageClass()
private init() {}
init(copying source: _StorageClass) {
_to = source._to
_specs = source._specs
_data = source._data
}
}
fileprivate mutating func _uniqueStorage() -> _StorageClass {
if !isKnownUniquelyReferenced(&_storage) {
_storage = _StorageClass(copying: _storage)
}
return _storage
}
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
_ = _uniqueStorage()
try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
while let fieldNumber = try decoder.nextFieldNumber() {
switch fieldNumber {
case 1: try decoder.decodeSingularStringField(value: &_storage._to)
case 2: try decoder.decodeRepeatedMessageField(value: &_storage._specs)
case 15: try decoder.decodeSingularMessageField(value: &_storage._data)
default: break
}
}
}
}
public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
if !_storage._to.isEmpty {
try visitor.visitSingularStringField(value: _storage._to, fieldNumber: 1)
}
if !_storage._specs.isEmpty {
try visitor.visitRepeatedMessageField(value: _storage._specs, fieldNumber: 2)
}
if let v = _storage._data {
try visitor.visitSingularMessageField(value: v, fieldNumber: 15)
}
}
try unknownFields.traverse(visitor: &visitor)
}
public static func ==(lhs: ForgeAbi_AcquireAssetTx, rhs: ForgeAbi_AcquireAssetTx) -> Bool {
if lhs._storage !== rhs._storage {
let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in
let _storage = _args.0
let rhs_storage = _args.1
if _storage._to != rhs_storage._to {return false}
if _storage._specs != rhs_storage._specs {return false}
if _storage._data != rhs_storage._data {return false}
return true
}
if !storagesAreEqual {return false}
}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}
You can’t perform that action at this time.