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

org.plasmalabs.indexer.services.TokenServiceFs2Grpc.scala Maven / Gradle / Ivy

The newest version!
package org.plasmalabs.indexer.services

import _root_.cats.syntax.all._

trait TokenServiceFs2Grpc[F[_], A] {
  def getGroupPolicy(request: org.plasmalabs.indexer.services.QueryByGroupIdRequest, ctx: A): F[org.plasmalabs.indexer.services.GroupPolicyResponse]
  def getSeriesPolicy(request: org.plasmalabs.indexer.services.QueryBySeriesIdRequest, ctx: A): F[org.plasmalabs.indexer.services.SeriesPolicyResponse]
}

object TokenServiceFs2Grpc extends _root_.fs2.grpc.GeneratedCompanion[TokenServiceFs2Grpc] {
  
  def mkClient[F[_]: _root_.cats.effect.Async, A](dispatcher: _root_.cats.effect.std.Dispatcher[F], channel: _root_.io.grpc.Channel, mkMetadata: A => F[_root_.io.grpc.Metadata], clientOptions: _root_.fs2.grpc.client.ClientOptions): TokenServiceFs2Grpc[F, A] = new TokenServiceFs2Grpc[F, A] {
    def getGroupPolicy(request: org.plasmalabs.indexer.services.QueryByGroupIdRequest, ctx: A): F[org.plasmalabs.indexer.services.GroupPolicyResponse] = {
      mkMetadata(ctx).flatMap { m =>
        _root_.fs2.grpc.client.Fs2ClientCall[F](channel, org.plasmalabs.indexer.services.TokenServiceGrpc.METHOD_GET_GROUP_POLICY, dispatcher, clientOptions).flatMap(_.unaryToUnaryCall(request, m))
      }
    }
    def getSeriesPolicy(request: org.plasmalabs.indexer.services.QueryBySeriesIdRequest, ctx: A): F[org.plasmalabs.indexer.services.SeriesPolicyResponse] = {
      mkMetadata(ctx).flatMap { m =>
        _root_.fs2.grpc.client.Fs2ClientCall[F](channel, org.plasmalabs.indexer.services.TokenServiceGrpc.METHOD_GET_SERIES_POLICY, dispatcher, clientOptions).flatMap(_.unaryToUnaryCall(request, m))
      }
    }
  }
  
  protected def serviceBinding[F[_]: _root_.cats.effect.Async, A](dispatcher: _root_.cats.effect.std.Dispatcher[F], serviceImpl: TokenServiceFs2Grpc[F, A], mkCtx: _root_.io.grpc.Metadata => F[A], serverOptions: _root_.fs2.grpc.server.ServerOptions): _root_.io.grpc.ServerServiceDefinition = {
    _root_.io.grpc.ServerServiceDefinition
      .builder(org.plasmalabs.indexer.services.TokenServiceGrpc.SERVICE)
      .addMethod(org.plasmalabs.indexer.services.TokenServiceGrpc.METHOD_GET_GROUP_POLICY, _root_.fs2.grpc.server.Fs2ServerCallHandler[F](dispatcher, serverOptions).unaryToUnaryCall[org.plasmalabs.indexer.services.QueryByGroupIdRequest, org.plasmalabs.indexer.services.GroupPolicyResponse]((r, m) => mkCtx(m).flatMap(serviceImpl.getGroupPolicy(r, _))))
      .addMethod(org.plasmalabs.indexer.services.TokenServiceGrpc.METHOD_GET_SERIES_POLICY, _root_.fs2.grpc.server.Fs2ServerCallHandler[F](dispatcher, serverOptions).unaryToUnaryCall[org.plasmalabs.indexer.services.QueryBySeriesIdRequest, org.plasmalabs.indexer.services.SeriesPolicyResponse]((r, m) => mkCtx(m).flatMap(serviceImpl.getSeriesPolicy(r, _))))
      .build()
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy