// Copyright 2022 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/recurring_run.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 (
	RecurringRunService_CreateRecurringRun_FullMethodName  = "/kubeflow.pipelines.backend.api.v2beta1.RecurringRunService/CreateRecurringRun"
	RecurringRunService_GetRecurringRun_FullMethodName     = "/kubeflow.pipelines.backend.api.v2beta1.RecurringRunService/GetRecurringRun"
	RecurringRunService_ListRecurringRuns_FullMethodName   = "/kubeflow.pipelines.backend.api.v2beta1.RecurringRunService/ListRecurringRuns"
	RecurringRunService_EnableRecurringRun_FullMethodName  = "/kubeflow.pipelines.backend.api.v2beta1.RecurringRunService/EnableRecurringRun"
	RecurringRunService_DisableRecurringRun_FullMethodName = "/kubeflow.pipelines.backend.api.v2beta1.RecurringRunService/DisableRecurringRun"
	RecurringRunService_DeleteRecurringRun_FullMethodName  = "/kubeflow.pipelines.backend.api.v2beta1.RecurringRunService/DeleteRecurringRun"
)

// RecurringRunServiceClient is the client API for RecurringRunService 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 RecurringRunServiceClient interface {
	// Creates a new recurring run in an experiment, given the experiment ID.
	CreateRecurringRun(ctx context.Context, in *CreateRecurringRunRequest, opts ...grpc.CallOption) (*RecurringRun, error)
	// Finds a specific recurring run by ID.
	GetRecurringRun(ctx context.Context, in *GetRecurringRunRequest, opts ...grpc.CallOption) (*RecurringRun, error)
	// Finds all recurring runs given experiment and namespace.
	// If experiment ID is not specified, find all recurring runs across all experiments.
	ListRecurringRuns(ctx context.Context, in *ListRecurringRunsRequest, opts ...grpc.CallOption) (*ListRecurringRunsResponse, error)
	// Restarts a recurring run that was previously stopped. All runs associated with the
	// recurring run will continue.
	EnableRecurringRun(ctx context.Context, in *EnableRecurringRunRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// Stops a recurring run and all its associated runs. The recurring run is not deleted.
	DisableRecurringRun(ctx context.Context, in *DisableRecurringRunRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// Deletes a recurring run.
	DeleteRecurringRun(ctx context.Context, in *DeleteRecurringRunRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

type recurringRunServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewRecurringRunServiceClient(cc grpc.ClientConnInterface) RecurringRunServiceClient {
	return &recurringRunServiceClient{cc}
}

func (c *recurringRunServiceClient) CreateRecurringRun(ctx context.Context, in *CreateRecurringRunRequest, opts ...grpc.CallOption) (*RecurringRun, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(RecurringRun)
	err := c.cc.Invoke(ctx, RecurringRunService_CreateRecurringRun_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *recurringRunServiceClient) GetRecurringRun(ctx context.Context, in *GetRecurringRunRequest, opts ...grpc.CallOption) (*RecurringRun, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(RecurringRun)
	err := c.cc.Invoke(ctx, RecurringRunService_GetRecurringRun_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *recurringRunServiceClient) ListRecurringRuns(ctx context.Context, in *ListRecurringRunsRequest, opts ...grpc.CallOption) (*ListRecurringRunsResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ListRecurringRunsResponse)
	err := c.cc.Invoke(ctx, RecurringRunService_ListRecurringRuns_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

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

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

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

// RecurringRunServiceServer is the server API for RecurringRunService service.
// All implementations must embed UnimplementedRecurringRunServiceServer
// for forward compatibility.
type RecurringRunServiceServer interface {
	// Creates a new recurring run in an experiment, given the experiment ID.
	CreateRecurringRun(context.Context, *CreateRecurringRunRequest) (*RecurringRun, error)
	// Finds a specific recurring run by ID.
	GetRecurringRun(context.Context, *GetRecurringRunRequest) (*RecurringRun, error)
	// Finds all recurring runs given experiment and namespace.
	// If experiment ID is not specified, find all recurring runs across all experiments.
	ListRecurringRuns(context.Context, *ListRecurringRunsRequest) (*ListRecurringRunsResponse, error)
	// Restarts a recurring run that was previously stopped. All runs associated with the
	// recurring run will continue.
	EnableRecurringRun(context.Context, *EnableRecurringRunRequest) (*emptypb.Empty, error)
	// Stops a recurring run and all its associated runs. The recurring run is not deleted.
	DisableRecurringRun(context.Context, *DisableRecurringRunRequest) (*emptypb.Empty, error)
	// Deletes a recurring run.
	DeleteRecurringRun(context.Context, *DeleteRecurringRunRequest) (*emptypb.Empty, error)
	mustEmbedUnimplementedRecurringRunServiceServer()
}

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

func (UnimplementedRecurringRunServiceServer) CreateRecurringRun(context.Context, *CreateRecurringRunRequest) (*RecurringRun, error) {
	return nil, status.Errorf(codes.Unimplemented, "method CreateRecurringRun not implemented")
}
func (UnimplementedRecurringRunServiceServer) GetRecurringRun(context.Context, *GetRecurringRunRequest) (*RecurringRun, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetRecurringRun not implemented")
}
func (UnimplementedRecurringRunServiceServer) ListRecurringRuns(context.Context, *ListRecurringRunsRequest) (*ListRecurringRunsResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ListRecurringRuns not implemented")
}
func (UnimplementedRecurringRunServiceServer) EnableRecurringRun(context.Context, *EnableRecurringRunRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method EnableRecurringRun not implemented")
}
func (UnimplementedRecurringRunServiceServer) DisableRecurringRun(context.Context, *DisableRecurringRunRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method DisableRecurringRun not implemented")
}
func (UnimplementedRecurringRunServiceServer) DeleteRecurringRun(context.Context, *DeleteRecurringRunRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method DeleteRecurringRun not implemented")
}
func (UnimplementedRecurringRunServiceServer) mustEmbedUnimplementedRecurringRunServiceServer() {}
func (UnimplementedRecurringRunServiceServer) testEmbeddedByValue()                             {}

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

func RegisterRecurringRunServiceServer(s grpc.ServiceRegistrar, srv RecurringRunServiceServer) {
	// If the following call pancis, it indicates UnimplementedRecurringRunServiceServer 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(&RecurringRunService_ServiceDesc, srv)
}

func _RecurringRunService_CreateRecurringRun_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CreateRecurringRunRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RecurringRunServiceServer).CreateRecurringRun(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: RecurringRunService_CreateRecurringRun_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RecurringRunServiceServer).CreateRecurringRun(ctx, req.(*CreateRecurringRunRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _RecurringRunService_GetRecurringRun_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetRecurringRunRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RecurringRunServiceServer).GetRecurringRun(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: RecurringRunService_GetRecurringRun_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RecurringRunServiceServer).GetRecurringRun(ctx, req.(*GetRecurringRunRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _RecurringRunService_ListRecurringRuns_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListRecurringRunsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RecurringRunServiceServer).ListRecurringRuns(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: RecurringRunService_ListRecurringRuns_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RecurringRunServiceServer).ListRecurringRuns(ctx, req.(*ListRecurringRunsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _RecurringRunService_EnableRecurringRun_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(EnableRecurringRunRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RecurringRunServiceServer).EnableRecurringRun(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: RecurringRunService_EnableRecurringRun_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RecurringRunServiceServer).EnableRecurringRun(ctx, req.(*EnableRecurringRunRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _RecurringRunService_DisableRecurringRun_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DisableRecurringRunRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RecurringRunServiceServer).DisableRecurringRun(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: RecurringRunService_DisableRecurringRun_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RecurringRunServiceServer).DisableRecurringRun(ctx, req.(*DisableRecurringRunRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _RecurringRunService_DeleteRecurringRun_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DeleteRecurringRunRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RecurringRunServiceServer).DeleteRecurringRun(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: RecurringRunService_DeleteRecurringRun_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RecurringRunServiceServer).DeleteRecurringRun(ctx, req.(*DeleteRecurringRunRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// RecurringRunService_ServiceDesc is the grpc.ServiceDesc for RecurringRunService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var RecurringRunService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "kubeflow.pipelines.backend.api.v2beta1.RecurringRunService",
	HandlerType: (*RecurringRunServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateRecurringRun",
			Handler:    _RecurringRunService_CreateRecurringRun_Handler,
		},
		{
			MethodName: "GetRecurringRun",
			Handler:    _RecurringRunService_GetRecurringRun_Handler,
		},
		{
			MethodName: "ListRecurringRuns",
			Handler:    _RecurringRunService_ListRecurringRuns_Handler,
		},
		{
			MethodName: "EnableRecurringRun",
			Handler:    _RecurringRunService_EnableRecurringRun_Handler,
		},
		{
			MethodName: "DisableRecurringRun",
			Handler:    _RecurringRunService_DisableRecurringRun_Handler,
		},
		{
			MethodName: "DeleteRecurringRun",
			Handler:    _RecurringRunService_DeleteRecurringRun_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "backend/api/v2beta1/recurring_run.proto",
}
