// DO NOT EDIT. // swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: host.proto // // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ ///* /// Host management for the Stable Diffusion RPC service. 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 you 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 } ///* /// Represents a request to load a model into a specified compute unit. public struct SdLoadModelRequest { // 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 model name to load onto the compute unit. public var modelName: String = String() ///* /// The compute units to load the model onto. public var computeUnits: SdComputeUnits = .cpu public var unknownFields = SwiftProtobuf.UnknownStorage() public init() {} } ///* /// Represents a response to loading a model. public struct SdLoadModelResponse { // 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. public var unknownFields = SwiftProtobuf.UnknownStorage() public init() {} } #if swift(>=5.5) && canImport(_Concurrency) extension SdLoadModelRequest: @unchecked Sendable {} extension SdLoadModelResponse: @unchecked Sendable {} #endif // swift(>=5.5) && canImport(_Concurrency) // MARK: - Code below here is support for the SwiftProtobuf runtime. fileprivate let _protobuf_package = "gay.pizza.stable.diffusion" extension SdLoadModelRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { public static let protoMessageName: String = _protobuf_package + ".LoadModelRequest" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .standard(proto: "model_name"), 2: .standard(proto: "compute_units"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { // The use of inline closures is to circumvent an issue where the compiler // allocates stack space for every case branch when no optimizations are // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { case 1: try { try decoder.decodeSingularStringField(value: &self.modelName) }() case 2: try { try decoder.decodeSingularEnumField(value: &self.computeUnits) }() default: break } } } public func traverse(visitor: inout V) throws { if !self.modelName.isEmpty { try visitor.visitSingularStringField(value: self.modelName, fieldNumber: 1) } if self.computeUnits != .cpu { try visitor.visitSingularEnumField(value: self.computeUnits, fieldNumber: 2) } try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: SdLoadModelRequest, rhs: SdLoadModelRequest) -> Bool { if lhs.modelName != rhs.modelName {return false} if lhs.computeUnits != rhs.computeUnits {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } extension SdLoadModelResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { public static let protoMessageName: String = _protobuf_package + ".LoadModelResponse" public static let _protobuf_nameMap = SwiftProtobuf._NameMap() public mutating func decodeMessage(decoder: inout D) throws { while let _ = try decoder.nextFieldNumber() { } } public func traverse(visitor: inout V) throws { try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: SdLoadModelResponse, rhs: SdLoadModelResponse) -> Bool { if lhs.unknownFields != rhs.unknownFields {return false} return true } }