// Code generated by protoc-gen-go. DO NOT EDIT.
// source: internal_web_api.proto

package rpc

import (
	context "context"
	fmt "fmt"
	proto "github.com/golang/protobuf/proto"
	grpc "google.golang.org/grpc"
	math "math"
)

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package

func init() { proto.RegisterFile("internal_web_api.proto", fileDescriptor_bc27de61216bb692) }

var fileDescriptor_bc27de61216bb692 = []byte{
	// 262 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x91, 0x41, 0x4b, 0xc3, 0x40,
	0x10, 0x85, 0x8b, 0x87, 0x1e, 0x16, 0x14, 0xdc, 0x83, 0x60, 0x11, 0xa9, 0xbd, 0x4a, 0x13, 0xd0,
	0x5f, 0x60, 0xdb, 0x4b, 0x7a, 0xb0, 0xa2, 0xc5, 0x82, 0x97, 0xb2, 0x9b, 0x8e, 0xc9, 0x90, 0x74,
	0x66, 0x9d, 0x4c, 0x0c, 0xfe, 0x68, 0xff, 0x83, 0x54, 0x13, 0xa1, 0x50, 0x6f, 0x1e, 0xe7, 0xbd,
	0xef, 0xbd, 0x19, 0x18, 0x73, 0x86, 0xa4, 0x20, 0xe4, 0xca, 0x75, 0x03, 0x7e, 0xed, 0x02, 0x46,
	0x41, 0x58, 0xd9, 0xf6, 0x1b, 0xf0, 0x12, 0xd2, 0xc1, 0xf1, 0x9e, 0x7c, 0xf3, 0x79, 0x64, 0x4e,
	0x92, 0x36, 0xb1, 0x02, 0x7f, 0x17, 0xd0, 0x3e, 0x99, 0xf3, 0x45, 0x00, 0x5a, 0x4a, 0x5d, 0x29,
	0x6c, 0x1e, 0xdc, 0xc7, 0x16, 0x48, 0xa7, 0xb9, 0x23, 0x82, 0xd2, 0x5e, 0x45, 0x3f, 0x3d, 0xd1,
	0x0e, 0xd9, 0xf7, 0x1e, 0xe1, 0xad, 0x86, 0x4a, 0x07, 0xa7, 0x1d, 0xd2, 0xea, 0xc9, 0x6c, 0xd4,
	0xb3, 0x73, 0x33, 0x4c, 0xa8, 0x52, 0x47, 0x8a, 0x4e, 0xe1, 0x70, 0xf7, 0x6f, 0x70, 0xc9, 0x05,
	0x50, 0x42, 0xaf, 0x7c, 0xb8, 0xeb, 0xd9, 0xd8, 0x19, 0x04, 0xae, 0x50, 0xef, 0x99, 0x26, 0x25,
	0xa7, 0x05, 0x52, 0x66, 0x87, 0x1d, 0xda, 0x7a, 0x0b, 0x59, 0xa1, 0xe6, 0x1b, 0x71, 0x4d, 0x77,
	0xd8, 0xc5, 0x9f, 0xc4, 0x9c, 0xfd, 0xa8, 0x67, 0xbd, 0xb9, 0x9c, 0x32, 0x07, 0x10, 0xa7, 0xf8,
	0x0e, 0x9d, 0xf7, 0xaf, 0x3b, 0x26, 0xe3, 0x97, 0xeb, 0x0c, 0x35, 0xaf, 0x7d, 0x94, 0xf2, 0x36,
	0x4e, 0xa1, 0x04, 0x19, 0x13, 0x68, 0xc3, 0x52, 0xc4, 0x19, 0x4f, 0x77, 0x73, 0xdc, 0x80, 0x77,
	0x01, 0x63, 0x09, 0xa9, 0xef, 0x7f, 0x7f, 0xe9, 0xf6, 0x2b, 0x00, 0x00, 0xff, 0xff, 0xa5, 0x4f,
	0x86, 0xc4, 0xd6, 0x01, 0x00, 0x00,
}

// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4

// InternalWebApiClient is the client API for InternalWebApi service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type InternalWebApiClient interface {
	OpenTrustedPaymentChannel(ctx context.Context, in *OpenPaymentChannelRequest, opts ...grpc.CallOption) (*ChannelID, error)
	InstantiateTrustedPaymentChannel(ctx context.Context, in *TokenInfo, opts ...grpc.CallOption) (*ChannelID, error)
	DepositNonBlocking(ctx context.Context, in *DepositOrWithdrawRequest, opts ...grpc.CallOption) (*DepositOrWithdrawJob, error)
	CooperativeWithdrawNonBlocking(ctx context.Context, in *DepositOrWithdrawRequest, opts ...grpc.CallOption) (*DepositOrWithdrawJob, error)
}

