// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc             v6.30.2
// source: proto/postgres.proto

package postgres

import (
	context "context"
	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 (
	Postgres_GetCapabilities_FullMethodName     = "/cnpgi.identity.v1.Postgres/GetCapabilities"
	Postgres_EnrichConfiguration_FullMethodName = "/cnpgi.identity.v1.Postgres/EnrichConfiguration"
)

// PostgresClient is the client API for Postgres 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.
type PostgresClient interface {
	// GetCapabilities gets the capabilities of the Backup service
	GetCapabilities(ctx context.Context, in *PostgresCapabilitiesRequest, opts ...grpc.CallOption) (*PostgresCapabilitiesResult, error)
	// EnrichConfiguration is called before applying the configuration
	// to PostgreSQL
	EnrichConfiguration(ctx context.Context, in *EnrichConfigurationRequest, opts ...grpc.CallOption) (*EnrichConfigurationResult, error)
}

type postgresClient struct {
	cc grpc.ClientConnInterface
}

func NewPostgresClient(cc grpc.ClientConnInterface) PostgresClient {
	return &postgresClient{cc}
}

func (c *postgresClient) GetCapabilities(ctx context.Context, in *PostgresCapabilitiesRequest, opts ...grpc.CallOption) (*PostgresCapabilitiesResult, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(PostgresCapabilitiesResult)
	err := c.cc.Invoke(ctx, Postgres_GetCapabilities_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *postgresClient) EnrichConfiguration(ctx context.Context, in *EnrichConfigurationRequest, opts ...grpc.CallOption) (*EnrichConfigurationResult, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(EnrichConfigurationResult)
	err := c.cc.Invoke(ctx, Postgres_EnrichConfiguration_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// PostgresServer is the server API for Postgres service.
// All implementations must embed UnimplementedPostgresServer
// for forward compatibility.
type PostgresServer interface {
	// GetCapabilities gets the capabilities of the Backup service
	GetCapabilities(context.Context, *PostgresCapabilitiesRequest) (*PostgresCapabilitiesResult, error)
	// EnrichConfiguration is called before applying the configuration
	// to PostgreSQL
	EnrichConfiguration(context.Context, *EnrichConfigurationRequest) (*EnrichConfigurationResult, error)
	mustEmbedUnimplementedPostgresServer()
}

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

func (UnimplementedPostgresServer) GetCapabilities(context.Context, *PostgresCapabilitiesRequest) (*PostgresCapabilitiesResult, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetCapabilities not implemented")
}
func (UnimplementedPostgresServer) EnrichConfiguration(context.Context, *EnrichConfigurationRequest) (*EnrichConfigurationResult, error) {
	return nil, status.Errorf(codes.Unimplemented, "method EnrichConfiguration not implemented")
}
func (UnimplementedPostgresServer) mustEmbedUnimplementedPostgresServer() {}
func (UnimplementedPostgresServer) testEmbeddedByValue()                  {}

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

func RegisterPostgresServer(s grpc.ServiceRegistrar, srv PostgresServer) {
	// If the following call pancis, it indicates UnimplementedPostgresServer 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(&Postgres_ServiceDesc, srv)
}

func _Postgres_GetCapabilities_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(PostgresCapabilitiesRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PostgresServer).GetCapabilities(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Postgres_GetCapabilities_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PostgresServer).GetCapabilities(ctx, req.(*PostgresCapabilitiesRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Postgres_EnrichConfiguration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(EnrichConfigurationRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PostgresServer).EnrichConfiguration(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Postgres_EnrichConfiguration_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PostgresServer).EnrichConfiguration(ctx, req.(*EnrichConfigurationRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// Postgres_ServiceDesc is the grpc.ServiceDesc for Postgres service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Postgres_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "cnpgi.identity.v1.Postgres",
	HandlerType: (*PostgresServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetCapabilities",
			Handler:    _Postgres_GetCapabilities_Handler,
		},
		{
			MethodName: "EnrichConfiguration",
			Handler:    _Postgres_EnrichConfiguration_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "proto/postgres.proto",
}
