// Copyright 2018 The Kubeflow 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.5.1
// - protoc             v6.31.1
// source: backend/api/v2beta1/experiment.proto

package go_client

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.64.0 or later.
const _ = grpc.SupportPackageIsVersion9

const (
	ExperimentService_CreateExperiment_FullMethodName    = "/kubeflow.pipelines.backend.api.v2beta1.ExperimentService/CreateExperiment"
	ExperimentService_GetExperiment_FullMethodName       = "/kubeflow.pipelines.backend.api.v2beta1.ExperimentService/GetExperiment"
	ExperimentService_ListExperiments_FullMethodName     = "/kubeflow.pipelines.backend.api.v2beta1.ExperimentService/ListExperiments"
	ExperimentService_ArchiveExperiment_FullMethodName   = "/kubeflow.pipelines.backend.api.v2beta1.ExperimentService/ArchiveExperiment"
	ExperimentService_UnarchiveExperiment_FullMethodName = "/kubeflow.pipelines.backend.api.v2beta1.ExperimentService/UnarchiveExperiment"
	ExperimentService_DeleteExperiment_FullMethodName    = "/kubeflow.pipelines.backend.api.v2beta1.ExperimentService/DeleteExperiment"
)

// ExperimentServiceClient is the client API for ExperimentService 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 ExperimentServiceClient interface {
	// Creates a new experiment.
	CreateExperiment(ctx context.Context, in *CreateExperimentRequest, opts ...grpc.CallOption) (*Experiment, error)
	// Finds a specific experiment by ID.
	GetExperiment(ctx context.Context, in *GetExperimentRequest, opts ...grpc.CallOption) (*Experiment, error)
	// Finds all experiments. Supports pagination, and sorting on certain fields.
	ListExperiments(ctx context.Context, in *ListExperimentsRequest, opts ...grpc.CallOption) (*ListExperimentsResponse, error)
	// Archives an experiment and the experiment's runs and recurring runs.
	ArchiveExperiment(ctx context.Context, in *ArchiveExperimentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// Restores an archived experiment. The experiment's archived runs and recurring
	// runs will stay archived.
	UnarchiveExperiment(ctx context.Context, in *UnarchiveExperimentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// Deletes an experiment without deleting the experiment's runs and recurring
	// runs. To avoid unexpected behaviors, delete an experiment's runs and recurring
	// runs before deleting the experiment.
	DeleteExperiment(ctx context.Context, in *DeleteExperimentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

type experimentServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewExperimentServiceClient(cc grpc.ClientConnInterface) ExperimentServiceClient {
	return &experimentServiceClient{cc}
}

func (c *experimentServiceClient) CreateExperiment(ctx context.Context, in *CreateExperimentRequest, opts ...grpc.CallOption) (*Experiment, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(Experiment)
	err := c.cc.Invoke(ctx, ExperimentService_CreateExperiment_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *experimentServiceClient) GetExperiment(ctx context.Context, in *GetExperimentRequest, opts ...grpc.CallOption) (*Experiment, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(Experiment)
	err := c.cc.Invoke(ctx, ExperimentService_GetExperiment_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *experimentServiceClient) ListExperiments(ctx context.Context, in *ListExperimentsRequest, opts ...grpc.CallOption) (*ListExperimentsResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ListExperimentsResponse)
	err := c.cc.Invoke(ctx, ExperimentService_ListExperiments_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

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

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

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

// ExperimentServiceServer is the server API for ExperimentService service.
// All implementations must embed UnimplementedExperimentServiceServer
// for forward compatibility.
type ExperimentServiceServer interface {
	// Creates a new experiment.
	CreateExperiment(context.Context, *CreateExperimentRequest) (*Experiment, error)
	// Finds a specific experiment by ID.
	GetExperiment(context.Context, *GetExperimentRequest) (*Experiment, error)
	// Finds all experiments. Supports pagination, and sorting on certain fields.
	ListExperiments(context.Context, *ListExperimentsRequest) (*ListExperimentsResponse, error)
	// Archives an experiment and the experiment's runs and recurring runs.
	ArchiveExperiment(context.Context, *ArchiveExperimentRequest) (*emptypb.Empty, error)
	// Restores an archived experiment. The experiment's archived runs and recurring
	// runs will stay archived.
	UnarchiveExperiment(context.Context, *UnarchiveExperimentRequest) (*emptypb.Empty, error)
	// Deletes an experiment without deleting the experiment's runs and recurring
	// runs. To avoid unexpected behaviors, delete an experiment's runs and recurring
	// runs before deleting the experiment.
	DeleteExperiment(context.Context, *DeleteExperimentRequest) (*emptypb.Empty, error)
	mustEmbedUnimplementedExperimentServiceServer()
}

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

func (UnimplementedExperimentServiceServer) CreateExperiment(context.Context, *CreateExperimentRequest) (*Experiment, error) {
	return nil, status.Errorf(codes.Unimplemented, "method CreateExperiment not implemented")
}
func (UnimplementedExperimentServiceServer) GetExperiment(context.Context, *GetExperimentRequest) (*Experiment, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetExperiment not implemented")
}
func (UnimplementedExperimentServiceServer) ListExperiments(context.Context, *ListExperimentsRequest) (*ListExperimentsResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ListExperiments not implemented")
}
func (UnimplementedExperimentServiceServer) ArchiveExperiment(context.Context, *ArchiveExperimentRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ArchiveExperiment not implemented")
}
func (UnimplementedExperimentServiceServer) UnarchiveExperiment(context.Context, *UnarchiveExperimentRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method UnarchiveExperiment not implemented")
}
func (UnimplementedExperimentServiceServer) DeleteExperiment(context.Context, *DeleteExperimentRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method DeleteExperiment not implemented")
}
func (UnimplementedExperimentServiceServer) mustEmbedUnimplementedExperimentServiceServer() {}
func (UnimplementedExperimentServiceServer) testEmbeddedByValue()                           {}

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

func RegisterExperimentServiceServer(s grpc.ServiceRegistrar, srv ExperimentServiceServer) {
	// If the following call pancis, it indicates UnimplementedExperimentServiceServer 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(&ExperimentService_ServiceDesc, srv)
}

func _ExperimentService_CreateExperiment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CreateExperimentRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ExperimentServiceServer).CreateExperiment(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ExperimentService_CreateExperiment_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ExperimentServiceServer).CreateExperiment(ctx, req.(*CreateExperimentRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _ExperimentService_GetExperiment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetExperimentRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ExperimentServiceServer).GetExperiment(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ExperimentService_GetExperiment_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ExperimentServiceServer).GetExperiment(ctx, req.(*GetExperimentRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _ExperimentService_ListExperiments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListExperimentsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ExperimentServiceServer).ListExperiments(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ExperimentService_ListExperiments_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ExperimentServiceServer).ListExperiments(ctx, req.(*ListExperimentsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _ExperimentService_ArchiveExperiment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ArchiveExperimentRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ExperimentServiceServer).ArchiveExperiment(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ExperimentService_ArchiveExperiment_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ExperimentServiceServer).ArchiveExperiment(ctx, req.(*ArchiveExperimentRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _ExperimentService_UnarchiveExperiment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(UnarchiveExperimentRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ExperimentServiceServer).UnarchiveExperiment(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ExperimentService_UnarchiveExperiment_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ExperimentServiceServer).UnarchiveExperiment(ctx, req.(*UnarchiveExperimentRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _ExperimentService_DeleteExperiment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DeleteExperimentRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ExperimentServiceServer).DeleteExperiment(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ExperimentService_DeleteExperiment_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ExperimentServiceServer).DeleteExperiment(ctx, req.(*DeleteExperimentRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// ExperimentService_ServiceDesc is the grpc.ServiceDesc for ExperimentService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ExperimentService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "kubeflow.pipelines.backend.api.v2beta1.ExperimentService",
	HandlerType: (*ExperimentServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateExperiment",
			Handler:    _ExperimentService_CreateExperiment_Handler,
		},
		{
			MethodName: "GetExperiment",
			Handler:    _ExperimentService_GetExperiment_Handler,
		},
		{
			MethodName: "ListExperiments",
			Handler:    _ExperimentService_ListExperiments_Handler,
		},
		{
			MethodName: "ArchiveExperiment",
			Handler:    _ExperimentService_ArchiveExperiment_Handler,
		},
		{
			MethodName: "UnarchiveExperiment",
			Handler:    _ExperimentService_UnarchiveExperiment_Handler,
		},
		{
			MethodName: "DeleteExperiment",
			Handler:    _ExperimentService_DeleteExperiment_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "backend/api/v2beta1/experiment.proto",
}
