Skip to content

Commit

Permalink
GRPC clients version 10.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
clarifai-prod committed Jan 18, 2024
1 parent 999e3ae commit acd758d
Show file tree
Hide file tree
Showing 3 changed files with 138 additions and 1 deletion.
42 changes: 42 additions & 0 deletions Sources/ClarifaiGrpc/proto/clarifai/api/service.grpc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,11 @@ public protocol Clarifai_Api_V2ClientProtocol: GRPCClient {
callOptions: CallOptions?
) -> UnaryCall<Clarifai_Api_PostModuleVersionsRequest, Clarifai_Api_MultiModuleVersionResponse>

func patchModuleVersions(
_ request: Clarifai_Api_PatchModuleVersionsRequest,
callOptions: CallOptions?
) -> UnaryCall<Clarifai_Api_PatchModuleVersionsRequest, Clarifai_Api_MultiModuleVersionResponse>

func deleteModuleVersions(
_ request: Clarifai_Api_DeleteModuleVersionsRequest,
callOptions: CallOptions?
Expand Down Expand Up @@ -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<Clarifai_Api_PatchModuleVersionsRequest, Clarifai_Api_MultiModuleVersionResponse> {
return self.makeUnaryCall(
path: "/clarifai.api.V2/PatchModuleVersions",
request: request,
callOptions: callOptions ?? self.defaultCallOptions,
interceptors: self.interceptors?.makePatchModuleVersionsInterceptors() ?? []
)
}

/// Delete a multiple module version.
///
/// - Parameters:
Expand Down Expand Up @@ -5605,6 +5628,9 @@ public protocol Clarifai_Api_V2ClientInterceptorFactoryProtocol {
/// - Returns: Interceptors to use when invoking 'postModuleVersions'.
func makePostModuleVersionsInterceptors() -> [ClientInterceptor<Clarifai_Api_PostModuleVersionsRequest, Clarifai_Api_MultiModuleVersionResponse>]

/// - Returns: Interceptors to use when invoking 'patchModuleVersions'.
func makePatchModuleVersionsInterceptors() -> [ClientInterceptor<Clarifai_Api_PatchModuleVersionsRequest, Clarifai_Api_MultiModuleVersionResponse>]

/// - Returns: Interceptors to use when invoking 'deleteModuleVersions'.
func makeDeleteModuleVersionsInterceptors() -> [ClientInterceptor<Clarifai_Api_DeleteModuleVersionsRequest, Clarifai_Api_Status_BaseResponse>]

Expand Down Expand Up @@ -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<Clarifai_Api_MultiModuleVersionResponse>

/// Modify details of an existing module version.
func patchModuleVersions(request: Clarifai_Api_PatchModuleVersionsRequest, context: StatusOnlyCallContext) -> EventLoopFuture<Clarifai_Api_MultiModuleVersionResponse>

/// Delete a multiple module version.
func deleteModuleVersions(request: Clarifai_Api_DeleteModuleVersionsRequest, context: StatusOnlyCallContext) -> EventLoopFuture<Clarifai_Api_Status_BaseResponse>

Expand Down Expand Up @@ -8083,6 +8112,15 @@ extension Clarifai_Api_V2Provider {
userFunction: self.postModuleVersions(request:context:)
)

case "PatchModuleVersions":
return UnaryServerHandler(
context: context,
requestDeserializer: ProtobufDeserializer<Clarifai_Api_PatchModuleVersionsRequest>(),
responseSerializer: ProtobufSerializer<Clarifai_Api_MultiModuleVersionResponse>(),
interceptors: self.interceptors?.makePatchModuleVersionsInterceptors() ?? [],
userFunction: self.patchModuleVersions(request:context:)
)

case "DeleteModuleVersions":
return UnaryServerHandler(
context: context,
Expand Down Expand Up @@ -9121,6 +9159,10 @@ public protocol Clarifai_Api_V2ServerInterceptorFactoryProtocol {
/// Defaults to calling `self.makeInterceptors()`.
func makePostModuleVersionsInterceptors() -> [ServerInterceptor<Clarifai_Api_PostModuleVersionsRequest, Clarifai_Api_MultiModuleVersionResponse>]

/// - Returns: Interceptors to use when handling 'patchModuleVersions'.
/// Defaults to calling `self.makeInterceptors()`.
func makePatchModuleVersionsInterceptors() -> [ServerInterceptor<Clarifai_Api_PatchModuleVersionsRequest, Clarifai_Api_MultiModuleVersionResponse>]

/// - Returns: Interceptors to use when handling 'deleteModuleVersions'.
/// Defaults to calling `self.makeInterceptors()`.
func makeDeleteModuleVersionsInterceptors() -> [ServerInterceptor<Clarifai_Api_DeleteModuleVersionsRequest, Clarifai_Api_Status_BaseResponse>]
Expand Down
95 changes: 95 additions & 0 deletions Sources/ClarifaiGrpc/proto/clarifai/api/service.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<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._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<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._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 = [
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.0.3
10.0.4

0 comments on commit acd758d

Please sign in to comment.