// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc             (unknown)
// source: url_shortener/url_shortener.proto

package url_shortener

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.32.0 or later.
const _ = grpc.SupportPackageIsVersion7

// UrlShortenerServiceClient is the client API for UrlShortenerService 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 UrlShortenerServiceClient interface {
	CreateShortURL(ctx context.Context, in *CreateShortURLRequest, opts ...grpc.CallOption) (*CreateShortURLResponse, error)
	GetDestinationURLFromShortURL(ctx context.Context, in *GetDestinationURLFromShortURLRequest, opts ...grpc.CallOption) (*GetDestinationURLFromShortURLResponse, error)
}

type urlShortenerServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewUrlShortenerServiceClient(cc grpc.ClientConnInterface) UrlShortenerServiceClient {
	return &urlShortenerServiceClient{cc}
}

func (c *urlShortenerServiceClient) CreateShortURL(ctx context.Context, in *CreateShortURLRequest, opts ...grpc.CallOption) (*CreateShortURLResponse, error) {
	out := new(CreateShortURLResponse)
	err := c.cc.Invoke(ctx, "/url_shortener.UrlShortenerService/CreateShortURL", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *urlShortenerServiceClient) GetDestinationURLFromShortURL(ctx context.Context, in *GetDestinationURLFromShortURLRequest, opts ...grpc.CallOption) (*GetDestinationURLFromShortURLResponse, error) {
	out := new(GetDestinationURLFromShortURLResponse)
	err := c.cc.Invoke(ctx, "/url_shortener.UrlShortenerService/GetDestinationURLFromShortURL", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// UrlShortenerServiceServer is the server API for UrlShortenerService service.
// All implementations should embed UnimplementedUrlShortenerServiceServer
// for forward compatibility
type UrlShortenerServiceServer interface {
	CreateShortURL(context.Context, *CreateShortURLRequest) (*CreateShortURLResponse, error)
	GetDestinationURLFromShortURL(context.Context, *GetDestinationURLFromShortURLRequest) (*GetDestinationURLFromShortURLResponse, error)
}

// UnimplementedUrlShortenerServiceServer should be embedded to have forward compatible implementations.
type UnimplementedUrlShortenerServiceServer struct {
}

func (UnimplementedUrlShortenerServiceServer) CreateShortURL(context.Context, *CreateShortURLRequest) (*CreateShortURLResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method CreateShortURL not implemented")
}
func (UnimplementedUrlShortenerServiceServer) GetDestinationURLFromShortURL(context.Context, *GetDestinationURLFromShortURLRequest) (*GetDestinationURLFromShortURLResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetDestinationURLFromShortURL not implemented")
}

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

func RegisterUrlShortenerServiceServer(s grpc.ServiceRegistrar, srv UrlShortenerServiceServer) {
	s.RegisterService(&UrlShortenerService_ServiceDesc, srv)
}

func _UrlShortenerService_CreateShortURL_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CreateShortURLRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(UrlShortenerServiceServer).CreateShortURL(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/url_shortener.UrlShortenerService/CreateShortURL",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(UrlShortenerServiceServer).CreateShortURL(ctx, req.(*CreateShortURLRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _UrlShortenerService_GetDestinationURLFromShortURL_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetDestinationURLFromShortURLRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(UrlShortenerServiceServer).GetDestinationURLFromShortURL(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/url_shortener.UrlShortenerService/GetDestinationURLFromShortURL",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(UrlShortenerServiceServer).GetDestinationURLFromShortURL(ctx, req.(*GetDestinationURLFromShortURLRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// UrlShortenerService_ServiceDesc is the grpc.ServiceDesc for UrlShortenerService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var UrlShortenerService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "url_shortener.UrlShortenerService",
	HandlerType: (*UrlShortenerServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateShortURL",
			Handler:    _UrlShortenerService_CreateShortURL_Handler,
		},
		{
			MethodName: "GetDestinationURLFromShortURL",
			Handler:    _UrlShortenerService_GetDestinationURLFromShortURL_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "url_shortener/url_shortener.proto",
}
