//
// DO NOT EDIT.
// swift-format-ignore-file
//
// Generated by the protocol buffer compiler.
// Source: controlPanel.proto
//
import GRPC
import NIO
import NIOConcurrencyHelpers
import SwiftProtobuf


/// Usage: instantiate `ControlPanelServiceClient`, then call methods of this protocol to make API calls.
public protocol ControlPanelServiceClientProtocol: GRPCClient {
  var serviceName: String { get }
  var interceptors: ControlPanelServiceClientInterceptorFactoryProtocol? { get }

  func manageGPUServer(
    _ request: GPUServerRequest,
    callOptions: CallOptions?
  ) -> UnaryCall<GPUServerRequest, GPUServerResponse>

  func updateThrottlingConfig(
    _ request: ThrottlingRequest,
    callOptions: CallOptions?
  ) -> UnaryCall<ThrottlingRequest, ThrottlingResponse>

  func updatePem(
    _ request: UpdatePemRequest,
    callOptions: CallOptions?
  ) -> UnaryCall<UpdatePemRequest, UpdatePemResponse>

  func updateModelList(
    _ request: UpdateModelListRequest,
    callOptions: CallOptions?
  ) -> UnaryCall<UpdateModelListRequest, UpdateModelListResponse>

  func updateSharedSecret(
    _ request: UpdateSharedSecretRequest,
    callOptions: CallOptions?
  ) -> UnaryCall<UpdateSharedSecretRequest, UpdateSharedSecretResponse>

  func updatePrivateKey(
    _ request: UpdatePrivateKeyRequest,
    callOptions: CallOptions?
  ) -> UnaryCall<UpdatePrivateKeyRequest, UpdatePrivateKeyResponse>

  func updateComputeUnit(
    _ request: UpdateComputeUnitRequest,
    callOptions: CallOptions?
  ) -> UnaryCall<UpdateComputeUnitRequest, UpdateComputeUnitResponse>
}

extension ControlPanelServiceClientProtocol {
  public var serviceName: String {
    return "ControlPanelService"
  }

  /// Unary call to ManageGPUServer
  ///
  /// - Parameters:
  ///   - request: Request to send to ManageGPUServer.
  ///   - callOptions: Call options.
  /// - Returns: A `UnaryCall` with futures for the metadata, status and response.
  public func manageGPUServer(
    _ request: GPUServerRequest,
    callOptions: CallOptions? = nil
  ) -> UnaryCall<GPUServerRequest, GPUServerResponse> {
    return self.makeUnaryCall(
      path: ControlPanelServiceClientMetadata.Methods.manageGPUServer.path,
      request: request,
      callOptions: callOptions ?? self.defaultCallOptions,
      interceptors: self.interceptors?.makeManageGPUServerInterceptors() ?? []
    )
  }

  /// Unary call to UpdateThrottlingConfig
  ///
  /// - Parameters:
  ///   - request: Request to send to UpdateThrottlingConfig.
  ///   - callOptions: Call options.
  /// - Returns: A `UnaryCall` with futures for the metadata, status and response.
  public func updateThrottlingConfig(
    _ request: ThrottlingRequest,
    callOptions: CallOptions? = nil
  ) -> UnaryCall<ThrottlingRequest, ThrottlingResponse> {
    return self.makeUnaryCall(
      path: ControlPanelServiceClientMetadata.Methods.updateThrottlingConfig.path,
      request: request,
      callOptions: callOptions ?? self.defaultCallOptions,
      interceptors: self.interceptors?.makeUpdateThrottlingConfigInterceptors() ?? []
    )
  }

  /// Unary call to UpdatePem
  ///
  /// - Parameters:
  ///   - request: Request to send to UpdatePem.
  ///   - callOptions: Call options.
  /// - Returns: A `UnaryCall` with futures for the metadata, status and response.
  public func updatePem(
    _ request: UpdatePemRequest,
    callOptions: CallOptions? = nil
  ) -> UnaryCall<UpdatePemRequest, UpdatePemResponse> {
    return self.makeUnaryCall(
      path: ControlPanelServiceClientMetadata.Methods.updatePem.path,
      request: request,
      callOptions: callOptions ?? self.defaultCallOptions,
      interceptors: self.interceptors?.makeUpdatePemInterceptors() ?? []
    )
  }

  /// Unary call to UpdateModelList
  ///
  /// - Parameters:
  ///   - request: Request to send to UpdateModelList.
  ///   - callOptions: Call options.
  /// - Returns: A `UnaryCall` with futures for the metadata, status and response.
  public func updateModelList(
    _ request: UpdateModelListRequest,
    callOptions: CallOptions? = nil
  ) -> UnaryCall<UpdateModelListRequest, UpdateModelListResponse> {
    return self.makeUnaryCall(
      path: ControlPanelServiceClientMetadata.Methods.updateModelList.path,
      request: request,
      callOptions: callOptions ?? self.defaultCallOptions,
      interceptors: self.interceptors?.makeUpdateModelListInterceptors() ?? []
    )
  }

