// 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/audittrails/v1/trail_service.proto

package audittrails

import (
	context "context"
	access "github.com/yandex-cloud/go-genproto/yandex/cloud/access"
	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 (
	TrailService_Get_FullMethodName                  = "/yandex.cloud.audittrails.v1.TrailService/Get"
	TrailService_List_FullMethodName                 = "/yandex.cloud.audittrails.v1.TrailService/List"
	TrailService_Create_FullMethodName               = "/yandex.cloud.audittrails.v1.TrailService/Create"
	TrailService_Update_FullMethodName               = "/yandex.cloud.audittrails.v1.TrailService/Update"
	TrailService_Delete_FullMethodName               = "/yandex.cloud.audittrails.v1.TrailService/Delete"
	TrailService_ListOperations_FullMethodName       = "/yandex.cloud.audittrails.v1.TrailService/ListOperations"
	TrailService_ListAccessBindings_FullMethodName   = "/yandex.cloud.audittrails.v1.TrailService/ListAccessBindings"
	TrailService_SetAccessBindings_FullMethodName    = "/yandex.cloud.audittrails.v1.TrailService/SetAccessBindings"
	TrailService_UpdateAccessBindings_FullMethodName = "/yandex.cloud.audittrails.v1.TrailService/UpdateAccessBindings"
)

// TrailServiceClient is the client API for TrailService 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 trails.
type TrailServiceClient interface {
	// Returns the specified trail.
	// To get the list of all available trails, make a [List] request.
	Get(ctx context.Context, in *GetTrailRequest, opts ...grpc.CallOption) (*Trail, error)
	// Retrieves the list of trails in the specified folder.
	List(ctx context.Context, in *ListTrailsRequest, opts ...grpc.CallOption) (*ListTrailsResponse, error)
	// Creates a trail in the specified folder.
	Create(ctx context.Context, in *CreateTrailRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Updates the specified trail.
	Update(ctx context.Context, in *UpdateTrailRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Deletes the specified trail.
	Delete(ctx context.Context, in *DeleteTrailRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Lists operations for the specified trail.
	ListOperations(ctx context.Context, in *ListTrailOperationsRequest, opts ...grpc.CallOption) (*ListTrailOperationsResponse, error)
	// Lists existing access bindings for the specified trail.
	ListAccessBindings(ctx context.Context, in *access.ListAccessBindingsRequest, opts ...grpc.CallOption) (*access.ListAccessBindingsResponse, error)
	// Sets access bindings for the trail.
	SetAccessBindings(ctx context.Context, in *access.SetAccessBindingsRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Updates access bindings for the trail.
	UpdateAccessBindings(ctx context.Context, in *access.UpdateAccessBindingsRequest, opts ...grpc.CallOption) (*operation.Operation, error)
}

type trailServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewTrailServiceClient(cc grpc.ClientConnInterface) TrailServiceClient {
	return &trailServiceClient{cc}
}

func (c *trailServiceClient) Get(ctx context.Context, in *GetTrailRequest, opts ...grpc.CallOption) (*Trail, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(Trail)
	err := c.cc.Invoke(ctx, TrailService_Get_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *trailServiceClient) List(ctx context.Context, in *ListTrailsRequest, opts ...grpc.CallOption) (*ListTrailsResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ListTrailsResponse)
	err := c.cc.Invoke(ctx, TrailService_List_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

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

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

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

func (c *trailServiceClient) ListOperations(ctx context.Context, in *ListTrailOperationsRequest, opts ...grpc.CallOption) (*ListTrailOperationsResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ListTrailOperationsResponse)
	err := c.cc.Invoke(ctx, TrailService_ListOperations_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *trailServiceClient) ListAccessBindings(ctx context.Context, in *access.ListAccessBindingsRequest, opts ...grpc.CallOption) (*access.ListAccessBindingsResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(access.ListAccessBindingsResponse)
	err := c.cc.Invoke(ctx, TrailService_ListAccessBindings_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *trailServiceClient) SetAccessBindings(ctx context.Context, in *access.SetAccessBindingsRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(operation.Operation)
	err := c.cc.Invoke(ctx, TrailService_SetAccessBindings_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *trailServiceClient) UpdateAccessBindings(ctx context.Context, in *access.UpdateAccessBindingsRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(operation.Operation)
	err := c.cc.Invoke(ctx, TrailService_UpdateAccessBindings_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// TrailServiceServer is the server API for TrailService service.
// All implementations should embed UnimplementedTrailServiceServer
// for forward compatibility.
//
// A set of methods for managing trails.
type TrailServiceServer interface {
	// Returns the specified trail.
	// To get the list of all available trails, make a [List] request.
	Get(context.Context, *GetTrailRequest) (*Trail, error)
	// Retrieves the list of trails in the specified folder.
	List(context.Context, *ListTrailsRequest) (*ListTrailsResponse, error)
	// Creates a trail in the specified folder.
	Create(context.Context, *CreateTrailRequest) (*operation.Operation, error)
	// Updates the specified trail.
	Update(context.Context, *UpdateTrailRequest) (*operation.Operation, error)
	// Deletes the specified trail.
	Delete(context.Context, *DeleteTrailRequest) (*operation.Operation, error)
	// Lists operations for the specified trail.
	ListOperations(context.Context, *ListTrailOperationsRequest) (*ListTrailOperationsResponse, error)
	// Lists existing access bindings for the specified trail.
	ListAccessBindings(context.Context, *access.ListAccessBindingsRequest) (*access.ListAccessBindingsResponse, error)
	// Sets access bindings for the trail.
	SetAccessBindings(context.Context, *access.SetAccessBindingsRequest) (*operation.Operation, error)
	// Updates access bindings for the trail.
	UpdateAccessBindings(context.Context, *access.UpdateAccessBindingsRequest) (*operation.Operation, error)
}

// UnimplementedTrailServiceServer 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 UnimplementedTrailServiceServer struct{}

func (UnimplementedTrailServiceServer) Get(context.Context, *GetTrailRequest) (*Trail, error) {
	return nil, status.Error(codes.Unimplemented, "method Get not implemented")
}
func (UnimplementedTrailServiceServer) List(context.Context, *ListTrailsRequest) (*ListTrailsResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method List not implemented")
}
func (UnimplementedTrailServiceServer) Create(context.Context, *CreateTrailRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedTrailServiceServer) Update(context.Context, *UpdateTrailRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method Update not implemented")
}
func (UnimplementedTrailServiceServer) Delete(context.Context, *DeleteTrailRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedTrailServiceServer) ListOperations(context.Context, *ListTrailOperationsRequest) (*ListTrailOperationsResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method ListOperations not implemented")
}
func (UnimplementedTrailServiceServer) ListAccessBindings(context.Context, *access.ListAccessBindingsRequest) (*access.ListAccessBindingsResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method ListAccessBindings not implemented")
}
func (UnimplementedTrailServiceServer) SetAccessBindings(context.Context, *access.SetAccessBindingsRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method SetAccessBindings not implemented")
}
func (UnimplementedTrailServiceServer) UpdateAccessBindings(context.Context, *access.UpdateAccessBindingsRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method UpdateAccessBindings not implemented")
}
func (UnimplementedTrailServiceServer) testEmbeddedByValue() {}

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

func RegisterTrailServiceServer(s grpc.ServiceRegistrar, srv TrailServiceServer) {
	// If the following call panics, it indicates UnimplementedTrailServiceServer 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(&TrailService_ServiceDesc, srv)
}

func _TrailService_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetTrailRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(TrailServiceServer).Get(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: TrailService_Get_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(TrailServiceServer).Get(ctx, req.(*GetTrailRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _TrailService_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListTrailsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(TrailServiceServer).List(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: TrailService_List_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(TrailServiceServer).List(ctx, req.(*ListTrailsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _TrailService_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CreateTrailRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(TrailServiceServer).Create(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: TrailService_Create_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(TrailServiceServer).Create(ctx, req.(*CreateTrailRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _TrailService_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(UpdateTrailRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(TrailServiceServer).Update(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: TrailService_Update_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(TrailServiceServer).Update(ctx, req.(*UpdateTrailRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _TrailService_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DeleteTrailRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(TrailServiceServer).Delete(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: TrailService_Delete_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(TrailServiceServer).Delete(ctx, req.(*DeleteTrailRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _TrailService_ListOperations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListTrailOperationsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(TrailServiceServer).ListOperations(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: TrailService_ListOperations_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(TrailServiceServer).ListOperations(ctx, req.(*ListTrailOperationsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _TrailService_ListAccessBindings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(access.ListAccessBindingsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(TrailServiceServer).ListAccessBindings(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: TrailService_ListAccessBindings_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(TrailServiceServer).ListAccessBindings(ctx, req.(*access.ListAccessBindingsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _TrailService_SetAccessBindings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(access.SetAccessBindingsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(TrailServiceServer).SetAccessBindings(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: TrailService_SetAccessBindings_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(TrailServiceServer).SetAccessBindings(ctx, req.(*access.SetAccessBindingsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _TrailService_UpdateAccessBindings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(access.UpdateAccessBindingsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(TrailServiceServer).UpdateAccessBindings(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: TrailService_UpdateAccessBindings_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(TrailServiceServer).UpdateAccessBindings(ctx, req.(*access.UpdateAccessBindingsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// TrailService_ServiceDesc is the grpc.ServiceDesc for TrailService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var TrailService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "yandex.cloud.audittrails.v1.TrailService",
	HandlerType: (*TrailServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Get",
			Handler:    _TrailService_Get_Handler,
		},
		{
			MethodName: "List",
			Handler:    _TrailService_List_Handler,
		},
		{
			MethodName: "Create",
			Handler:    _TrailService_Create_Handler,
		},
		{
			MethodName: "Update",
			Handler:    _TrailService_Update_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _TrailService_Delete_Handler,
		},
		{
			MethodName: "ListOperations",
			Handler:    _TrailService_ListOperations_Handler,
		},
		{
			MethodName: "ListAccessBindings",
			Handler:    _TrailService_ListAccessBindings_Handler,
		},
		{
			MethodName: "SetAccessBindings",
			Handler:    _TrailService_SetAccessBindings_Handler,
		},
		{
			MethodName: "UpdateAccessBindings",
			Handler:    _TrailService_UpdateAccessBindings_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "yandex/cloud/audittrails/v1/trail_service.proto",
}
