// 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/v1beta1/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 (
	RunService_CreateRunV1_FullMethodName        = "/api.RunService/CreateRunV1"
	RunService_GetRunV1_FullMethodName           = "/api.RunService/GetRunV1"
	RunService_ListRunsV1_FullMethodName         = "/api.RunService/ListRunsV1"
	RunService_ArchiveRunV1_FullMethodName       = "/api.RunService/ArchiveRunV1"
	RunService_UnarchiveRunV1_FullMethodName     = "/api.RunService/UnarchiveRunV1"
	RunService_DeleteRunV1_FullMethodName        = "/api.RunService/DeleteRunV1"
	RunService_ReportRunMetricsV1_FullMethodName = "/api.RunService/ReportRunMetricsV1"
	RunService_ReadArtifactV1_FullMethodName     = "/api.RunService/ReadArtifactV1"
	RunService_TerminateRunV1_FullMethodName     = "/api.RunService/TerminateRunV1"
	RunService_RetryRunV1_FullMethodName         = "/api.RunService/RetryRunV1"
)

// RunServiceClient is the client API for RunService 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 RunServiceClient interface {
	// Creates a new run.
	CreateRunV1(ctx context.Context, in *CreateRunRequest, opts ...grpc.CallOption) (*RunDetail, error)
	// Finds a specific run by ID.
	GetRunV1(ctx context.Context, in *GetRunRequest, opts ...grpc.CallOption) (*RunDetail, error)
	// Finds all runs.
	ListRunsV1(ctx context.Context, in *ListRunsRequest, opts ...grpc.CallOption) (*ListRunsResponse, error)
	// Archives a run.
	ArchiveRunV1(ctx context.Context, in *ArchiveRunRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// Restores an archived run.
	UnarchiveRunV1(ctx context.Context, in *UnarchiveRunRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// Deletes a run.
	DeleteRunV1(ctx context.Context, in *DeleteRunRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// ReportRunMetrics reports metrics of a run. Each metric is reported in its
	// own transaction, so this API accepts partial failures. Metric can be
	// uniquely identified by (run_id, node_id, name). Duplicate reporting will be
	// ignored by the API. First reporting wins.
	ReportRunMetricsV1(ctx context.Context, in *ReportRunMetricsRequest, opts ...grpc.CallOption) (*ReportRunMetricsResponse, error)
	// Finds a run's artifact data.
	ReadArtifactV1(ctx context.Context, in *ReadArtifactRequest, opts ...grpc.CallOption) (*ReadArtifactResponse, error)
	// Terminates an active run.
	TerminateRunV1(ctx context.Context, in *TerminateRunRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// Re-initiates a failed or terminated run.
	RetryRunV1(ctx context.Context, in *RetryRunRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

type runServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewRunServiceClient(cc grpc.ClientConnInterface) RunServiceClient {
	return &runServiceClient{cc}
}

func (c *runServiceClient) CreateRunV1(ctx context.Context, in *CreateRunRequest, opts ...grpc.CallOption) (*RunDetail, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(RunDetail)
	err := c.cc.Invoke(ctx, RunService_CreateRunV1_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *runServiceClient) GetRunV1(ctx context.Context, in *GetRunRequest, opts ...grpc.CallOption) (*RunDetail, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(RunDetail)
	err := c.cc.Invoke(ctx, RunService_GetRunV1_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *runServiceClient) ListRunsV1(ctx context.Context, in *ListRunsRequest, opts ...grpc.CallOption) (*ListRunsResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ListRunsResponse)
	err := c.cc.Invoke(ctx, RunService_ListRunsV1_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

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

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

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

func (c *runServiceClient) ReportRunMetricsV1(ctx context.Context, in *ReportRunMetricsRequest, opts ...grpc.CallOption) (*ReportRunMetricsResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ReportRunMetricsResponse)
	err := c.cc.Invoke(ctx, RunService_ReportRunMetricsV1_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *runServiceClient) ReadArtifactV1(ctx context.Context, in *ReadArtifactRequest, opts ...grpc.CallOption) (*ReadArtifactResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ReadArtifactResponse)
	err := c.cc.Invoke(ctx, RunService_ReadArtifactV1_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

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

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

// RunServiceServer is the server API for RunService service.
// All implementations must embed UnimplementedRunServiceServer
// for forward compatibility.
type RunServiceServer interface {
	// Creates a new run.
	CreateRunV1(context.Context, *CreateRunRequest) (*RunDetail, error)
	// Finds a specific run by ID.
	GetRunV1(context.Context, *GetRunRequest) (*RunDetail, error)
	// Finds all runs.
	ListRunsV1(context.Context, *ListRunsRequest) (*ListRunsResponse, error)
	// Archives a run.
	ArchiveRunV1(context.Context, *ArchiveRunRequest) (*emptypb.Empty, error)
	// Restores an archived run.
	UnarchiveRunV1(context.Context, *UnarchiveRunRequest) (*emptypb.Empty, error)
	// Deletes a run.
	DeleteRunV1(context.Context, *DeleteRunRequest) (*emptypb.Empty, error)
	// ReportRunMetrics reports metrics of a run. Each metric is reported in its
	// own transaction, so this API accepts partial failures. Metric can be
	// uniquely identified by (run_id, node_id, name). Duplicate reporting will be
	// ignored by the API. First reporting wins.
	ReportRunMetricsV1(context.Context, *ReportRunMetricsRequest) (*ReportRunMetricsResponse, error)
	// Finds a run's artifact data.
	ReadArtifactV1(context.Context, *ReadArtifactRequest) (*ReadArtifactResponse, error)
	// Terminates an active run.
	TerminateRunV1(context.Context, *TerminateRunRequest) (*emptypb.Empty, error)
	// Re-initiates a failed or terminated run.
	RetryRunV1(context.Context, *RetryRunRequest) (*emptypb.Empty, error)
	mustEmbedUnimplementedRunServiceServer()
}

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

func (UnimplementedRunServiceServer) CreateRunV1(context.Context, *CreateRunRequest) (*RunDetail, error) {
	return nil, status.Errorf(codes.Unimplemented, "method CreateRunV1 not implemented")
}
func (UnimplementedRunServiceServer) GetRunV1(context.Context, *GetRunRequest) (*RunDetail, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetRunV1 not implemented")
}
func (UnimplementedRunServiceServer) ListRunsV1(context.Context, *ListRunsRequest) (*ListRunsResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ListRunsV1 not implemented")
}
func (UnimplementedRunServiceServer) ArchiveRunV1(context.Context, *ArchiveRunRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ArchiveRunV1 not implemented")
}
func (UnimplementedRunServiceServer) UnarchiveRunV1(context.Context, *UnarchiveRunRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method UnarchiveRunV1 not implemented")
}
func (UnimplementedRunServiceServer) DeleteRunV1(context.Context, *DeleteRunRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method DeleteRunV1 not implemented")
}
func (UnimplementedRunServiceServer) ReportRunMetricsV1(context.Context, *ReportRunMetricsRequest) (*ReportRunMetricsResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ReportRunMetricsV1 not implemented")
}
func (UnimplementedRunServiceServer) ReadArtifactV1(context.Context, *ReadArtifactRequest) (*ReadArtifactResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ReadArtifactV1 not implemented")
}
func (UnimplementedRunServiceServer) TerminateRunV1(context.Context, *TerminateRunRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method TerminateRunV1 not implemented")
}
func (UnimplementedRunServiceServer) RetryRunV1(context.Context, *RetryRunRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method RetryRunV1 not implemented")
}
func (UnimplementedRunServiceServer) mustEmbedUnimplementedRunServiceServer() {}
func (UnimplementedRunServiceServer) testEmbeddedByValue()                    {}

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

func RegisterRunServiceServer(s grpc.ServiceRegistrar, srv RunServiceServer) {
	// If the following call pancis, it indicates UnimplementedRunServiceServer 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(&RunService_ServiceDesc, srv)
}

func _RunService_CreateRunV1_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CreateRunRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RunServiceServer).CreateRunV1(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: RunService_CreateRunV1_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RunServiceServer).CreateRunV1(ctx, req.(*CreateRunRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _RunService_GetRunV1_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetRunRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RunServiceServer).GetRunV1(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: RunService_GetRunV1_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RunServiceServer).GetRunV1(ctx, req.(*GetRunRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _RunService_ListRunsV1_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListRunsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RunServiceServer).ListRunsV1(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: RunService_ListRunsV1_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RunServiceServer).ListRunsV1(ctx, req.(*ListRunsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _RunService_ArchiveRunV1_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ArchiveRunRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RunServiceServer).ArchiveRunV1(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: RunService_ArchiveRunV1_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RunServiceServer).ArchiveRunV1(ctx, req.(*ArchiveRunRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _RunService_UnarchiveRunV1_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(UnarchiveRunRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RunServiceServer).UnarchiveRunV1(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: RunService_UnarchiveRunV1_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RunServiceServer).UnarchiveRunV1(ctx, req.(*UnarchiveRunRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _RunService_DeleteRunV1_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DeleteRunRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RunServiceServer).DeleteRunV1(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: RunService_DeleteRunV1_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RunServiceServer).DeleteRunV1(ctx, req.(*DeleteRunRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _RunService_ReportRunMetricsV1_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ReportRunMetricsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RunServiceServer).ReportRunMetricsV1(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: RunService_ReportRunMetricsV1_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RunServiceServer).ReportRunMetricsV1(ctx, req.(*ReportRunMetricsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _RunService_ReadArtifactV1_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ReadArtifactRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RunServiceServer).ReadArtifactV1(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: RunService_ReadArtifactV1_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RunServiceServer).ReadArtifactV1(ctx, req.(*ReadArtifactRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _RunService_TerminateRunV1_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(TerminateRunRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RunServiceServer).TerminateRunV1(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: RunService_TerminateRunV1_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RunServiceServer).TerminateRunV1(ctx, req.(*TerminateRunRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _RunService_RetryRunV1_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(RetryRunRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RunServiceServer).RetryRunV1(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: RunService_RetryRunV1_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RunServiceServer).RetryRunV1(ctx, req.(*RetryRunRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// RunService_ServiceDesc is the grpc.ServiceDesc for RunService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var RunService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "api.RunService",
	HandlerType: (*RunServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateRunV1",
			Handler:    _RunService_CreateRunV1_Handler,
		},
		{
			MethodName: "GetRunV1",
			Handler:    _RunService_GetRunV1_Handler,
		},
		{
			MethodName: "ListRunsV1",
			Handler:    _RunService_ListRunsV1_Handler,
		},
		{
			MethodName: "ArchiveRunV1",
			Handler:    _RunService_ArchiveRunV1_Handler,
		},
		{
			MethodName: "UnarchiveRunV1",
			Handler:    _RunService_UnarchiveRunV1_Handler,
		},
		{
			MethodName: "DeleteRunV1",
			Handler:    _RunService_DeleteRunV1_Handler,
		},
		{
			MethodName: "ReportRunMetricsV1",
			Handler:    _RunService_ReportRunMetricsV1_Handler,
		},
		{
			MethodName: "ReadArtifactV1",
			Handler:    _RunService_ReadArtifactV1_Handler,
		},
		{
			MethodName: "TerminateRunV1",
			Handler:    _RunService_TerminateRunV1_Handler,
		},
		{
			MethodName: "RetryRunV1",
			Handler:    _RunService_RetryRunV1_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "backend/api/v1beta1/run.proto",
}