type internalWebApiClient struct {
	cc *grpc.ClientConn
}

func NewInternalWebApiClient(cc *grpc.ClientConn) InternalWebApiClient {
	return &internalWebApiClient{cc}
}

func (c *internalWebApiClient) OpenTrustedPaymentChannel(ctx context.Context, in *OpenPaymentChannelRequest, opts ...grpc.CallOption) (*ChannelID, error) {
	out := new(ChannelID)
	err := c.cc.Invoke(ctx, "/webrpc.InternalWebApi/OpenTrustedPaymentChannel", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *internalWebApiClient) InstantiateTrustedPaymentChannel(ctx context.Context, in *TokenInfo, opts ...grpc.CallOption) (*ChannelID, error) {
	out := new(ChannelID)
	err := c.cc.Invoke(ctx, "/webrpc.InternalWebApi/InstantiateTrustedPaymentChannel", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *internalWebApiClient) DepositNonBlocking(ctx context.Context, in *DepositOrWithdrawRequest, opts ...grpc.CallOption) (*DepositOrWithdrawJob, error) {
	out := new(DepositOrWithdrawJob)
	err := c.cc.Invoke(ctx, "/webrpc.InternalWebApi/DepositNonBlocking", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *internalWebApiClient) CooperativeWithdrawNonBlocking(ctx context.Context, in *DepositOrWithdrawRequest, opts ...grpc.CallOption) (*DepositOrWithdrawJob, error) {
	out := new(DepositOrWithdrawJob)
	err := c.cc.Invoke(ctx, "/webrpc.InternalWebApi/CooperativeWithdrawNonBlocking", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// InternalWebApiServer is the server API for InternalWebApi service.
type InternalWebApiServer interface {
	OpenTrustedPaymentChannel(context.Context, *OpenPaymentChannelRequest) (*ChannelID, error)
	InstantiateTrustedPaymentChannel(context.Context, *TokenInfo) (*ChannelID, error)
	DepositNonBlocking(context.Context, *DepositOrWithdrawRequest) (*DepositOrWithdrawJob, error)
	CooperativeWithdrawNonBlocking(context.Context, *DepositOrWithdrawRequest) (*DepositOrWithdrawJob, error)
}

func RegisterInternalWebApiServer(s *grpc.Server, srv InternalWebApiServer) {
	s.RegisterService(&_InternalWebApi_serviceDesc, srv)
}

func _InternalWebApi_OpenTrustedPaymentChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(OpenPaymentChannelRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(InternalWebApiServer).OpenTrustedPaymentChannel(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/webrpc.InternalWebApi/OpenTrustedPaymentChannel",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(InternalWebApiServer).OpenTrustedPaymentChannel(ctx, req.(*OpenPaymentChannelRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _InternalWebApi_InstantiateTrustedPaymentChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(TokenInfo)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(InternalWebApiServer).InstantiateTrustedPaymentChannel(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/webrpc.InternalWebApi/InstantiateTrustedPaymentChannel",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(InternalWebApiServer).InstantiateTrustedPaymentChannel(ctx, req.(*TokenInfo))
	}
	return interceptor(ctx, in, info, handler)
}

func _InternalWebApi_DepositNonBlocking_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DepositOrWithdrawRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(InternalWebApiServer).DepositNonBlocking(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/webrpc.InternalWebApi/DepositNonBlocking",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(InternalWebApiServer).DepositNonBlocking(ctx, req.(*DepositOrWithdrawRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _InternalWebApi_CooperativeWithdrawNonBlocking_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DepositOrWithdrawRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(InternalWebApiServer).CooperativeWithdrawNonBlocking(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/webrpc.InternalWebApi/CooperativeWithdrawNonBlocking",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(InternalWebApiServer).CooperativeWithdrawNonBlocking(ctx, req.(*DepositOrWithdrawRequest))
	}
	return interceptor(ctx, in, info, handler)
}

var _InternalWebApi_serviceDesc = grpc.ServiceDesc{
	ServiceName: "webrpc.InternalWebApi",
	HandlerType: (*InternalWebApiServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "OpenTrustedPaymentChannel",
			Handler:    _InternalWebApi_OpenTrustedPaymentChannel_Handler,
		},
		{
			MethodName: "InstantiateTrustedPaymentChannel",
			Handler:    _InternalWebApi_InstantiateTrustedPaymentChannel_Handler,
		},
		{
			MethodName: "DepositNonBlocking",
			Handler:    _InternalWebApi_DepositNonBlocking_Handler,
		},
		{
			MethodName: "CooperativeWithdrawNonBlocking",
			Handler:    _InternalWebApi_CooperativeWithdrawNonBlocking_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "internal_web_api.proto",
}
