/**
 * @fileoverview gRPC-Web generated client stub for mint.tulip.v1
 * @enhanceable
 * @public
 */

// Code generated by protoc-gen-grpc-web. DO NOT EDIT.
// versions:
// 	protoc-gen-grpc-web v1.4.2
// 	protoc              v4.24.3
// source: tulip.proto


/* eslint-disable */
// @ts-nocheck


import * as grpcWeb from 'grpc-web';

import * as tulip_pb from './tulip_pb';


export class SearchClient {
  client_: grpcWeb.AbstractClientBase;
  hostname_: string;
  credentials_: null | { [index: string]: string; };
  options_: null | { [index: string]: any; };

  constructor (hostname: string,
               credentials?: null | { [index: string]: string; },
               options?: null | { [index: string]: any; }) {
    if (!options) options = {};
    if (!credentials) credentials = {};
    options['format'] = 'binary';

    this.client_ = new grpcWeb.GrpcWebClientBase(options);
    this.hostname_ = hostname.replace(/\/+$/, '');
    this.credentials_ = credentials;
    this.options_ = options;
  }

  methodDescriptorPali = new grpcWeb.MethodDescriptor(
    '/mint.tulip.v1.Search/Pali',
    grpcWeb.MethodType.UNARY,
    tulip_pb.SearchRequest,
    tulip_pb.SearchResponse,
    (request: tulip_pb.SearchRequest) => {
      return request.serializeBinary();
    },
    tulip_pb.SearchResponse.deserializeBinary
  );

  pali(
    request: tulip_pb.SearchRequest,
    metadata: grpcWeb.Metadata | null): Promise<tulip_pb.SearchResponse>;

  pali(
    request: tulip_pb.SearchRequest,
    metadata: grpcWeb.Metadata | null,
    callback: (err: grpcWeb.RpcError,
               response: tulip_pb.SearchResponse) => void): grpcWeb.ClientReadableStream<tulip_pb.SearchResponse>;

  pali(
    request: tulip_pb.SearchRequest,
    metadata: grpcWeb.Metadata | null,
    callback?: (err: grpcWeb.RpcError,
               response: tulip_pb.SearchResponse) => void) {
    if (callback !== undefined) {
      return this.client_.rpcCall(
        this.hostname_ +
          '/mint.tulip.v1.Search/Pali',
        request,
        metadata || {},
        this.methodDescriptorPali,
        callback);
    }
    return this.client_.unaryCall(
    this.hostname_ +
      '/mint.tulip.v1.Search/Pali',
    request,
    metadata || {},
    this.methodDescriptorPali);
  }

}

