// Code generated by protoc-gen-go-drpc. DO NOT EDIT.
// protoc-gen-go-drpc version: v0.0.34
// source: nameservice/nameserviceproto/protos/nameservice.proto

package nameserviceproto

import (
	context "context"
	errors "errors"
	drpc1 "github.com/planetscale/vtprotobuf/codec/drpc"
	drpc "storj.io/drpc"
	drpcerr "storj.io/drpc/drpcerr"
)

type drpcEncoding_File_nameservice_nameserviceproto_protos_nameservice_proto struct{}

func (drpcEncoding_File_nameservice_nameserviceproto_protos_nameservice_proto) Marshal(msg drpc.Message) ([]byte, error) {
	return drpc1.Marshal(msg)
}

func (drpcEncoding_File_nameservice_nameserviceproto_protos_nameservice_proto) Unmarshal(buf []byte, msg drpc.Message) error {
	return drpc1.Unmarshal(buf, msg)
}

func (drpcEncoding_File_nameservice_nameserviceproto_protos_nameservice_proto) JSONMarshal(msg drpc.Message) ([]byte, error) {
	return drpc1.JSONMarshal(msg)
}

func (drpcEncoding_File_nameservice_nameserviceproto_protos_nameservice_proto) JSONUnmarshal(buf []byte, msg drpc.Message) error {
	return drpc1.JSONUnmarshal(buf, msg)
}

type DRPCAnynsClient interface {
	DRPCConn() drpc.Conn

	IsNameAvailable(ctx context.Context, in *NameAvailableRequest) (*NameAvailableResponse, error)
	BatchIsNameAvailable(ctx context.Context, in *BatchNameAvailableRequest) (*BatchNameAvailableResponse, error)
	GetNameByAddress(ctx context.Context, in *NameByAddressRequest) (*NameByAddressResponse, error)
	BatchGetNameByAddress(ctx context.Context, in *BatchNameByAddressRequest) (*BatchNameByAddressResponse, error)
	GetNameByAnyId(ctx context.Context, in *NameByAnyIdRequest) (*NameByAddressResponse, error)
	BatchGetNameByAnyId(ctx context.Context, in *BatchNameByAnyIdRequest) (*BatchNameByAddressResponse, error)
	AdminNameRegisterSigned(ctx context.Context, in *NameRegisterRequestSigned) (*OperationResponse, error)
	AdminNameRenewSigned(ctx context.Context, in *NameRenewRequestSigned) (*OperationResponse, error)
}

type drpcAnynsClient struct {
	cc drpc.Conn
}

func NewDRPCAnynsClient(cc drpc.Conn) DRPCAnynsClient {
	return &drpcAnynsClient{cc}
}

func (c *drpcAnynsClient) DRPCConn() drpc.Conn { return c.cc }

func (c *drpcAnynsClient) IsNameAvailable(ctx context.Context, in *NameAvailableRequest) (*NameAvailableResponse, error) {
	out := new(NameAvailableResponse)
	err := c.cc.Invoke(ctx, "/Anyns/IsNameAvailable", drpcEncoding_File_nameservice_nameserviceproto_protos_nameservice_proto{}, in, out)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *drpcAnynsClient) BatchIsNameAvailable(ctx context.Context, in *BatchNameAvailableRequest) (*BatchNameAvailableResponse, error) {
	out := new(BatchNameAvailableResponse)
	err := c.cc.Invoke(ctx, "/Anyns/BatchIsNameAvailable", drpcEncoding_File_nameservice_nameserviceproto_protos_nameservice_proto{}, in, out)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *drpcAnynsClient) GetNameByAddress(ctx context.Context, in *NameByAddressRequest) (*NameByAddressResponse, error) {
	out := new(NameByAddressResponse)
	err := c.cc.Invoke(ctx, "/Anyns/GetNameByAddress", drpcEncoding_File_nameservice_nameserviceproto_protos_nameservice_proto{}, in, out)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *drpcAnynsClient) BatchGetNameByAddress(ctx context.Context, in *BatchNameByAddressRequest) (*BatchNameByAddressResponse, error) {
	out := new(BatchNameByAddressResponse)
	err := c.cc.Invoke(ctx, "/Anyns/BatchGetNameByAddress", drpcEncoding_File_nameservice_nameserviceproto_protos_nameservice_proto{}, in, out)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *drpcAnynsClient) GetNameByAnyId(ctx context.Context, in *NameByAnyIdRequest) (*NameByAddressResponse, error) {
	out := new(NameByAddressResponse)
	err := c.cc.Invoke(ctx, "/Anyns/GetNameByAnyId", drpcEncoding_File_nameservice_nameserviceproto_protos_nameservice_proto{}, in, out)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *drpcAnynsClient) BatchGetNameByAnyId(ctx context.Context, in *BatchNameByAnyIdRequest) (*BatchNameByAddressResponse, error) {
	out := new(BatchNameByAddressResponse)
	err := c.cc.Invoke(ctx, "/Anyns/BatchGetNameByAnyId", drpcEncoding_File_nameservice_nameserviceproto_protos_nameservice_proto{}, in, out)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *drpcAnynsClient) AdminNameRegisterSigned(ctx context.Context, in *NameRegisterRequestSigned) (*OperationResponse, error) {
	out := new(OperationResponse)
	err := c.cc.Invoke(ctx, "/Anyns/AdminNameRegisterSigned", drpcEncoding_File_nameservice_nameserviceproto_protos_nameservice_proto{}, in, out)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *drpcAnynsClient) AdminNameRenewSigned(ctx context.Context, in *NameRenewRequestSigned) (*OperationResponse, error) {
	out := new(OperationResponse)
	err := c.cc.Invoke(ctx, "/Anyns/AdminNameRenewSigned", drpcEncoding_File_nameservice_nameserviceproto_protos_nameservice_proto{}, in, out)
	if err != nil {
		return nil, err
	}
	return out, nil
}

type DRPCAnynsServer interface {
	IsNameAvailable(context.Context, *NameAvailableRequest) (*NameAvailableResponse, error)
	BatchIsNameAvailable(context.Context, *BatchNameAvailableRequest) (*BatchNameAvailableResponse, error)
	GetNameByAddress(context.Context, *NameByAddressRequest) (*NameByAddressResponse, error)
	BatchGetNameByAddress(context.Context, *BatchNameByAddressRequest) (*BatchNameByAddressResponse, error)
	GetNameByAnyId(context.Context, *NameByAnyIdRequest) (*NameByAddressResponse, error)
	BatchGetNameByAnyId(context.Context, *BatchNameByAnyIdRequest) (*BatchNameByAddressResponse, error)
	AdminNameRegisterSigned(context.Context, *NameRegisterRequestSigned) (*OperationResponse, error)
	AdminNameRenewSigned(context.Context, *NameRenewRequestSigned) (*OperationResponse, error)
}

type DRPCAnynsUnimplementedServer struct{}

func (s *DRPCAnynsUnimplementedServer) IsNameAvailable(context.Context, *NameAvailableRequest) (*NameAvailableResponse, error) {
	return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
}

func (s *DRPCAnynsUnimplementedServer) BatchIsNameAvailable(context.Context, *BatchNameAvailableRequest) (*BatchNameAvailableResponse, error) {
	return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
}

func (s *DRPCAnynsUnimplementedServer) GetNameByAddress(context.Context, *NameByAddressRequest) (*NameByAddressResponse, error) {
	return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
}

func (s *DRPCAnynsUnimplementedServer) BatchGetNameByAddress(context.Context, *BatchNameByAddressRequest) (*BatchNameByAddressResponse, error) {
	return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
}

func (s *DRPCAnynsUnimplementedServer) GetNameByAnyId(context.Context, *NameByAnyIdRequest) (*NameByAddressResponse, error) {
	return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
}

func (s *DRPCAnynsUnimplementedServer) BatchGetNameByAnyId(context.Context, *BatchNameByAnyIdRequest) (*BatchNameByAddressResponse, error) {
	return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
}

func (s *DRPCAnynsUnimplementedServer) AdminNameRegisterSigned(context.Context, *NameRegisterRequestSigned) (*OperationResponse, error) {
	return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
}

func (s *DRPCAnynsUnimplementedServer) AdminNameRenewSigned(context.Context, *NameRenewRequestSigned) (*OperationResponse, error) {
	return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
}

type DRPCAnynsDescription struct{}

func (DRPCAnynsDescription) NumMethods() int { return 8 }

func (DRPCAnynsDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, interface{}, bool) {
	switch n {
	case 0:
		return "/Anyns/IsNameAvailable", drpcEncoding_File_nameservice_nameserviceproto_protos_nameservice_proto{},
			func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
				return srv.(DRPCAnynsServer).
					IsNameAvailable(
						ctx,
						in1.(*NameAvailableRequest),
					)
			}, DRPCAnynsServer.IsNameAvailable, true
	case 1:
		return "/Anyns/BatchIsNameAvailable", drpcEncoding_File_nameservice_nameserviceproto_protos_nameservice_proto{},
			func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
				return srv.(DRPCAnynsServer).
					BatchIsNameAvailable(
						ctx,
						in1.(*BatchNameAvailableRequest),
					)
			}, DRPCAnynsServer.BatchIsNameAvailable, true
	case 2:
		return "/Anyns/GetNameByAddress", drpcEncoding_File_nameservice_nameserviceproto_protos_nameservice_proto{},
			func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
				return srv.(DRPCAnynsServer).
					GetNameByAddress(
						ctx,
						in1.(*NameByAddressRequest),
					)
			}, DRPCAnynsServer.GetNameByAddress, true
	case 3:
		return "/Anyns/BatchGetNameByAddress", drpcEncoding_File_nameservice_nameserviceproto_protos_nameservice_proto{},
			func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
				return srv.(DRPCAnynsServer).
					BatchGetNameByAddress(
						ctx,
						in1.(*BatchNameByAddressRequest),
					)
			}, DRPCAnynsServer.BatchGetNameByAddress, true
	case 4:
		return "/Anyns/GetNameByAnyId", drpcEncoding_File_nameservice_nameserviceproto_protos_nameservice_proto{},
			func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
				return srv.(DRPCAnynsServer).
					GetNameByAnyId(
						ctx,
						in1.(*NameByAnyIdRequest),
					)
			}, DRPCAnynsServer.GetNameByAnyId, true
	case 5:
		return "/Anyns/BatchGetNameByAnyId", drpcEncoding_File_nameservice_nameserviceproto_protos_nameservice_proto{},
			func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
				return srv.(DRPCAnynsServer).
					BatchGetNameByAnyId(
						ctx,
						in1.(*BatchNameByAnyIdRequest),
					)
			}, DRPCAnynsServer.BatchGetNameByAnyId, true
	case 6:
		return "/Anyns/AdminNameRegisterSigned", drpcEncoding_File_nameservice_nameserviceproto_protos_nameservice_proto{},
			func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
				return srv.(DRPCAnynsServer).
					AdminNameRegisterSigned(
						ctx,
						in1.(*NameRegisterRequestSigned),
					)
			}, DRPCAnynsServer.AdminNameRegisterSigned, true
	case 7:
		return "/Anyns/AdminNameRenewSigned", drpcEncoding_File_nameservice_nameserviceproto_protos_nameservice_proto{},
			func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
				return srv.(DRPCAnynsServer).
					AdminNameRenewSigned(
						ctx,
						in1.(*NameRenewRequestSigned),
					)
			}, DRPCAnynsServer.AdminNameRenewSigned, true
	default:
		return "", nil, nil, nil, false
	}
}

func DRPCRegisterAnyns(mux drpc.Mux, impl DRPCAnynsServer) error {
	return mux.Register(impl, DRPCAnynsDescription{})
}

type DRPCAnyns_IsNameAvailableStream interface {
	drpc.Stream
	SendAndClose(*NameAvailableResponse) error
}

type drpcAnyns_IsNameAvailableStream struct {
	drpc.Stream
}

func (x *drpcAnyns_IsNameAvailableStream) SendAndClose(m *NameAvailableResponse) error {
	if err := x.MsgSend(m, drpcEncoding_File_nameservice_nameserviceproto_protos_nameservice_proto{}); err != nil {
		return err
	}
	return x.CloseSend()
}

type DRPCAnyns_BatchIsNameAvailableStream interface {
	drpc.Stream
	SendAndClose(*BatchNameAvailableResponse) error
}

type drpcAnyns_BatchIsNameAvailableStream struct {
	drpc.Stream
}

func (x *drpcAnyns_BatchIsNameAvailableStream) SendAndClose(m *BatchNameAvailableResponse) error {
	if err := x.MsgSend(m, drpcEncoding_File_nameservice_nameserviceproto_protos_nameservice_proto{}); err != nil {
		return err
	}
	return x.CloseSend()
}

type DRPCAnyns_GetNameByAddressStream interface {
	drpc.Stream
	SendAndClose(*NameByAddressResponse) error
}

type drpcAnyns_GetNameByAddressStream struct {
	drpc.Stream
}

func (x *drpcAnyns_GetNameByAddressStream) SendAndClose(m *NameByAddressResponse) error {
	if err := x.MsgSend(m, drpcEncoding_File_nameservice_nameserviceproto_protos_nameservice_proto{}); err != nil {
		return err
	}
	return x.CloseSend()
}

type DRPCAnyns_BatchGetNameByAddressStream interface {
	drpc.Stream
	SendAndClose(*BatchNameByAddressResponse) error
}

type drpcAnyns_BatchGetNameByAddressStream struct {
	drpc.Stream
}

func (x *drpcAnyns_BatchGetNameByAddressStream) SendAndClose(m *BatchNameByAddressResponse) error {
	if err := x.MsgSend(m, drpcEncoding_File_nameservice_nameserviceproto_protos_nameservice_proto{}); err != nil {
		return err
	}
	return x.CloseSend()
}

type DRPCAnyns_GetNameByAnyIdStream interface {
	drpc.Stream
	SendAndClose(*NameByAddressResponse) error
}

type drpcAnyns_GetNameByAnyIdStream struct {
	drpc.Stream
}

func (x *drpcAnyns_GetNameByAnyIdStream) SendAndClose(m *NameByAddressResponse) error {
	if err := x.MsgSend(m, drpcEncoding_File_nameservice_nameserviceproto_protos_nameservice_proto{}); err != nil {
		return err
	}
	return x.CloseSend()
}

type DRPCAnyns_BatchGetNameByAnyIdStream interface {
	drpc.Stream
	SendAndClose(*BatchNameByAddressResponse) error
}

type drpcAnyns_BatchGetNameByAnyIdStream struct {
	drpc.Stream
}

func (x *drpcAnyns_BatchGetNameByAnyIdStream) SendAndClose(m *BatchNameByAddressResponse) error {
	if err := x.MsgSend(m, drpcEncoding_File_nameservice_nameserviceproto_protos_nameservice_proto{}); err != nil {
		return err
	}
	return x.CloseSend()
}

type DRPCAnyns_AdminNameRegisterSignedStream interface {
	drpc.Stream
	SendAndClose(*OperationResponse) error
}

type drpcAnyns_AdminNameRegisterSignedStream struct {
	drpc.Stream
}

func (x *drpcAnyns_AdminNameRegisterSignedStream) SendAndClose(m *OperationResponse) error {
	if err := x.MsgSend(m, drpcEncoding_File_nameservice_nameserviceproto_protos_nameservice_proto{}); err != nil {
		return err
	}
	return x.CloseSend()
}

type DRPCAnyns_AdminNameRenewSignedStream interface {
	drpc.Stream
	SendAndClose(*OperationResponse) error
}

type drpcAnyns_AdminNameRenewSignedStream struct {
	drpc.Stream
}

func (x *drpcAnyns_AdminNameRenewSignedStream) SendAndClose(m *OperationResponse) error {
	if err := x.MsgSend(m, drpcEncoding_File_nameservice_nameserviceproto_protos_nameservice_proto{}); err != nil {
		return err
	}
	return x.CloseSend()
}
