// Copyright 2025 Antrea Authors
//
// 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.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc             v5.26.0
// source: pkg/apis/flow/v1alpha1/service.proto

package v1alpha1

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

const (
	FlowExportService_Export_FullMethodName = "/antrea_io.antrea.pkg.apis.flow.v1alpha1.FlowExportService/Export"
)

// FlowExportServiceClient is the client API for FlowExportService 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 FlowExportServiceClient interface {
	Export(ctx context.Context, opts ...grpc.CallOption) (FlowExportService_ExportClient, error)
}

type flowExportServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewFlowExportServiceClient(cc grpc.ClientConnInterface) FlowExportServiceClient {
	return &flowExportServiceClient{cc}
}

func (c *flowExportServiceClient) Export(ctx context.Context, opts ...grpc.CallOption) (FlowExportService_ExportClient, error) {
	stream, err := c.cc.NewStream(ctx, &FlowExportService_ServiceDesc.Streams[0], FlowExportService_Export_FullMethodName, opts...)
	if err != nil {
		return nil, err
	}
	x := &flowExportServiceExportClient{stream}
	return x, nil
}

type FlowExportService_ExportClient interface {
	Send(*ExportRequest) error
	CloseAndRecv() (*ExportResponse, error)
	grpc.ClientStream
}

type flowExportServiceExportClient struct {
	grpc.ClientStream
}

func (x *flowExportServiceExportClient) Send(m *ExportRequest) error {
	return x.ClientStream.SendMsg(m)
}

func (x *flowExportServiceExportClient) CloseAndRecv() (*ExportResponse, error) {
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	m := new(ExportResponse)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

// FlowExportServiceServer is the server API for FlowExportService service.
// All implementations must embed UnimplementedFlowExportServiceServer
// for forward compatibility
type FlowExportServiceServer interface {
	Export(FlowExportService_ExportServer) error
	mustEmbedUnimplementedFlowExportServiceServer()
}

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

func (UnimplementedFlowExportServiceServer) Export(FlowExportService_ExportServer) error {
	return status.Errorf(codes.Unimplemented, "method Export not implemented")
}
func (UnimplementedFlowExportServiceServer) mustEmbedUnimplementedFlowExportServiceServer() {}

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

func RegisterFlowExportServiceServer(s grpc.ServiceRegistrar, srv FlowExportServiceServer) {
	s.RegisterService(&FlowExportService_ServiceDesc, srv)
}

func _FlowExportService_Export_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(FlowExportServiceServer).Export(&flowExportServiceExportServer{stream})
}

type FlowExportService_ExportServer interface {
	SendAndClose(*ExportResponse) error
	Recv() (*ExportRequest, error)
	grpc.ServerStream
}

type flowExportServiceExportServer struct {
	grpc.ServerStream
}

func (x *flowExportServiceExportServer) SendAndClose(m *ExportResponse) error {
	return x.ServerStream.SendMsg(m)
}

func (x *flowExportServiceExportServer) Recv() (*ExportRequest, error) {
	m := new(ExportRequest)
	if err := x.ServerStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

// FlowExportService_ServiceDesc is the grpc.ServiceDesc for FlowExportService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var FlowExportService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "antrea_io.antrea.pkg.apis.flow.v1alpha1.FlowExportService",
	HandlerType: (*FlowExportServiceServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Export",
			Handler:       _FlowExportService_Export_Handler,
			ClientStreams: true,
		},
	},
	Metadata: "pkg/apis/flow/v1alpha1/service.proto",
}
