Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,130 @@ public struct Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Response: Sendable {
public init() {}
}

/// Error returned by failed API calls.
public struct Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Error: Sendable {
// 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.

/// Type of error encountered while processing request.
public var errorType: Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Error.OneOf_ErrorType? = nil

/// Client configuration not found.
public var configVersionNotFound: Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Error.ConfigVersionNotFound {
get {
if case .configVersionNotFound(let v)? = errorType {return v}
return Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Error.ConfigVersionNotFound()
}
set {errorType = .configVersionNotFound(newValue)}
}

/// Client evaluation key not found.
public var evaluationKeyNotFound: Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Error.EvaluationKeyNotFound {
get {
if case .evaluationKeyNotFound(let v)? = errorType {return v}
return Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Error.EvaluationKeyNotFound()
}
set {errorType = .evaluationKeyNotFound(newValue)}
}

/// Request can not be parsed.
public var invalidRequest: Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Error.InvalidRequest {
get {
if case .invalidRequest(let v)? = errorType {return v}
return Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Error.InvalidRequest()
}
set {errorType = .invalidRequest(newValue)}
}

/// Internal error.
public var internalError: Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Error.InternalError {
get {
if case .internalError(let v)? = errorType {return v}
return Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Error.InternalError()
}
set {errorType = .internalError(newValue)}
}

public var unknownFields = SwiftProtobuf.UnknownStorage()

/// Type of error encountered while processing request.
public enum OneOf_ErrorType: Equatable, Sendable {
/// Client configuration not found.
case configVersionNotFound(Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Error.ConfigVersionNotFound)
/// Client evaluation key not found.
case evaluationKeyNotFound(Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Error.EvaluationKeyNotFound)
/// Request can not be parsed.
case invalidRequest(Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Error.InvalidRequest)
/// Internal error.
case internalError(Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Error.InternalError)

}

/// Client configuration not found.
///
/// Client should retry after fetching new configuration. May include new configuration
/// in `config_response`. In this case, client should use this returned configuration and retry.
public struct ConfigVersionNotFound: Sendable {
// 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.

/// ConfigResponse that client should use for subsequent requests.
public var configResponse: Apple_SwiftHomomorphicEncryption_Api_Pir_V1_ConfigResponse {
get {return _configResponse ?? Apple_SwiftHomomorphicEncryption_Api_Pir_V1_ConfigResponse()}
set {_configResponse = newValue}
}
/// Returns true if `configResponse` has been explicitly set.
public var hasConfigResponse: Bool {return self._configResponse != nil}
/// Clears the value of `configResponse`. Subsequent reads from it will return its default value.
public mutating func clearConfigResponse() {self._configResponse = nil}

public var unknownFields = SwiftProtobuf.UnknownStorage()

public init() {}

fileprivate var _configResponse: Apple_SwiftHomomorphicEncryption_Api_Pir_V1_ConfigResponse? = nil
}

/// Evaluation key not found.
///
/// Client should upload evaluation key and retry.
public struct EvaluationKeyNotFound: Sendable {
// 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() {}
}

/// Request can not be parsed successfully.
public struct InvalidRequest: Sendable {
// 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() {}
}

/// Internal error.
public struct InternalError: Sendable {
// 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() {}
}

public init() {}
}

// MARK: - Code below here is support for the SwiftProtobuf runtime.

fileprivate let _protobuf_package = "apple.swift_homomorphic_encryption.api.pir.v1"
Expand Down Expand Up @@ -568,3 +692,202 @@ extension Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Response: SwiftProtobuf.Me
return true
}
}

extension Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Error: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
public static let protoMessageName: String = _protobuf_package + ".Error"
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .standard(proto: "config_version_not_found"),
2: .standard(proto: "evaluation_key_not_found"),
3: .standard(proto: "invalid_request"),
4: .standard(proto: "internal_error"),
]