  /// Unary call to UpdateSharedSecret
  ///
  /// - Parameters:
  ///   - request: Request to send to UpdateSharedSecret.
  ///   - callOptions: Call options.
  /// - Returns: A `UnaryCall` with futures for the metadata, status and response.
  public func updateSharedSecret(
    _ request: UpdateSharedSecretRequest,
    callOptions: CallOptions? = nil
  ) -> UnaryCall<UpdateSharedSecretRequest, UpdateSharedSecretResponse> {
    return self.makeUnaryCall(
      path: ControlPanelServiceClientMetadata.Methods.updateSharedSecret.path,
      request: request,
      callOptions: callOptions ?? self.defaultCallOptions,
      interceptors: self.interceptors?.makeUpdateSharedSecretInterceptors() ?? []
    )
  }

  /// Unary call to UpdatePrivateKey
  ///
  /// - Parameters:
  ///   - request: Request to send to UpdatePrivateKey.
  ///   - callOptions: Call options.
  /// - Returns: A `UnaryCall` with futures for the metadata, status and response.
  public func updatePrivateKey(
    _ request: UpdatePrivateKeyRequest,
    callOptions: CallOptions? = nil
  ) -> UnaryCall<UpdatePrivateKeyRequest, UpdatePrivateKeyResponse> {
    return self.makeUnaryCall(
      path: ControlPanelServiceClientMetadata.Methods.updatePrivateKey.path,
      request: request,
      callOptions: callOptions ?? self.defaultCallOptions,
      interceptors: self.interceptors?.makeUpdatePrivateKeyInterceptors() ?? []
    )
  }

  /// Unary call to UpdateComputeUnit
  ///
  /// - Parameters:
  ///   - request: Request to send to UpdateComputeUnit.
  ///   - callOptions: Call options.
  /// - Returns: A `UnaryCall` with futures for the metadata, status and response.
  public func updateComputeUnit(
    _ request: UpdateComputeUnitRequest,
    callOptions: CallOptions? = nil
  ) -> UnaryCall<UpdateComputeUnitRequest, UpdateComputeUnitResponse> {
    return self.makeUnaryCall(
      path: ControlPanelServiceClientMetadata.Methods.updateComputeUnit.path,
      request: request,
      callOptions: callOptions ?? self.defaultCallOptions,
      interceptors: self.interceptors?.makeUpdateComputeUnitInterceptors() ?? []
    )
  }
}

@available(*, deprecated)
extension ControlPanelServiceClient: @unchecked Sendable {}

@available(*, deprecated, renamed: "ControlPanelServiceNIOClient")
public final class ControlPanelServiceClient: ControlPanelServiceClientProtocol {
  private let lock = Lock()
  private var _defaultCallOptions: CallOptions
  private var _interceptors: ControlPanelServiceClientInterceptorFactoryProtocol?
  public let channel: GRPCChannel
  public var defaultCallOptions: CallOptions {
    get { self.lock.withLock { return self._defaultCallOptions } }
    set { self.lock.withLockVoid { self._defaultCallOptions = newValue } }
  }
  public var interceptors: ControlPanelServiceClientInterceptorFactoryProtocol? {
    get { self.lock.withLock { return self._interceptors } }
    set { self.lock.withLockVoid { self._interceptors = newValue } }
  }

  /// Creates a client for the ControlPanelService service.
  ///
  /// - Parameters:
  ///   - channel: `GRPCChannel` to the service host.
  ///   - defaultCallOptions: Options to use for each service call if the user doesn't provide them.
  ///   - interceptors: A factory providing interceptors for each RPC.
  public init(
    channel: GRPCChannel,
    defaultCallOptions: CallOptions = CallOptions(),
    interceptors: ControlPanelServiceClientInterceptorFactoryProtocol? = nil
  ) {
    self.channel = channel
    self._defaultCallOptions = defaultCallOptions
    self._interceptors = interceptors
  }
}

public struct ControlPanelServiceNIOClient: ControlPanelServiceClientProtocol {
  public var channel: GRPCChannel
  public var defaultCallOptions: CallOptions
  public var interceptors: ControlPanelServiceClientInterceptorFactoryProtocol?

  /// Creates a client for the ControlPanelService service.
  ///
  /// - Parameters:
  ///   - channel: `GRPCChannel` to the service host.
  ///   - defaultCallOptions: Options to use for each service call if the user doesn't provide them.
  ///   - interceptors: A factory providing interceptors for each RPC.
  public init(
    channel: GRPCChannel,
    defaultCallOptions: CallOptions = CallOptions(),
    interceptors: ControlPanelServiceClientInterceptorFactoryProtocol? = nil
  ) {
    self.channel = channel
    self.defaultCallOptions = defaultCallOptions
    self.interceptors = interceptors
  }
}

