// Copyright 2020-2021 Buf Technologies, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.

package registryv1alpha1

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

// RepositoryCommitServiceClient is the client API for RepositoryCommitService 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 RepositoryCommitServiceClient interface {
	// ListRepositoryCommits lists the repository commits associated with a repository branch.
	ListRepositoryCommits(ctx context.Context, in *ListRepositoryCommitsRequest, opts ...grpc.CallOption) (*ListRepositoryCommitsResponse, error)
}

type repositoryCommitServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewRepositoryCommitServiceClient(cc grpc.ClientConnInterface) RepositoryCommitServiceClient {
	return &repositoryCommitServiceClient{cc}
}

func (c *repositoryCommitServiceClient) ListRepositoryCommits(ctx context.Context, in *ListRepositoryCommitsRequest, opts ...grpc.CallOption) (*ListRepositoryCommitsResponse, error) {
	out := new(ListRepositoryCommitsResponse)
	err := c.cc.Invoke(ctx, "/buf.alpha.registry.v1alpha1.RepositoryCommitService/ListRepositoryCommits", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// RepositoryCommitServiceServer is the server API for RepositoryCommitService service.
// All implementations should embed UnimplementedRepositoryCommitServiceServer
// for forward compatibility
type RepositoryCommitServiceServer interface {
	// ListRepositoryCommits lists the repository commits associated with a repository branch.
	ListRepositoryCommits(context.Context, *ListRepositoryCommitsRequest) (*ListRepositoryCommitsResponse, error)
}

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

func (UnimplementedRepositoryCommitServiceServer) ListRepositoryCommits(context.Context, *ListRepositoryCommitsRequest) (*ListRepositoryCommitsResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ListRepositoryCommits not implemented")
}

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

func RegisterRepositoryCommitServiceServer(s grpc.ServiceRegistrar, srv RepositoryCommitServiceServer) {
	s.RegisterService(&RepositoryCommitService_ServiceDesc, srv)
}

func _RepositoryCommitService_ListRepositoryCommits_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListRepositoryCommitsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RepositoryCommitServiceServer).ListRepositoryCommits(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/buf.alpha.registry.v1alpha1.RepositoryCommitService/ListRepositoryCommits",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RepositoryCommitServiceServer).ListRepositoryCommits(ctx, req.(*ListRepositoryCommitsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// RepositoryCommitService_ServiceDesc is the grpc.ServiceDesc for RepositoryCommitService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var RepositoryCommitService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "buf.alpha.registry.v1alpha1.RepositoryCommitService",
	HandlerType: (*RepositoryCommitServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ListRepositoryCommits",
			Handler:    _RepositoryCommitService_ListRepositoryCommits_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "buf/alpha/registry/v1alpha1/repository_commit.proto",
}