public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(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 {
var v: Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Error.ConfigVersionNotFound?
var hadOneofValue = false
if let current = self.errorType {
hadOneofValue = true
if case .configVersionNotFound(let m) = current {v = m}
}
try decoder.decodeSingularMessageField(value: &v)
if let v = v {
if hadOneofValue {try decoder.handleConflictingOneOf()}
self.errorType = .configVersionNotFound(v)
}
}()
case 2: try {
var v: Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Error.EvaluationKeyNotFound?
var hadOneofValue = false
if let current = self.errorType {
hadOneofValue = true
if case .evaluationKeyNotFound(let m) = current {v = m}
}
try decoder.decodeSingularMessageField(value: &v)
if let v = v {
if hadOneofValue {try decoder.handleConflictingOneOf()}
self.errorType = .evaluationKeyNotFound(v)
}
}()
case 3: try {
var v: Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Error.InvalidRequest?
var hadOneofValue = false
if let current = self.errorType {
hadOneofValue = true
if case .invalidRequest(let m) = current {v = m}
}
try decoder.decodeSingularMessageField(value: &v)
if let v = v {
if hadOneofValue {try decoder.handleConflictingOneOf()}
self.errorType = .invalidRequest(v)
}
}()
case 4: try {
var v: Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Error.InternalError?
var hadOneofValue = false
if let current = self.errorType {
hadOneofValue = true
if case .internalError(let m) = current {v = m}
}
try decoder.decodeSingularMessageField(value: &v)
if let v = v {
if hadOneofValue {try decoder.handleConflictingOneOf()}
self.errorType = .internalError(v)
}
}()
default: break
}
}
}

public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
// The use of inline closures is to circumvent an issue where the compiler
// allocates stack space for every if/case branch local when no optimizations
// are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
// https://github.com/apple/swift-protobuf/issues/1182
switch self.errorType {
case .configVersionNotFound?: try {
guard case .configVersionNotFound(let v)? = self.errorType else { preconditionFailure() }
try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
}()
case .evaluationKeyNotFound?: try {
guard case .evaluationKeyNotFound(let v)? = self.errorType else { preconditionFailure() }
try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
}()
case .invalidRequest?: try {
guard case .invalidRequest(let v)? = self.errorType else { preconditionFailure() }
try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
}()
case .internalError?: try {
guard case .internalError(let v)? = self.errorType else { preconditionFailure() }
try visitor.visitSingularMessageField(value: v, fieldNumber: 4)
}()
case nil: break
}
try unknownFields.traverse(visitor: &visitor)
}

public static func ==(lhs: Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Error, rhs: Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Error) -> Bool {
if lhs.errorType != rhs.errorType {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}

extension Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Error.ConfigVersionNotFound: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
public static let protoMessageName: String = Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Error.protoMessageName + ".ConfigVersionNotFound"
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .standard(proto: "config_response"),
]

public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(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.decodeSingularMessageField(value: &self._configResponse) }()
default: break
}
}
}

public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
// The use of inline closures is to circumvent an issue where the compiler
// allocates stack space for every if/case branch local when no optimizations
// are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
// https://github.com/apple/swift-protobuf/issues/1182
try { if let v = self._configResponse {
try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
} }()
try unknownFields.traverse(visitor: &visitor)
}

public static func ==(lhs: Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Error.ConfigVersionNotFound, rhs: Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Error.ConfigVersionNotFound) -> Bool {
if lhs._configResponse != rhs._configResponse {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}

extension Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Error.EvaluationKeyNotFound: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
public static let protoMessageName: String = Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Error.protoMessageName + ".EvaluationKeyNotFound"
public static let _protobuf_nameMap = SwiftProtobuf._NameMap()

public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
// Load everything into unknown fields
while try decoder.nextFieldNumber() != nil {}
}

public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
try unknownFields.traverse(visitor: &visitor)
}

public static func ==(lhs: Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Error.EvaluationKeyNotFound, rhs: Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Error.EvaluationKeyNotFound) -> Bool {
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}

extension Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Error.InvalidRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
public static let protoMessageName: String = Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Error.protoMessageName + ".InvalidRequest"
public static let _protobuf_nameMap = SwiftProtobuf._NameMap()

public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
// Load everything into unknown fields
while try decoder.nextFieldNumber() != nil {}
}

public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
try unknownFields.traverse(visitor: &visitor)
}

public static func ==(lhs: Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Error.InvalidRequest, rhs: Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Error.InvalidRequest) -> Bool {
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}

extension Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Error.InternalError: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
public static let protoMessageName: String = Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Error.protoMessageName + ".InternalError"
public static let _protobuf_nameMap = SwiftProtobuf._NameMap()

public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
// Load everything into unknown fields
while try decoder.nextFieldNumber() != nil {}
}

public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
try unknownFields.traverse(visitor: &visitor)
}

public static func ==(lhs: Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Error.InternalError, rhs: Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Error.InternalError) -> Bool {
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}
Loading
Loading