// (-- api-linter: core::0191::proto-package=disabled
//     aip.dev/not-precedent: We need to do this because we don't want to change package now. --)

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

package v1beta

import (
	context "context"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
	emptypb "google.golang.org/protobuf/types/known/emptypb"
)

// 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.62.0 or later.
const _ = grpc.SupportPackageIsVersion8

const (
	BranchService_ListBranches_FullMethodName = "/v1beta.BranchService/ListBranches"
	BranchService_CreateBranch_FullMethodName = "/v1beta.BranchService/CreateBranch"
	BranchService_GetBranch_FullMethodName    = "/v1beta.BranchService/GetBranch"
	BranchService_DeleteBranch_FullMethodName = "/v1beta.BranchService/DeleteBranch"
)

// BranchServiceClient is the client API for BranchService 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.
//
// BranchService is the service for managing branches.
type BranchServiceClient interface {
	// (-- api-linter: core::0127::resource-name-extraction=disabled
	//
	//	aip.dev/not-precedent: We need to do this because we don't use name. --)
	//
	// ListBranches lists all branches in the cluster.
	ListBranches(ctx context.Context, in *ListBranchesRequest, opts ...grpc.CallOption) (*ListBranchesResp, error)
	// (-- api-linter: core::0133::http-uri-parent=disabled
	//
	//	aip.dev/not-precedent: We need to do this because we don't use parent. --)
	//
	// (-- api-linter: core::0133::response-message-name=disabled
	//
	//	aip.dev/not-precedent: We need to do this because we want to return id only. --)
	//
	// (-- api-linter: core::0127::resource-name-extraction=disabled
	//
	//	aip.dev/not-precedent: We need to do this because we don't use name. --)
	//
	// CreateBranch creates a branch.
	CreateBranch(ctx context.Context, in *CreateBranchRequest, opts ...grpc.CallOption) (*CreateBranchResp, error)
	// (-- api-linter: core::0131::http-uri-name=disabled
	//
	//	aip.dev/not-precedent: We need to do this because we don't use name. --)
	//
	// (-- api-linter: core::0127::resource-name-extraction=disabled
	//
	//	aip.dev/not-precedent: We need to do this because we don't use name. --)
	//
	// GetBranch gets a branch.
	GetBranch(ctx context.Context, in *GetBranchRequest, opts ...grpc.CallOption) (*Branch, error)
	// (-- api-linter: core::0135::method-signature=disabled
	//
	//	aip.dev/not-precedent: We need to do this because we don't use name. --)
	//
	// (-- api-linter: core::0127::resource-name-extraction=disabled
	//
	//	aip.dev/not-precedent: We need to do this because we don't use name. --)
	//
	// DeleteBranch deletes a branch.
	DeleteBranch(ctx context.Context, in *DeleteBranchRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

type branchServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewBranchServiceClient(cc grpc.ClientConnInterface) BranchServiceClient {
	return &branchServiceClient{cc}
}

func (c *branchServiceClient) ListBranches(ctx context.Context, in *ListBranchesRequest, opts ...grpc.CallOption) (*ListBranchesResp, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ListBranchesResp)
	err := c.cc.Invoke(ctx, BranchService_ListBranches_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *branchServiceClient) CreateBranch(ctx context.Context, in *CreateBranchRequest, opts ...grpc.CallOption) (*CreateBranchResp, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(CreateBranchResp)
	err := c.cc.Invoke(ctx, BranchService_CreateBranch_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *branchServiceClient) GetBranch(ctx context.Context, in *GetBranchRequest, opts ...grpc.CallOption) (*Branch, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(Branch)
	err := c.cc.Invoke(ctx, BranchService_GetBranch_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *branchServiceClient) DeleteBranch(ctx context.Context, in *DeleteBranchRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, BranchService_DeleteBranch_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// BranchServiceServer is the server API for BranchService service.
// All implementations must embed UnimplementedBranchServiceServer
// for forward compatibility
//
// BranchService is the service for managing branches.
type BranchServiceServer interface {
	// (-- api-linter: core::0127::resource-name-extraction=disabled
	//
	//	aip.dev/not-precedent: We need to do this because we don't use name. --)
	//
	// ListBranches lists all branches in the cluster.
	ListBranches(context.Context, *ListBranchesRequest) (*ListBranchesResp, error)
	// (-- api-linter: core::0133::http-uri-parent=disabled
	//
	//	aip.dev/not-precedent: We need to do this because we don't use parent. --)
	//
	// (-- api-linter: core::0133::response-message-name=disabled
	//
	//	aip.dev/not-precedent: We need to do this because we want to return id only. --)
	//
	// (-- api-linter: core::0127::resource-name-extraction=disabled
	//
	//	aip.dev/not-precedent: We need to do this because we don't use name. --)
	//
	// CreateBranch creates a branch.
	CreateBranch(context.Context, *CreateBranchRequest) (*CreateBranchResp, error)
	// (-- api-linter: core::0131::http-uri-name=disabled
	//
	//	aip.dev/not-precedent: We need to do this because we don't use name. --)
	//
	// (-- api-linter: core::0127::resource-name-extraction=disabled
	//
	//	aip.dev/not-precedent: We need to do this because we don't use name. --)
	//
	// GetBranch gets a branch.
	GetBranch(context.Context, *GetBranchRequest) (*Branch, error)
	// (-- api-linter: core::0135::method-signature=disabled
	//
	//	aip.dev/not-precedent: We need to do this because we don't use name. --)
	//
	// (-- api-linter: core::0127::resource-name-extraction=disabled
	//
	//	aip.dev/not-precedent: We need to do this because we don't use name. --)
	//
	// DeleteBranch deletes a branch.
	DeleteBranch(context.Context, *DeleteBranchRequest) (*emptypb.Empty, error)
	mustEmbedUnimplementedBranchServiceServer()
}

// UnimplementedBranchServiceServer must be embedded to have forward compatible implementations.
type UnimplementedBranchServiceServer struct {
}

func (UnimplementedBranchServiceServer) ListBranches(context.Context, *ListBranchesRequest) (*ListBranchesResp, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ListBranches not implemented")
}
func (UnimplementedBranchServiceServer) CreateBranch(context.Context, *CreateBranchRequest) (*CreateBranchResp, error) {
	return nil, status.Errorf(codes.Unimplemented, "method CreateBranch not implemented")
}
func (UnimplementedBranchServiceServer) GetBranch(context.Context, *GetBranchRequest) (*Branch, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetBranch not implemented")
}
func (UnimplementedBranchServiceServer) DeleteBranch(context.Context, *DeleteBranchRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method DeleteBranch not implemented")
}
func (UnimplementedBranchServiceServer) mustEmbedUnimplementedBranchServiceServer() {}

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

func RegisterBranchServiceServer(s grpc.ServiceRegistrar, srv BranchServiceServer) {
	s.RegisterService(&BranchService_ServiceDesc, srv)
}

func _BranchService_ListBranches_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListBranchesRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(BranchServiceServer).ListBranches(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: BranchService_ListBranches_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(BranchServiceServer).ListBranches(ctx, req.(*ListBranchesRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _BranchService_CreateBranch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CreateBranchRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(BranchServiceServer).CreateBranch(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: BranchService_CreateBranch_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(BranchServiceServer).CreateBranch(ctx, req.(*CreateBranchRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _BranchService_GetBranch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetBranchRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(BranchServiceServer).GetBranch(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: BranchService_GetBranch_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(BranchServiceServer).GetBranch(ctx, req.(*GetBranchRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _BranchService_DeleteBranch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DeleteBranchRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(BranchServiceServer).DeleteBranch(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: BranchService_DeleteBranch_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(BranchServiceServer).DeleteBranch(ctx, req.(*DeleteBranchRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// BranchService_ServiceDesc is the grpc.ServiceDesc for BranchService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var BranchService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "v1beta.BranchService",
	HandlerType: (*BranchServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ListBranches",
			Handler:    _BranchService_ListBranches_Handler,
		},
		{
			MethodName: "CreateBranch",
			Handler:    _BranchService_CreateBranch_Handler,
		},
		{
			MethodName: "GetBranch",
			Handler:    _BranchService_GetBranch_Handler,
		},
		{
			MethodName: "DeleteBranch",
			Handler:    _BranchService_DeleteBranch_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "v1beta/branch.proto",
}