@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public protocol ControlPanelServiceAsyncClientProtocol: GRPCClient {
  static var serviceDescriptor: GRPCServiceDescriptor { get }
  var interceptors: ControlPanelServiceClientInterceptorFactoryProtocol? { get }

  func makeManageGpuserverCall(
    _ request: GPUServerRequest,
    callOptions: CallOptions?
  ) -> GRPCAsyncUnaryCall<GPUServerRequest, GPUServerResponse>

  func makeUpdateThrottlingConfigCall(
    _ request: ThrottlingRequest,
    callOptions: CallOptions?
  ) -> GRPCAsyncUnaryCall<ThrottlingRequest, ThrottlingResponse>

  func makeUpdatePemCall(
    _ request: UpdatePemRequest,
    callOptions: CallOptions?
  ) -> GRPCAsyncUnaryCall<UpdatePemRequest, UpdatePemResponse>

  func makeUpdateModelListCall(
    _ request: UpdateModelListRequest,
    callOptions: CallOptions?
  ) -> GRPCAsyncUnaryCall<UpdateModelListRequest, UpdateModelListResponse>

  func makeUpdateSharedSecretCall(
    _ request: UpdateSharedSecretRequest,
    callOptions: CallOptions?
  ) -> GRPCAsyncUnaryCall<UpdateSharedSecretRequest, UpdateSharedSecretResponse>

  func makeUpdatePrivateKeyCall(
    _ request: UpdatePrivateKeyRequest,
    callOptions: CallOptions?
  ) -> GRPCAsyncUnaryCall<UpdatePrivateKeyRequest, UpdatePrivateKeyResponse>

  func makeUpdateComputeUnitCall(
    _ request: UpdateComputeUnitRequest,
    callOptions: CallOptions?
  ) -> GRPCAsyncUnaryCall<UpdateComputeUnitRequest, UpdateComputeUnitResponse>
}

@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension ControlPanelServiceAsyncClientProtocol {
  public static var serviceDescriptor: GRPCServiceDescriptor {
    return ControlPanelServiceClientMetadata.serviceDescriptor
  }

  public var interceptors: ControlPanelServiceClientInterceptorFactoryProtocol? {
    return nil
  }

  public func makeManageGpuserverCall(
    _ request: GPUServerRequest,
    callOptions: CallOptions? = nil
  ) -> GRPCAsyncUnaryCall<GPUServerRequest, GPUServerResponse> {
    return self.makeAsyncUnaryCall(
      path: ControlPanelServiceClientMetadata.Methods.manageGPUServer.path,
      request: request,
      callOptions: callOptions ?? self.defaultCallOptions,
      interceptors: self.interceptors?.makeManageGPUServerInterceptors() ?? []
    )
  }

  public func makeUpdateThrottlingConfigCall(
    _ request: ThrottlingRequest,
    callOptions: CallOptions? = nil
  ) -> GRPCAsyncUnaryCall<ThrottlingRequest, ThrottlingResponse> {
    return self.makeAsyncUnaryCall(
      path: ControlPanelServiceClientMetadata.Methods.updateThrottlingConfig.path,
      request: request,
      callOptions: callOptions ?? self.defaultCallOptions,
      interceptors: self.interceptors?.makeUpdateThrottlingConfigInterceptors() ?? []
    )
  }

  public func makeUpdatePemCall(
    _ request: UpdatePemRequest,
    callOptions: CallOptions? = nil
  ) -> GRPCAsyncUnaryCall<UpdatePemRequest, UpdatePemResponse> {
    return self.makeAsyncUnaryCall(
      path: ControlPanelServiceClientMetadata.Methods.updatePem.path,
      request: request,
      callOptions: callOptions ?? self.defaultCallOptions,
      interceptors: self.interceptors?.makeUpdatePemInterceptors() ?? []
    )
  }

  public func makeUpdateModelListCall(
    _ request: UpdateModelListRequest,
    callOptions: CallOptions? = nil
  ) -> GRPCAsyncUnaryCall<UpdateModelListRequest, UpdateModelListResponse> {
    return self.makeAsyncUnaryCall(
      path: ControlPanelServiceClientMetadata.Methods.updateModelList.path,
      request: request,
      callOptions: callOptions ?? self.defaultCallOptions,
      interceptors: self.interceptors?.makeUpdateModelListInterceptors() ?? []
    )
  }

  public func makeUpdateSharedSecretCall(
    _ request: UpdateSharedSecretRequest,
    callOptions: CallOptions? = nil
  ) -> GRPCAsyncUnaryCall<UpdateSharedSecretRequest, UpdateSharedSecretResponse> {
    return self.makeAsyncUnaryCall(
      path: ControlPanelServiceClientMetadata.Methods.updateSharedSecret.path,
      request: request,
      callOptions: callOptions ?? self.defaultCallOptions,
      interceptors: self.interceptors?.makeUpdateSharedSecretInterceptors() ?? []
    )
  }

  public func makeUpdatePrivateKeyCall(
    _ request: UpdatePrivateKeyRequest,
    callOptions: CallOptions? = nil
  ) -> GRPCAsyncUnaryCall<UpdatePrivateKeyRequest, UpdatePrivateKeyResponse> {
    return self.makeAsyncUnaryCall(
      path: ControlPanelServiceClientMetadata.Methods.updatePrivateKey.path,
      request: request,
      callOptions: callOptions ?? self.defaultCallOptions,
      interceptors: self.interceptors?.makeUpdatePrivateKeyInterceptors() ?? []
    )
  }

  public func makeUpdateComputeUnitCall(
    _ request: UpdateComputeUnitRequest,
    callOptions: CallOptions? = nil
  ) -> GRPCAsyncUnaryCall<UpdateComputeUnitRequest, UpdateComputeUnitResponse> {
    return self.makeAsyncUnaryCall(
      path: ControlPanelServiceClientMetadata.Methods.updateComputeUnit.path,
      request: request,
      callOptions: callOptions ?? self.defaultCallOptions,
      interceptors: self.interceptors?.makeUpdateComputeUnitInterceptors() ?? []
    )
  }
}

