From acd758d44cdef3517de2a6bea391a5484c85b9a0 Mon Sep 17 00:00:00 2001 From: clarifai-prod Date: Thu, 18 Jan 2024 18:21:58 +0000 Subject: [PATCH] GRPC clients version 10.0.4 --- .../proto/clarifai/api/service.grpc.swift | 42 ++++++++ .../proto/clarifai/api/service.pb.swift | 95 +++++++++++++++++++ VERSION | 2 +- 3 files changed, 138 insertions(+), 1 deletion(-) diff --git a/Sources/ClarifaiGrpc/proto/clarifai/api/service.grpc.swift b/Sources/ClarifaiGrpc/proto/clarifai/api/service.grpc.swift index ebcf201..afcd0fc 100644 --- a/Sources/ClarifaiGrpc/proto/clarifai/api/service.grpc.swift +++ b/Sources/ClarifaiGrpc/proto/clarifai/api/service.grpc.swift @@ -935,6 +935,11 @@ public protocol Clarifai_Api_V2ClientProtocol: GRPCClient { callOptions: CallOptions? ) -> UnaryCall + func patchModuleVersions( + _ request: Clarifai_Api_PatchModuleVersionsRequest, + callOptions: CallOptions? + ) -> UnaryCall + func deleteModuleVersions( _ request: Clarifai_Api_DeleteModuleVersionsRequest, callOptions: CallOptions? @@ -4425,6 +4430,24 @@ extension Clarifai_Api_V2ClientProtocol { ) } + /// Modify details of an existing module version. + /// + /// - Parameters: + /// - request: Request to send to PatchModuleVersions. + /// - callOptions: Call options. + /// - Returns: A `UnaryCall` with futures for the metadata, status and response. + public func patchModuleVersions( + _ request: Clarifai_Api_PatchModuleVersionsRequest, + callOptions: CallOptions? = nil + ) -> UnaryCall { + return self.makeUnaryCall( + path: "/clarifai.api.V2/PatchModuleVersions", + request: request, + callOptions: callOptions ?? self.defaultCallOptions, + interceptors: self.interceptors?.makePatchModuleVersionsInterceptors() ?? [] + ) + } + /// Delete a multiple module version. /// /// - Parameters: @@ -5605,6 +5628,9 @@ public protocol Clarifai_Api_V2ClientInterceptorFactoryProtocol { /// - Returns: Interceptors to use when invoking 'postModuleVersions'. func makePostModuleVersionsInterceptors() -> [ClientInterceptor] + /// - Returns: Interceptors to use when invoking 'patchModuleVersions'. + func makePatchModuleVersionsInterceptors() -> [ClientInterceptor] + /// - Returns: Interceptors to use when invoking 'deleteModuleVersions'. func makeDeleteModuleVersionsInterceptors() -> [ClientInterceptor] @@ -6325,6 +6351,9 @@ public protocol Clarifai_Api_V2Provider: CallHandlerProvider { /// Create a new module version to trigger training of the module. func postModuleVersions(request: Clarifai_Api_PostModuleVersionsRequest, context: StatusOnlyCallContext) -> EventLoopFuture + /// Modify details of an existing module version. + func patchModuleVersions(request: Clarifai_Api_PatchModuleVersionsRequest, context: StatusOnlyCallContext) -> EventLoopFuture + /// Delete a multiple module version. func deleteModuleVersions(request: Clarifai_Api_DeleteModuleVersionsRequest, context: StatusOnlyCallContext) -> EventLoopFuture @@ -8083,6 +8112,15 @@ extension Clarifai_Api_V2Provider { userFunction: self.postModuleVersions(request:context:) ) + case "PatchModuleVersions": + return UnaryServerHandler( + context: context, + requestDeserializer: ProtobufDeserializer(), + responseSerializer: ProtobufSerializer(), + interceptors: self.interceptors?.makePatchModuleVersionsInterceptors() ?? [], + userFunction: self.patchModuleVersions(request:context:) + ) + case "DeleteModuleVersions": return UnaryServerHandler( context: context, @@ -9121,6 +9159,10 @@ public protocol Clarifai_Api_V2ServerInterceptorFactoryProtocol { /// Defaults to calling `self.makeInterceptors()`. func makePostModuleVersionsInterceptors() -> [ServerInterceptor] + /// - Returns: Interceptors to use when handling 'patchModuleVersions'. + /// Defaults to calling `self.makeInterceptors()`. + func makePatchModuleVersionsInterceptors() -> [ServerInterceptor] + /// - Returns: Interceptors to use when handling 'deleteModuleVersions'. /// Defaults to calling `self.makeInterceptors()`. func makeDeleteModuleVersionsInterceptors() -> [ServerInterceptor] diff --git a/Sources/ClarifaiGrpc/proto/clarifai/api/service.pb.swift b/Sources/ClarifaiGrpc/proto/clarifai/api/service.pb.swift index c08ff0b..365045d 100644 --- a/Sources/ClarifaiGrpc/proto/clarifai/api/service.pb.swift +++ b/Sources/ClarifaiGrpc/proto/clarifai/api/service.pb.swift @@ -8987,6 +8987,47 @@ public struct Clarifai_Api_PostModuleVersionsRequest { fileprivate var _userAppID: Clarifai_Api_UserAppIDSet? = nil } +/// PatchModuleVersionsRequest +public struct Clarifai_Api_PatchModuleVersionsRequest { + // 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 userAppID: Clarifai_Api_UserAppIDSet { + get {return _userAppID ?? Clarifai_Api_UserAppIDSet()} + set {_userAppID = newValue} + } + /// Returns true if `userAppID` has been explicitly set. + public var hasUserAppID: Bool {return self._userAppID != nil} + /// Clears the value of `userAppID`. Subsequent reads from it will return its default value. + public mutating func clearUserAppID() {self._userAppID = nil} + + public var moduleID: String = String() + + /// This allows you to modify the module version details. + /// ########## Supported fields ########## + /// - description + /// - id + /// - metadata.fields + /// - module_nav.module_sub_navs[].query_key + /// - module_nav.module_sub_navs[].query_value + /// - module_nav.module_sub_navs[].title + /// - module_nav.title + /// - notes + /// - visibility.gettable + public var moduleVersions: [Clarifai_Api_ModuleVersion] = [] + + /// The action to perform on the patched objects + /// For now only action 'merge' is supported + public var action: String = String() + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public init() {} + + fileprivate var _userAppID: Clarifai_Api_UserAppIDSet? = nil +} + /// Request to delete several module versions by the list of ids. public struct Clarifai_Api_DeleteModuleVersionsRequest { // SwiftProtobuf.Message conformance is added in an extension below. See the @@ -24430,6 +24471,60 @@ extension Clarifai_Api_PostModuleVersionsRequest: SwiftProtobuf.Message, SwiftPr } } +extension Clarifai_Api_PatchModuleVersionsRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".PatchModuleVersionsRequest" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "user_app_id"), + 2: .standard(proto: "module_id"), + 3: .standard(proto: "module_versions"), + 4: .same(proto: "action"), + ] + + 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.decodeSingularMessageField(value: &self._userAppID) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.moduleID) }() + case 3: try { try decoder.decodeRepeatedMessageField(value: &self.moduleVersions) }() + case 4: try { try decoder.decodeSingularStringField(value: &self.action) }() + default: break + } + } + } + + public func traverse(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._userAppID { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + if !self.moduleID.isEmpty { + try visitor.visitSingularStringField(value: self.moduleID, fieldNumber: 2) + } + if !self.moduleVersions.isEmpty { + try visitor.visitRepeatedMessageField(value: self.moduleVersions, fieldNumber: 3) + } + if !self.action.isEmpty { + try visitor.visitSingularStringField(value: self.action, fieldNumber: 4) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: Clarifai_Api_PatchModuleVersionsRequest, rhs: Clarifai_Api_PatchModuleVersionsRequest) -> Bool { + if lhs._userAppID != rhs._userAppID {return false} + if lhs.moduleID != rhs.moduleID {return false} + if lhs.moduleVersions != rhs.moduleVersions {return false} + if lhs.action != rhs.action {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + extension Clarifai_Api_DeleteModuleVersionsRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { public static let protoMessageName: String = _protobuf_package + ".DeleteModuleVersionsRequest" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ diff --git a/VERSION b/VERSION index 6a7144d..6b48f25 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -10.0.3 +10.0.4