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

xyz.stratalab.indexer.services.TokenServiceFs2Grpc.scala Maven / Gradle / Ivy

The newest version!
package xyz.stratalab.indexer.services

import _root_.cats.syntax.all._

trait TokenServiceFs2Grpc[F[_], A] {
  def getGroupPolicy(request: xyz.stratalab.indexer.services.QueryByGroupIdRequest, ctx: A): F[xyz.stratalab.indexer.services.GroupPolicyResponse]
  def getSeriesPolicy(request: xyz.stratalab.indexer.services.QueryBySeriesIdRequest, ctx: A): F[xyz.stratalab.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: xyz.stratalab.indexer.services.QueryByGroupIdRequest, ctx: A): F[xyz.stratalab.indexer.services.GroupPolicyResponse] = {
      mkMetadata(ctx).flatMap { m =>
        _root_.fs2.grpc.client.Fs2ClientCall[F](channel, xyz.stratalab.indexer.services.TokenServiceGrpc.METHOD_GET_GROUP_POLICY, dispatcher, clientOptions).flatMap(_.unaryToUnaryCall(request, m))
      }
    }
    def getSeriesPolicy(request: xyz.stratalab.indexer.services.QueryBySeriesIdRequest, ctx: A): F[xyz.stratalab.indexer.services.SeriesPolicyResponse] = {
      mkMetadata(ctx).flatMap { m =>
        _root_.fs2.grpc.client.Fs2ClientCall[F](channel, xyz.stratalab.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(xyz.stratalab.indexer.services.TokenServiceGrpc.SERVICE)
      .addMethod(xyz.stratalab.indexer.services.TokenServiceGrpc.METHOD_GET_GROUP_POLICY, _root_.fs2.grpc.server.Fs2ServerCallHandler[F](dispatcher, serverOptions).unaryToUnaryCall[xyz.stratalab.indexer.services.QueryByGroupIdRequest, xyz.stratalab.indexer.services.GroupPolicyResponse]((r, m) => mkCtx(m).flatMap(serviceImpl.getGroupPolicy(r, _))))
      .addMethod(xyz.stratalab.indexer.services.TokenServiceGrpc.METHOD_GET_SERIES_POLICY, _root_.fs2.grpc.server.Fs2ServerCallHandler[F](dispatcher, serverOptions).unaryToUnaryCall[xyz.stratalab.indexer.services.QueryBySeriesIdRequest, xyz.stratalab.indexer.services.SeriesPolicyResponse]((r, m) => mkCtx(m).flatMap(serviceImpl.getSeriesPolicy(r, _))))
      .build()
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy