All Downloads are FREE. Search and download functionalities are using the official Maven repository.

autopilotrpc.AutopilotClient.scala Maven / Gradle / Ivy

The newest version!

// Generated by Pekko gRPC. DO NOT EDIT.
package autopilotrpc

import scala.concurrent.ExecutionContext

import org.apache.pekko
import pekko.actor.ClassicActorSystemProvider

import pekko.grpc.GrpcChannel
import pekko.grpc.GrpcClientCloseException
import pekko.grpc.GrpcClientSettings

import pekko.grpc.scaladsl.PekkoGrpcClient

import pekko.grpc.internal.NettyClientUtils

import pekko.grpc.PekkoGrpcGenerated

import pekko.grpc.scaladsl.SingleResponseRequestBuilder
import pekko.grpc.internal.ScalaUnaryRequestBuilder

// Not sealed so users can extend to write their stubs
@PekkoGrpcGenerated
trait AutopilotClient extends Autopilot with AutopilotClientPowerApi with PekkoGrpcClient

@PekkoGrpcGenerated
object AutopilotClient {
  def apply(settings: GrpcClientSettings)(implicit sys: ClassicActorSystemProvider): AutopilotClient =
    new DefaultAutopilotClient(GrpcChannel(settings), isChannelOwned = true)
  def apply(channel: GrpcChannel)(implicit sys: ClassicActorSystemProvider): AutopilotClient =
    new DefaultAutopilotClient(channel, isChannelOwned = false)

  private class DefaultAutopilotClient(channel: GrpcChannel, isChannelOwned: Boolean)(implicit sys: ClassicActorSystemProvider) extends AutopilotClient {
    import Autopilot.MethodDescriptors._

    private implicit val ex: ExecutionContext = sys.classicSystem.dispatcher
    private val settings = channel.settings
    private val options = NettyClientUtils.callOptions(settings)

    
    private def statusRequestBuilder(channel: pekko.grpc.internal.InternalChannel) =
    
      new ScalaUnaryRequestBuilder(statusDescriptor, channel, options, settings)
    
    
    private def modifyStatusRequestBuilder(channel: pekko.grpc.internal.InternalChannel) =
    
      new ScalaUnaryRequestBuilder(modifyStatusDescriptor, channel, options, settings)
    
    
    private def queryScoresRequestBuilder(channel: pekko.grpc.internal.InternalChannel) =
    
      new ScalaUnaryRequestBuilder(queryScoresDescriptor, channel, options, settings)
    
    
    private def setScoresRequestBuilder(channel: pekko.grpc.internal.InternalChannel) =
    
      new ScalaUnaryRequestBuilder(setScoresDescriptor, channel, options, settings)
    
    

    
    /**
     * Lower level "lifted" version of the method, giving access to request metadata etc.
     * prefer status(autopilotrpc.StatusRequest) if possible.
     */
    
    override def status(): SingleResponseRequestBuilder[autopilotrpc.StatusRequest, autopilotrpc.StatusResponse] =
      statusRequestBuilder(channel.internalChannel)
    

    /**
     * For access to method metadata use the parameterless version of status
     */
    def status(in: autopilotrpc.StatusRequest): scala.concurrent.Future[autopilotrpc.StatusResponse] =
      status().invoke(in)
    
    /**
     * Lower level "lifted" version of the method, giving access to request metadata etc.
     * prefer modifyStatus(autopilotrpc.ModifyStatusRequest) if possible.
     */
    
    override def modifyStatus(): SingleResponseRequestBuilder[autopilotrpc.ModifyStatusRequest, autopilotrpc.ModifyStatusResponse] =
      modifyStatusRequestBuilder(channel.internalChannel)
    

    /**
     * For access to method metadata use the parameterless version of modifyStatus
     */
    def modifyStatus(in: autopilotrpc.ModifyStatusRequest): scala.concurrent.Future[autopilotrpc.ModifyStatusResponse] =
      modifyStatus().invoke(in)
    
    /**
     * Lower level "lifted" version of the method, giving access to request metadata etc.
     * prefer queryScores(autopilotrpc.QueryScoresRequest) if possible.
     */
    
    override def queryScores(): SingleResponseRequestBuilder[autopilotrpc.QueryScoresRequest, autopilotrpc.QueryScoresResponse] =
      queryScoresRequestBuilder(channel.internalChannel)
    

    /**
     * For access to method metadata use the parameterless version of queryScores
     */
    def queryScores(in: autopilotrpc.QueryScoresRequest): scala.concurrent.Future[autopilotrpc.QueryScoresResponse] =
      queryScores().invoke(in)
    
    /**
     * Lower level "lifted" version of the method, giving access to request metadata etc.
     * prefer setScores(autopilotrpc.SetScoresRequest) if possible.
     */
    
    override def setScores(): SingleResponseRequestBuilder[autopilotrpc.SetScoresRequest, autopilotrpc.SetScoresResponse] =
      setScoresRequestBuilder(channel.internalChannel)
    

    /**
     * For access to method metadata use the parameterless version of setScores
     */
    def setScores(in: autopilotrpc.SetScoresRequest): scala.concurrent.Future[autopilotrpc.SetScoresResponse] =
      setScores().invoke(in)
    

    override def close(): scala.concurrent.Future[pekko.Done] =
      if (isChannelOwned) channel.close()
      else throw new GrpcClientCloseException()

    override def closed: scala.concurrent.Future[pekko.Done] = channel.closed()
  }
}

@PekkoGrpcGenerated
trait AutopilotClientPowerApi {
  
  /**
   * Lower level "lifted" version of the method, giving access to request metadata etc.
   * prefer status(autopilotrpc.StatusRequest) if possible.
   */
  
  def status(): SingleResponseRequestBuilder[autopilotrpc.StatusRequest, autopilotrpc.StatusResponse] = ???
  
  
  /**
   * Lower level "lifted" version of the method, giving access to request metadata etc.
   * prefer modifyStatus(autopilotrpc.ModifyStatusRequest) if possible.
   */
  
  def modifyStatus(): SingleResponseRequestBuilder[autopilotrpc.ModifyStatusRequest, autopilotrpc.ModifyStatusResponse] = ???
  
  
  /**
   * Lower level "lifted" version of the method, giving access to request metadata etc.
   * prefer queryScores(autopilotrpc.QueryScoresRequest) if possible.
   */
  
  def queryScores(): SingleResponseRequestBuilder[autopilotrpc.QueryScoresRequest, autopilotrpc.QueryScoresResponse] = ???
  
  
  /**
   * Lower level "lifted" version of the method, giving access to request metadata etc.
   * prefer setScores(autopilotrpc.SetScoresRequest) if possible.
   */
  
  def setScores(): SingleResponseRequestBuilder[autopilotrpc.SetScoresRequest, autopilotrpc.SetScoresResponse] = ???
  
  

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy