// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.1
// - protoc             v3.21.12
// source: yandex/cloud/mdb/elasticsearch/v1/auth_service.proto

package elasticsearch

import (
	context "context"
	operation "github.com/yandex-cloud/go-genproto/yandex/cloud/operation"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
)

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9

const (
	AuthService_ListProviders_FullMethodName   = "/yandex.cloud.mdb.elasticsearch.v1.AuthService/ListProviders"
	AuthService_GetProvider_FullMethodName     = "/yandex.cloud.mdb.elasticsearch.v1.AuthService/GetProvider"
	AuthService_AddProviders_FullMethodName    = "/yandex.cloud.mdb.elasticsearch.v1.AuthService/AddProviders"
	AuthService_UpdateProviders_FullMethodName = "/yandex.cloud.mdb.elasticsearch.v1.AuthService/UpdateProviders"
	AuthService_DeleteProviders_FullMethodName = "/yandex.cloud.mdb.elasticsearch.v1.AuthService/DeleteProviders"
	AuthService_UpdateProvider_FullMethodName  = "/yandex.cloud.mdb.elasticsearch.v1.AuthService/UpdateProvider"
	AuthService_DeleteProvider_FullMethodName  = "/yandex.cloud.mdb.elasticsearch.v1.AuthService/DeleteProvider"
)

// AuthServiceClient is the client API for AuthService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
//
// A set of methods for managing Elasticsearch Authentication resources.
type AuthServiceClient interface {
	// Retrieves the list of registered auth providers for Elasticsearch cluster.
	ListProviders(ctx context.Context, in *ListAuthProvidersRequest, opts ...grpc.CallOption) (*ListAuthProvidersResponse, error)
	// Returns registered auth provider by name.
	GetProvider(ctx context.Context, in *GetAuthProviderRequest, opts ...grpc.CallOption) (*AuthProvider, error)
	// Adds new auth providers to Elasticsearch cluster.
	AddProviders(ctx context.Context, in *AddAuthProvidersRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Replase the list of auth providers.
	UpdateProviders(ctx context.Context, in *UpdateAuthProvidersRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Removes auth providers from Elasticsearch cluster by name.
	DeleteProviders(ctx context.Context, in *DeleteAuthProvidersRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Updates registered auth provider.
	UpdateProvider(ctx context.Context, in *UpdateAuthProviderRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Removes auth provider from Elasticsearch cluster by name.
	DeleteProvider(ctx context.Context, in *DeleteAuthProviderRequest, opts ...grpc.CallOption) (*operation.Operation, error)
}

type authServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewAuthServiceClient(cc grpc.ClientConnInterface) AuthServiceClient {
	return &authServiceClient{cc}
}

func (c *authServiceClient) ListProviders(ctx context.Context, in *ListAuthProvidersRequest, opts ...grpc.CallOption) (*ListAuthProvidersResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ListAuthProvidersResponse)
	err := c.cc.Invoke(ctx, AuthService_ListProviders_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *authServiceClient) GetProvider(ctx context.Context, in *GetAuthProviderRequest, opts ...grpc.CallOption) (*AuthProvider, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(AuthProvider)
	err := c.cc.Invoke(ctx, AuthService_GetProvider_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *authServiceClient) AddProviders(ctx context.Context, in *AddAuthProvidersRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(operation.Operation)
	err := c.cc.Invoke(ctx, AuthService_AddProviders_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *authServiceClient) UpdateProviders(ctx context.Context, in *UpdateAuthProvidersRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(operation.Operation)
	err := c.cc.Invoke(ctx, AuthService_UpdateProviders_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *authServiceClient) DeleteProviders(ctx context.Context, in *DeleteAuthProvidersRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(operation.Operation)
	err := c.cc.Invoke(ctx, AuthService_DeleteProviders_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *authServiceClient) UpdateProvider(ctx context.Context, in *UpdateAuthProviderRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(operation.Operation)
	err := c.cc.Invoke(ctx, AuthService_UpdateProvider_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *authServiceClient) DeleteProvider(ctx context.Context, in *DeleteAuthProviderRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(operation.Operation)
	err := c.cc.Invoke(ctx, AuthService_DeleteProvider_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// AuthServiceServer is the server API for AuthService service.
// All implementations should embed UnimplementedAuthServiceServer
// for forward compatibility.
//
// A set of methods for managing Elasticsearch Authentication resources.
type AuthServiceServer interface {
	// Retrieves the list of registered auth providers for Elasticsearch cluster.
	ListProviders(context.Context, *ListAuthProvidersRequest) (*ListAuthProvidersResponse, error)
	// Returns registered auth provider by name.
	GetProvider(context.Context, *GetAuthProviderRequest) (*AuthProvider, error)
	// Adds new auth providers to Elasticsearch cluster.
	AddProviders(context.Context, *AddAuthProvidersRequest) (*operation.Operation, error)
	// Replase the list of auth providers.
	UpdateProviders(context.Context, *UpdateAuthProvidersRequest) (*operation.Operation, error)
	// Removes auth providers from Elasticsearch cluster by name.
	DeleteProviders(context.Context, *DeleteAuthProvidersRequest) (*operation.Operation, error)
	// Updates registered auth provider.
	UpdateProvider(context.Context, *UpdateAuthProviderRequest) (*operation.Operation, error)
	// Removes auth provider from Elasticsearch cluster by name.
	DeleteProvider(context.Context, *DeleteAuthProviderRequest) (*operation.Operation, error)
}

// UnimplementedAuthServiceServer should be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedAuthServiceServer struct{}

func (UnimplementedAuthServiceServer) ListProviders(context.Context, *ListAuthProvidersRequest) (*ListAuthProvidersResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method ListProviders not implemented")
}
func (UnimplementedAuthServiceServer) GetProvider(context.Context, *GetAuthProviderRequest) (*AuthProvider, error) {
	return nil, status.Error(codes.Unimplemented, "method GetProvider not implemented")
}
func (UnimplementedAuthServiceServer) AddProviders(context.Context, *AddAuthProvidersRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method AddProviders not implemented")
}
func (UnimplementedAuthServiceServer) UpdateProviders(context.Context, *UpdateAuthProvidersRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method UpdateProviders not implemented")
}
func (UnimplementedAuthServiceServer) DeleteProviders(context.Context, *DeleteAuthProvidersRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method DeleteProviders not implemented")
}
func (UnimplementedAuthServiceServer) UpdateProvider(context.Context, *UpdateAuthProviderRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method UpdateProvider not implemented")
}
func (UnimplementedAuthServiceServer) DeleteProvider(context.Context, *DeleteAuthProviderRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method DeleteProvider not implemented")
}
func (UnimplementedAuthServiceServer) testEmbeddedByValue() {}

// UnsafeAuthServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to AuthServiceServer will
// result in compilation errors.
type UnsafeAuthServiceServer interface {
	mustEmbedUnimplementedAuthServiceServer()
}

func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer) {
	// If the following call panics, it indicates UnimplementedAuthServiceServer was
	// embedded by pointer and is nil.  This will cause panics if an
	// unimplemented method is ever invoked, so we test this at initialization
	// time to prevent it from happening at runtime later due to I/O.
	if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
		t.testEmbeddedByValue()
	}
	s.RegisterService(&AuthService_ServiceDesc, srv)
}

func _AuthService_ListProviders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListAuthProvidersRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AuthServiceServer).ListProviders(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: AuthService_ListProviders_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AuthServiceServer).ListProviders(ctx, req.(*ListAuthProvidersRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _AuthService_GetProvider_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetAuthProviderRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AuthServiceServer).GetProvider(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: AuthService_GetProvider_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AuthServiceServer).GetProvider(ctx, req.(*GetAuthProviderRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _AuthService_AddProviders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(AddAuthProvidersRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AuthServiceServer).AddProviders(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: AuthService_AddProviders_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AuthServiceServer).AddProviders(ctx, req.(*AddAuthProvidersRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _AuthService_UpdateProviders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(UpdateAuthProvidersRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AuthServiceServer).UpdateProviders(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: AuthService_UpdateProviders_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AuthServiceServer).UpdateProviders(ctx, req.(*UpdateAuthProvidersRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _AuthService_DeleteProviders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DeleteAuthProvidersRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AuthServiceServer).DeleteProviders(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: AuthService_DeleteProviders_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AuthServiceServer).DeleteProviders(ctx, req.(*DeleteAuthProvidersRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _AuthService_UpdateProvider_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(UpdateAuthProviderRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AuthServiceServer).UpdateProvider(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: AuthService_UpdateProvider_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AuthServiceServer).UpdateProvider(ctx, req.(*UpdateAuthProviderRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _AuthService_DeleteProvider_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DeleteAuthProviderRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AuthServiceServer).DeleteProvider(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: AuthService_DeleteProvider_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AuthServiceServer).DeleteProvider(ctx, req.(*DeleteAuthProviderRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// AuthService_ServiceDesc is the grpc.ServiceDesc for AuthService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var AuthService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "yandex.cloud.mdb.elasticsearch.v1.AuthService",
	HandlerType: (*AuthServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ListProviders",
			Handler:    _AuthService_ListProviders_Handler,
		},
		{
			MethodName: "GetProvider",
			Handler:    _AuthService_GetProvider_Handler,
		},
		{
			MethodName: "AddProviders",
			Handler:    _AuthService_AddProviders_Handler,
		},
		{
			MethodName: "UpdateProviders",
			Handler:    _AuthService_UpdateProviders_Handler,
		},
		{
			MethodName: "DeleteProviders",
			Handler:    _AuthService_DeleteProviders_Handler,
		},
		{
			MethodName: "UpdateProvider",
			Handler:    _AuthService_UpdateProvider_Handler,
		},
		{
			MethodName: "DeleteProvider",
			Handler:    _AuthService_DeleteProvider_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "yandex/cloud/mdb/elasticsearch/v1/auth_service.proto",
}
