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

invoicesrpc.InvoicesClient.scala Maven / Gradle / Ivy

The newest version!

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

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.StreamResponseRequestBuilder
import pekko.grpc.internal.ScalaServerStreamingRequestBuilder
import pekko.grpc.scaladsl.SingleResponseRequestBuilder
import pekko.grpc.internal.ScalaUnaryRequestBuilder

// Not sealed so users can extend to write their stubs
@PekkoGrpcGenerated
trait InvoicesClient extends Invoices with InvoicesClientPowerApi with PekkoGrpcClient

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

  private class DefaultInvoicesClient(channel: GrpcChannel, isChannelOwned: Boolean)(implicit sys: ClassicActorSystemProvider) extends InvoicesClient {
    import Invoices.MethodDescriptors._

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

    
    private def subscribeSingleInvoiceRequestBuilder(channel: pekko.grpc.internal.InternalChannel) =
    
      
      new ScalaServerStreamingRequestBuilder(subscribeSingleInvoiceDescriptor, channel, options, settings)
      
    
    
    private def cancelInvoiceRequestBuilder(channel: pekko.grpc.internal.InternalChannel) =
    
      new ScalaUnaryRequestBuilder(cancelInvoiceDescriptor, channel, options, settings)
    
    
    private def addHoldInvoiceRequestBuilder(channel: pekko.grpc.internal.InternalChannel) =
    
      new ScalaUnaryRequestBuilder(addHoldInvoiceDescriptor, channel, options, settings)
    
    
    private def settleInvoiceRequestBuilder(channel: pekko.grpc.internal.InternalChannel) =
    
      new ScalaUnaryRequestBuilder(settleInvoiceDescriptor, channel, options, settings)
    
    
    private def lookupInvoiceV2RequestBuilder(channel: pekko.grpc.internal.InternalChannel) =
    
      new ScalaUnaryRequestBuilder(lookupInvoiceV2Descriptor, channel, options, settings)
    
    

    
    /**
     * Lower level "lifted" version of the method, giving access to request metadata etc.
     * prefer subscribeSingleInvoice(invoicesrpc.SubscribeSingleInvoiceRequest) if possible.
     */
    
    override def subscribeSingleInvoice(): StreamResponseRequestBuilder[invoicesrpc.SubscribeSingleInvoiceRequest, lnrpc.Invoice] =
      subscribeSingleInvoiceRequestBuilder(channel.internalChannel)
    

    /**
     * For access to method metadata use the parameterless version of subscribeSingleInvoice
     */
    def subscribeSingleInvoice(in: invoicesrpc.SubscribeSingleInvoiceRequest): org.apache.pekko.stream.scaladsl.Source[lnrpc.Invoice, org.apache.pekko.NotUsed] =
      subscribeSingleInvoice().invoke(in)
    
    /**
     * Lower level "lifted" version of the method, giving access to request metadata etc.
     * prefer cancelInvoice(invoicesrpc.CancelInvoiceMsg) if possible.
     */
    
    override def cancelInvoice(): SingleResponseRequestBuilder[invoicesrpc.CancelInvoiceMsg, invoicesrpc.CancelInvoiceResp] =
      cancelInvoiceRequestBuilder(channel.internalChannel)
    

    /**
     * For access to method metadata use the parameterless version of cancelInvoice
     */
    def cancelInvoice(in: invoicesrpc.CancelInvoiceMsg): scala.concurrent.Future[invoicesrpc.CancelInvoiceResp] =
      cancelInvoice().invoke(in)
    
    /**
     * Lower level "lifted" version of the method, giving access to request metadata etc.
     * prefer addHoldInvoice(invoicesrpc.AddHoldInvoiceRequest) if possible.
     */
    
    override def addHoldInvoice(): SingleResponseRequestBuilder[invoicesrpc.AddHoldInvoiceRequest, invoicesrpc.AddHoldInvoiceResp] =
      addHoldInvoiceRequestBuilder(channel.internalChannel)
    

    /**
     * For access to method metadata use the parameterless version of addHoldInvoice
     */
    def addHoldInvoice(in: invoicesrpc.AddHoldInvoiceRequest): scala.concurrent.Future[invoicesrpc.AddHoldInvoiceResp] =
      addHoldInvoice().invoke(in)
    
    /**
     * Lower level "lifted" version of the method, giving access to request metadata etc.
     * prefer settleInvoice(invoicesrpc.SettleInvoiceMsg) if possible.
     */
    
    override def settleInvoice(): SingleResponseRequestBuilder[invoicesrpc.SettleInvoiceMsg, invoicesrpc.SettleInvoiceResp] =
      settleInvoiceRequestBuilder(channel.internalChannel)
    

    /**
     * For access to method metadata use the parameterless version of settleInvoice
     */
    def settleInvoice(in: invoicesrpc.SettleInvoiceMsg): scala.concurrent.Future[invoicesrpc.SettleInvoiceResp] =
      settleInvoice().invoke(in)
    
    /**
     * Lower level "lifted" version of the method, giving access to request metadata etc.
     * prefer lookupInvoiceV2(invoicesrpc.LookupInvoiceMsg) if possible.
     */
    
    override def lookupInvoiceV2(): SingleResponseRequestBuilder[invoicesrpc.LookupInvoiceMsg, lnrpc.Invoice] =
      lookupInvoiceV2RequestBuilder(channel.internalChannel)
    

    /**
     * For access to method metadata use the parameterless version of lookupInvoiceV2
     */
    def lookupInvoiceV2(in: invoicesrpc.LookupInvoiceMsg): scala.concurrent.Future[lnrpc.Invoice] =
      lookupInvoiceV2().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 InvoicesClientPowerApi {
  
  /**
   * Lower level "lifted" version of the method, giving access to request metadata etc.
   * prefer subscribeSingleInvoice(invoicesrpc.SubscribeSingleInvoiceRequest) if possible.
   */
  
  def subscribeSingleInvoice(): StreamResponseRequestBuilder[invoicesrpc.SubscribeSingleInvoiceRequest, lnrpc.Invoice] = ???
  
  
  /**
   * Lower level "lifted" version of the method, giving access to request metadata etc.
   * prefer cancelInvoice(invoicesrpc.CancelInvoiceMsg) if possible.
   */
  
  def cancelInvoice(): SingleResponseRequestBuilder[invoicesrpc.CancelInvoiceMsg, invoicesrpc.CancelInvoiceResp] = ???
  
  
  /**
   * Lower level "lifted" version of the method, giving access to request metadata etc.
   * prefer addHoldInvoice(invoicesrpc.AddHoldInvoiceRequest) if possible.
   */
  
  def addHoldInvoice(): SingleResponseRequestBuilder[invoicesrpc.AddHoldInvoiceRequest, invoicesrpc.AddHoldInvoiceResp] = ???
  
  
  /**
   * Lower level "lifted" version of the method, giving access to request metadata etc.
   * prefer settleInvoice(invoicesrpc.SettleInvoiceMsg) if possible.
   */
  
  def settleInvoice(): SingleResponseRequestBuilder[invoicesrpc.SettleInvoiceMsg, invoicesrpc.SettleInvoiceResp] = ???
  
  
  /**
   * Lower level "lifted" version of the method, giving access to request metadata etc.
   * prefer lookupInvoiceV2(invoicesrpc.LookupInvoiceMsg) if possible.
   */
  
  def lookupInvoiceV2(): SingleResponseRequestBuilder[invoicesrpc.LookupInvoiceMsg, lnrpc.Invoice] = ???
  
  

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy