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

// Code generated by protoc-gen-grpc-web. DO NOT EDIT.
// versions:
// 	protoc-gen-grpc-web v1.5.0
// 	protoc              v3.19.1
// source: store/v1/store.proto


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


import * as grpcWeb from 'grpc-web';

import * as store_v1_store_pb from '../../store/v1/store_pb'; // proto import: "store/v1/store.proto"


export class StoreServiceClient {
  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'] = 'text';

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

  methodDescriptorDispatchAction = new grpcWeb.MethodDescriptor(
    '/store.v1.StoreService/DispatchAction',
    grpcWeb.MethodType.UNARY,
    store_v1_store_pb.DispatchActionRequest,
    store_v1_store_pb.DispatchActionResponse,
    (request: store_v1_store_pb.DispatchActionRequest) => {
      return request.serializeBinary();
    },
    store_v1_store_pb.DispatchActionResponse.deserializeBinary
  );

  dispatchAction(
    request: store_v1_store_pb.DispatchActionRequest,
    metadata?: grpcWeb.Metadata | null): Promise<store_v1_store_pb.DispatchActionResponse>;

  dispatchAction(
    request: store_v1_store_pb.DispatchActionRequest,
    metadata: grpcWeb.Metadata | null,
    callback: (err: grpcWeb.RpcError,
               response: store_v1_store_pb.DispatchActionResponse) => void): grpcWeb.ClientReadableStream<store_v1_store_pb.DispatchActionResponse>;

  dispatchAction(
    request: store_v1_store_pb.DispatchActionRequest,
    metadata?: grpcWeb.Metadata | null,
    callback?: (err: grpcWeb.RpcError,
               response: store_v1_store_pb.DispatchActionResponse) => void) {
    if (callback !== undefined) {
      return this.client_.rpcCall(
        this.hostname_ +
          '/store.v1.StoreService/DispatchAction',
        request,
        metadata || {},
        this.methodDescriptorDispatchAction,
        callback);
    }
    return this.client_.unaryCall(
    this.hostname_ +
      '/store.v1.StoreService/DispatchAction',
    request,
    metadata || {},
    this.methodDescriptorDispatchAction);
  }

  methodDescriptorDispatchEvent = new grpcWeb.MethodDescriptor(
    '/store.v1.StoreService/DispatchEvent',
    grpcWeb.MethodType.UNARY,
    store_v1_store_pb.DispatchEventRequest,
    store_v1_store_pb.DispatchEventResponse,
    (request: store_v1_store_pb.DispatchEventRequest) => {
      return request.serializeBinary();
    },
    store_v1_store_pb.DispatchEventResponse.deserializeBinary
  );

  dispatchEvent(
    request: store_v1_store_pb.DispatchEventRequest,
    metadata?: grpcWeb.Metadata | null): Promise<store_v1_store_pb.DispatchEventResponse>;

  dispatchEvent(
    request: store_v1_store_pb.DispatchEventRequest,
    metadata: grpcWeb.Metadata | null,
    callback: (err: grpcWeb.RpcError,
               response: store_v1_store_pb.DispatchEventResponse) => void): grpcWeb.ClientReadableStream<store_v1_store_pb.DispatchEventResponse>;

  dispatchEvent(
    request: store_v1_store_pb.DispatchEventRequest,
    metadata?: grpcWeb.Metadata | null,
    callback?: (err: grpcWeb.RpcError,
               response: store_v1_store_pb.DispatchEventResponse) => void) {
    if (callback !== undefined) {
      return this.client_.rpcCall(
        this.hostname_ +
          '/store.v1.StoreService/DispatchEvent',
        request,
        metadata || {},
        this.methodDescriptorDispatchEvent,
        callback);
    }
    return this.client_.unaryCall(
    this.hostname_ +
      '/store.v1.StoreService/DispatchEvent',
    request,
    metadata || {},
    this.methodDescriptorDispatchEvent);
  }

  methodDescriptorSubscribeEvent = new grpcWeb.MethodDescriptor(
    '/store.v1.StoreService/SubscribeEvent',
    grpcWeb.MethodType.SERVER_STREAMING,
    store_v1_store_pb.SubscribeEventRequest,
    store_v1_store_pb.SubscribeEventResponse,
    (request: store_v1_store_pb.SubscribeEventRequest) => {
      return request.serializeBinary();
    },
    store_v1_store_pb.SubscribeEventResponse.deserializeBinary
  );

  subscribeEvent(
    request: store_v1_store_pb.SubscribeEventRequest,
    metadata?: grpcWeb.Metadata): grpcWeb.ClientReadableStream<store_v1_store_pb.SubscribeEventResponse> {
    return this.client_.serverStreaming(
      this.hostname_ +
        '/store.v1.StoreService/SubscribeEvent',
      request,
      metadata || {},
      this.methodDescriptorSubscribeEvent);
  }

  methodDescriptorSubscribeStore = new grpcWeb.MethodDescriptor(
    '/store.v1.StoreService/SubscribeStore',
    grpcWeb.MethodType.SERVER_STREAMING,
    store_v1_store_pb.SubscribeStoreRequest,
    store_v1_store_pb.SubscribeStoreResponse,
    (request: store_v1_store_pb.SubscribeStoreRequest) => {
      return request.serializeBinary();
    },
    store_v1_store_pb.SubscribeStoreResponse.deserializeBinary
  );

  subscribeStore(
    request: store_v1_store_pb.SubscribeStoreRequest,
    metadata?: grpcWeb.Metadata): grpcWeb.ClientReadableStream<store_v1_store_pb.SubscribeStoreResponse> {
    return this.client_.serverStreaming(
      this.hostname_ +
        '/store.v1.StoreService/SubscribeStore',
      request,
      metadata || {},
      this.methodDescriptorSubscribeStore);
  }

}