@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension ControlPanelServiceAsyncClientProtocol {
  public func manageGPUServer(
    _ request: GPUServerRequest,
    callOptions: CallOptions? = nil
  ) async throws -> GPUServerResponse {
    return try await self.performAsyncUnaryCall(
      path: ControlPanelServiceClientMetadata.Methods.manageGPUServer.path,
      request: request,
      callOptions: callOptions ?? self.defaultCallOptions,
      interceptors: self.interceptors?.makeManageGPUServerInterceptors() ?? []
    )
  }

  public func updateThrottlingConfig(
    _ request: ThrottlingRequest,
    callOptions: CallOptions? = nil
  ) async throws -> ThrottlingResponse {
    return try await self.performAsyncUnaryCall(
      path: ControlPanelServiceClientMetadata.Methods.updateThrottlingConfig.path,
      request: request,
      callOptions: callOptions ?? self.defaultCallOptions,
      interceptors: self.interceptors?.makeUpdateThrottlingConfigInterceptors() ?? []
    )
  }

  public func updatePem(
    _ request: UpdatePemRequest,
    callOptions: CallOptions? = nil
  ) async throws -> UpdatePemResponse {
    return try await self.performAsyncUnaryCall(
      path: ControlPanelServiceClientMetadata.Methods.updatePem.path,
      request: request,
      callOptions: callOptions ?? self.defaultCallOptions,
      interceptors: self.interceptors?.makeUpdatePemInterceptors() ?? []
    )
  }

  public func updateModelList(
    _ request: UpdateModelListRequest,
    callOptions: CallOptions? = nil
  ) async throws -> UpdateModelListResponse {
    return try await self.performAsyncUnaryCall(
      path: ControlPanelServiceClientMetadata.Methods.updateModelList.path,
      request: request,
      callOptions: callOptions ?? self.defaultCallOptions,
      interceptors: self.interceptors?.makeUpdateModelListInterceptors() ?? []
    )
  }

  public func updateSharedSecret(
    _ request: UpdateSharedSecretRequest,
    callOptions: CallOptions? = nil
  ) async throws -> UpdateSharedSecretResponse {
    return try await self.performAsyncUnaryCall(
      path: ControlPanelServiceClientMetadata.Methods.updateSharedSecret.path,
      request: request,
      callOptions: callOptions ?? self.defaultCallOptions,
      interceptors: self.interceptors?.makeUpdateSharedSecretInterceptors() ?? []
    )
  }

  public func updatePrivateKey(
    _ request: UpdatePrivateKeyRequest,
    callOptions: CallOptions? = nil
  ) async throws -> UpdatePrivateKeyResponse {
    return try await self.performAsyncUnaryCall(
      path: ControlPanelServiceClientMetadata.Methods.updatePrivateKey.path,
      request: request,
      callOptions: callOptions ?? self.defaultCallOptions,
      interceptors: self.interceptors?.makeUpdatePrivateKeyInterceptors() ?? []
    )
  }

  public func updateComputeUnit(
    _ request: UpdateComputeUnitRequest,
    callOptions: CallOptions? = nil
  ) async throws -> UpdateComputeUnitResponse {
    return try await self.performAsyncUnaryCall(
      path: ControlPanelServiceClientMetadata.Methods.updateComputeUnit.path,
      request: request,
      callOptions: callOptions ?? self.defaultCallOptions,
      interceptors: self.interceptors?.makeUpdateComputeUnitInterceptors() ?? []
    )
  }
}

@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public struct ControlPanelServiceAsyncClient: ControlPanelServiceAsyncClientProtocol {
  public var channel: GRPCChannel
  public var defaultCallOptions: CallOptions
  public var interceptors: ControlPanelServiceClientInterceptorFactoryProtocol?

  public init(
    channel: GRPCChannel,
    defaultCallOptions: CallOptions = CallOptions(),
    interceptors: ControlPanelServiceClientInterceptorFactoryProtocol? = nil
  ) {
    self.channel = channel
    self.defaultCallOptions = defaultCallOptions
    self.interceptors = interceptors
  }
}

public protocol ControlPanelServiceClientInterceptorFactoryProtocol: Sendable {

  /// - Returns: Interceptors to use when invoking 'manageGPUServer'.
  func makeManageGPUServerInterceptors() -> [ClientInterceptor<GPUServerRequest, GPUServerResponse>]

  /// - Returns: Interceptors to use when invoking 'updateThrottlingConfig'.
  func makeUpdateThrottlingConfigInterceptors() -> [ClientInterceptor<ThrottlingRequest, ThrottlingResponse>]

  /// - Returns: Interceptors to use when invoking 'updatePem'.
  func makeUpdatePemInterceptors() -> [ClientInterceptor<UpdatePemRequest, UpdatePemResponse>]

  /// - Returns: Interceptors to use when invoking 'updateModelList'.
  func makeUpdateModelListInterceptors() -> [ClientInterceptor<UpdateModelListRequest, UpdateModelListResponse>]

  /// - Returns: Interceptors to use when invoking 'updateSharedSecret'.
  func makeUpdateSharedSecretInterceptors() -> [ClientInterceptor<UpdateSharedSecretRequest, UpdateSharedSecretResponse>]

  /// - Returns: Interceptors to use when invoking 'updatePrivateKey'.
  func makeUpdatePrivateKeyInterceptors() -> [ClientInterceptor<UpdatePrivateKeyRequest, UpdatePrivateKeyResponse>]

  /// - Returns: Interceptors to use when invoking 'updateComputeUnit'.
  func makeUpdateComputeUnitInterceptors() -> [ClientInterceptor<UpdateComputeUnitRequest, UpdateComputeUnitResponse>]
}

public enum ControlPanelServiceClientMetadata {
  public static let serviceDescriptor = GRPCServiceDescriptor(
    name: "ControlPanelService",
    fullName: "ControlPanelService",
    methods: [
      ControlPanelServiceClientMetadata.Methods.manageGPUServer,
      ControlPanelServiceClientMetadata.Methods.updateThrottlingConfig,
      ControlPanelServiceClientMetadata.Methods.updatePem,
      ControlPanelServiceClientMetadata.Methods.updateModelList,
      ControlPanelServiceClientMetadata.Methods.updateSharedSecret,
      ControlPanelServiceClientMetadata.Methods.updatePrivateKey,
      ControlPanelServiceClientMetadata.Methods.updateComputeUnit,
    ]
  )

  public enum Methods {
    public static let manageGPUServer = GRPCMethodDescriptor(
      name: "ManageGPUServer",
      path: "/ControlPanelService/ManageGPUServer",
      type: GRPCCallType.unary
    )

    public static let updateThrottlingConfig = GRPCMethodDescriptor(
      name: "UpdateThrottlingConfig",
      path: "/ControlPanelService/UpdateThrottlingConfig",
      type: GRPCCallType.unary
    )

    public static let updatePem = GRPCMethodDescriptor(
      name: "UpdatePem",
      path: "/ControlPanelService/UpdatePem",
      type: GRPCCallType.unary
    )

    public static let updateModelList = GRPCMethodDescriptor(
      name: "UpdateModelList",
      path: "/ControlPanelService/UpdateModelList",
      type: GRPCCallType.unary
    )

    public static let updateSharedSecret = GRPCMethodDescriptor(
      name: "UpdateSharedSecret",
      path: "/ControlPanelService/UpdateSharedSecret",
      type: GRPCCallType.unary
    )

    public static let updatePrivateKey = GRPCMethodDescriptor(
      name: "UpdatePrivateKey",
      path: "/ControlPanelService/UpdatePrivateKey",
      type: GRPCCallType.unary
    )

    public static let updateComputeUnit = GRPCMethodDescriptor(
      name: "UpdateComputeUnit",
      path: "/ControlPanelService/UpdateComputeUnit",
      type: GRPCCallType.unary
    )
  }
}

/// To build a server, implement a class that conforms to this protocol.
public protocol ControlPanelServiceProvider: CallHandlerProvider {
  var interceptors: ControlPanelServiceServerInterceptorFactoryProtocol? { get }

  func manageGPUServer(request: GPUServerRequest, context: StatusOnlyCallContext) -> EventLoopFuture<GPUServerResponse>

  func updateThrottlingConfig(request: ThrottlingRequest, context: StatusOnlyCallContext) -> EventLoopFuture<ThrottlingResponse>

  func updatePem(request: UpdatePemRequest, context: StatusOnlyCallContext) -> EventLoopFuture<UpdatePemResponse>

  func updateModelList(request: UpdateModelListRequest, context: StatusOnlyCallContext) -> EventLoopFuture<UpdateModelListResponse>

  func updateSharedSecret(request: UpdateSharedSecretRequest, context: StatusOnlyCallContext) -> EventLoopFuture<UpdateSharedSecretResponse>

  func updatePrivateKey(request: UpdatePrivateKeyRequest, context: StatusOnlyCallContext) -> EventLoopFuture<UpdatePrivateKeyResponse>

  func updateComputeUnit(request: UpdateComputeUnitRequest, context: StatusOnlyCallContext) -> EventLoopFuture<UpdateComputeUnitResponse>
}

extension ControlPanelServiceProvider {
  public var serviceName: Substring {
    return ControlPanelServiceServerMetadata.serviceDescriptor.fullName[...]
  }

  /// Determines, calls and returns the appropriate request handler, depending on the request's method.
  /// Returns nil for methods not handled by this service.
  public func handle(
    method name: Substring,
    context: CallHandlerContext
  ) -> GRPCServerHandlerProtocol? {
    switch name {
    case "ManageGPUServer":
      return UnaryServerHandler(
        context: context,
        requestDeserializer: ProtobufDeserializer<GPUServerRequest>(),
        responseSerializer: ProtobufSerializer<GPUServerResponse>(),
        interceptors: self.interceptors?.makeManageGPUServerInterceptors() ?? [],
        userFunction: self.manageGPUServer(request:context:)
      )

    case "UpdateThrottlingConfig":
      return UnaryServerHandler(
        context: context,
        requestDeserializer: ProtobufDeserializer<ThrottlingRequest>(),
        responseSerializer: ProtobufSerializer<ThrottlingResponse>(),
        interceptors: self.interceptors?.makeUpdateThrottlingConfigInterceptors() ?? [],
        userFunction: self.updateThrottlingConfig(request:context:)
      )

    case "UpdatePem":
      return UnaryServerHandler(
        context: context,
        requestDeserializer: ProtobufDeserializer<UpdatePemRequest>(),
        responseSerializer: ProtobufSerializer<UpdatePemResponse>(),
        interceptors: self.interceptors?.makeUpdatePemInterceptors() ?? [],
        userFunction: self.updatePem(request:context:)
      )

    case "UpdateModelList":
      return UnaryServerHandler(
        context: context,
        requestDeserializer: ProtobufDeserializer<UpdateModelListRequest>(),
        responseSerializer: ProtobufSerializer<UpdateModelListResponse>(),
        interceptors: self.interceptors?.makeUpdateModelListInterceptors() ?? [],
        userFunction: self.updateModelList(request:context:)
      )

    case "UpdateSharedSecret":
      return UnaryServerHandler(
        context: context,
        requestDeserializer: ProtobufDeserializer<UpdateSharedSecretRequest>(),
        responseSerializer: ProtobufSerializer<UpdateSharedSecretResponse>(),
        interceptors: self.interceptors?.makeUpdateSharedSecretInterceptors() ?? [],
        userFunction: self.updateSharedSecret(request:context:)
      )

    case "UpdatePrivateKey":
      return UnaryServerHandler(
        context: context,
        requestDeserializer: ProtobufDeserializer<UpdatePrivateKeyRequest>(),
        responseSerializer: ProtobufSerializer<UpdatePrivateKeyResponse>(),
        interceptors: self.interceptors?.makeUpdatePrivateKeyInterceptors() ?? [],
        userFunction: self.updatePrivateKey(request:context:)
      )

    case "UpdateComputeUnit":
      return UnaryServerHandler(
        context: context,
        requestDeserializer: ProtobufDeserializer<UpdateComputeUnitRequest>(),
        responseSerializer: ProtobufSerializer<UpdateComputeUnitResponse>(),
        interceptors: self.interceptors?.makeUpdateComputeUnitInterceptors() ?? [],
        userFunction: self.updateComputeUnit(request:context:)
      )

    default:
      return nil
    }
  }
}

/// To implement a server, implement an object which conforms to this protocol.
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public protocol ControlPanelServiceAsyncProvider: CallHandlerProvider, Sendable {
  static var serviceDescriptor: GRPCServiceDescriptor { get }
  var interceptors: ControlPanelServiceServerInterceptorFactoryProtocol? { get }

  func manageGPUServer(
    request: GPUServerRequest,
    context: GRPCAsyncServerCallContext
  ) async throws -> GPUServerResponse

  func updateThrottlingConfig(
    request: ThrottlingRequest,
    context: GRPCAsyncServerCallContext
  ) async throws -> ThrottlingResponse

  func updatePem(
    request: UpdatePemRequest,
    context: GRPCAsyncServerCallContext
  ) async throws -> UpdatePemResponse

  func updateModelList(
    request: UpdateModelListRequest,
    context: GRPCAsyncServerCallContext
  ) async throws -> UpdateModelListResponse

  func updateSharedSecret(
    request: UpdateSharedSecretRequest,
    context: GRPCAsyncServerCallContext
  ) async throws -> UpdateSharedSecretResponse

  func updatePrivateKey(
    request: UpdatePrivateKeyRequest,
    context: GRPCAsyncServerCallContext
  ) async throws -> UpdatePrivateKeyResponse

  func updateComputeUnit(
    request: UpdateComputeUnitRequest,
    context: GRPCAsyncServerCallContext
  ) async throws -> UpdateComputeUnitResponse
}

@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension ControlPanelServiceAsyncProvider {
  public static var serviceDescriptor: GRPCServiceDescriptor {
    return ControlPanelServiceServerMetadata.serviceDescriptor
  }

  public var serviceName: Substring {
    return ControlPanelServiceServerMetadata.serviceDescriptor.fullName[...]
  }

  public var interceptors: ControlPanelServiceServerInterceptorFactoryProtocol? {
    return nil
  }

  public func handle(
    method name: Substring,
    context: CallHandlerContext
  ) -> GRPCServerHandlerProtocol? {
    switch name {
    case "ManageGPUServer":
      return GRPCAsyncServerHandler(
        context: context,
        requestDeserializer: ProtobufDeserializer<GPUServerRequest>(),
        responseSerializer: ProtobufSerializer<GPUServerResponse>(),
        interceptors: self.interceptors?.makeManageGPUServerInterceptors() ?? [],
        wrapping: { try await self.manageGPUServer(request: $0, context: $1) }
      )

    case "UpdateThrottlingConfig":
      return GRPCAsyncServerHandler(
        context: context,
        requestDeserializer: ProtobufDeserializer<ThrottlingRequest>(),
        responseSerializer: ProtobufSerializer<ThrottlingResponse>(),
        interceptors: self.interceptors?.makeUpdateThrottlingConfigInterceptors() ?? [],
        wrapping: { try await self.updateThrottlingConfig(request: $0, context: $1) }
      )

    case "UpdatePem":
      return GRPCAsyncServerHandler(
        context: context,
        requestDeserializer: ProtobufDeserializer<UpdatePemRequest>(),
        responseSerializer: ProtobufSerializer<UpdatePemResponse>(),
        interceptors: self.interceptors?.makeUpdatePemInterceptors() ?? [],
        wrapping: { try await self.updatePem(request: $0, context: $1) }
      )

    case "UpdateModelList":
      return GRPCAsyncServerHandler(
        context: context,
        requestDeserializer: ProtobufDeserializer<UpdateModelListRequest>(),
        responseSerializer: ProtobufSerializer<UpdateModelListResponse>(),
        interceptors: self.interceptors?.makeUpdateModelListInterceptors() ?? [],
        wrapping: { try await self.updateModelList(request: $0, context: $1) }
      )

    case "UpdateSharedSecret":
      return GRPCAsyncServerHandler(
        context: context,
        requestDeserializer: ProtobufDeserializer<UpdateSharedSecretRequest>(),
        responseSerializer: ProtobufSerializer<UpdateSharedSecretResponse>(),
        interceptors: self.interceptors?.makeUpdateSharedSecretInterceptors() ?? [],
        wrapping: { try await self.updateSharedSecret(request: $0, context: $1) }
      )

    case "UpdatePrivateKey":
      return GRPCAsyncServerHandler(
        context: context,
        requestDeserializer: ProtobufDeserializer<UpdatePrivateKeyRequest>(),
        responseSerializer: ProtobufSerializer<UpdatePrivateKeyResponse>(),
        interceptors: self.interceptors?.makeUpdatePrivateKeyInterceptors() ?? [],
        wrapping: { try await self.updatePrivateKey(request: $0, context: $1) }
      )

    case "UpdateComputeUnit":
      return GRPCAsyncServerHandler(
        context: context,
        requestDeserializer: ProtobufDeserializer<UpdateComputeUnitRequest>(),
        responseSerializer: ProtobufSerializer<UpdateComputeUnitResponse>(),
        interceptors: self.interceptors?.makeUpdateComputeUnitInterceptors() ?? [],
        wrapping: { try await self.updateComputeUnit(request: $0, context: $1) }
      )

    default:
      return nil
    }
  }
}

public protocol ControlPanelServiceServerInterceptorFactoryProtocol: Sendable {

  /// - Returns: Interceptors to use when handling 'manageGPUServer'.
  ///   Defaults to calling `self.makeInterceptors()`.
  func makeManageGPUServerInterceptors() -> [ServerInterceptor<GPUServerRequest, GPUServerResponse>]

  /// - Returns: Interceptors to use when handling 'updateThrottlingConfig'.
  ///   Defaults to calling `self.makeInterceptors()`.
  func makeUpdateThrottlingConfigInterceptors() -> [ServerInterceptor<ThrottlingRequest, ThrottlingResponse>]

  /// - Returns: Interceptors to use when handling 'updatePem'.
  ///   Defaults to calling `self.makeInterceptors()`.
  func makeUpdatePemInterceptors() -> [ServerInterceptor<UpdatePemRequest, UpdatePemResponse>]

  /// - Returns: Interceptors to use when handling 'updateModelList'.
  ///   Defaults to calling `self.makeInterceptors()`.
  func makeUpdateModelListInterceptors() -> [ServerInterceptor<UpdateModelListRequest, UpdateModelListResponse>]

  /// - Returns: Interceptors to use when handling 'updateSharedSecret'.
  ///   Defaults to calling `self.makeInterceptors()`.
  func makeUpdateSharedSecretInterceptors() -> [ServerInterceptor<UpdateSharedSecretRequest, UpdateSharedSecretResponse>]

  /// - Returns: Interceptors to use when handling 'updatePrivateKey'.
  ///   Defaults to calling `self.makeInterceptors()`.
  func makeUpdatePrivateKeyInterceptors() -> [ServerInterceptor<UpdatePrivateKeyRequest, UpdatePrivateKeyResponse>]

  /// - Returns: Interceptors to use when handling 'updateComputeUnit'.
  ///   Defaults to calling `self.makeInterceptors()`.
  func makeUpdateComputeUnitInterceptors() -> [ServerInterceptor<UpdateComputeUnitRequest, UpdateComputeUnitResponse>]
}

public enum ControlPanelServiceServerMetadata {
  public static let serviceDescriptor = GRPCServiceDescriptor(
    name: "ControlPanelService",
    fullName: "ControlPanelService",
    methods: [
      ControlPanelServiceServerMetadata.Methods.manageGPUServer,
      ControlPanelServiceServerMetadata.Methods.updateThrottlingConfig,
      ControlPanelServiceServerMetadata.Methods.updatePem,
      ControlPanelServiceServerMetadata.Methods.updateModelList,
      ControlPanelServiceServerMetadata.Methods.updateSharedSecret,
      ControlPanelServiceServerMetadata.Methods.updatePrivateKey,
      ControlPanelServiceServerMetadata.Methods.updateComputeUnit,
    ]
  )

  public enum Methods {
    public static let manageGPUServer = GRPCMethodDescriptor(
      name: "ManageGPUServer",
      path: "/ControlPanelService/ManageGPUServer",
      type: GRPCCallType.unary
    )

    public static let updateThrottlingConfig = GRPCMethodDescriptor(
      name: "UpdateThrottlingConfig",
      path: "/ControlPanelService/UpdateThrottlingConfig",
      type: GRPCCallType.unary
    )

    public static let updatePem = GRPCMethodDescriptor(
      name: "UpdatePem",
      path: "/ControlPanelService/UpdatePem",
      type: GRPCCallType.unary
    )

    public static let updateModelList = GRPCMethodDescriptor(
      name: "UpdateModelList",
      path: "/ControlPanelService/UpdateModelList",
      type: GRPCCallType.unary
    )

    public static let updateSharedSecret = GRPCMethodDescriptor(
      name: "UpdateSharedSecret",
      path: "/ControlPanelService/UpdateSharedSecret",
      type: GRPCCallType.unary
    )

    public static let updatePrivateKey = GRPCMethodDescriptor(
      name: "UpdatePrivateKey",
      path: "/ControlPanelService/UpdatePrivateKey",
      type: GRPCCallType.unary
    )

    public static let updateComputeUnit = GRPCMethodDescriptor(
      name: "UpdateComputeUnit",
      path: "/ControlPanelService/UpdateComputeUnit",
      type: GRPCCallType.unary
    )
  }
}
