//  Copyright 2026 Google LLC
//
//  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.6.1
// - protoc             v4.25.3
// source: ateom.proto

package ateompb

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

const (
	Ateom_RunWorkload_FullMethodName        = "/ateom.Ateom/RunWorkload"
	Ateom_CheckpointWorkload_FullMethodName = "/ateom.Ateom/CheckpointWorkload"
	Ateom_RestoreWorkload_FullMethodName    = "/ateom.Ateom/RestoreWorkload"
)

// AteomClient is the client API for Ateom 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.
//
// Ateom is the interface to control a single gVisor (or, in the future microVM)
// guest inside a worker pod.
//
// Each ateom server has two main states, "available" and "executing".
//
// When the ateom is "available", the substrate control plane is free to either
// boot a new workload (using RunWorkload), or restore an existing workload from
// a checkpoint (using RestoreWorkload).  These calls move the ateom into
// "executing" state.
//
// When the ateom is "executing", the substrate control plane can checkpoint the
// running workload (with CheckpointWorkload).  This moves the ateom back to
// "free" state.
type AteomClient interface {
	// RunWorkload tells ateom to begin running a new workload (one or more
	// containers, potentially with shared filesystems).
	RunWorkload(ctx context.Context, in *RunWorkloadRequest, opts ...grpc.CallOption) (*RunWorkloadResponse, error)
	// CheckpointWorkload tells ateom to save the current state of the running
	// workload to object storage, and then completely reset itself to a blank
	// state (back to "available" state.)
	CheckpointWorkload(ctx context.Context, in *CheckpointWorkloadRequest, opts ...grpc.CallOption) (*CheckpointWorkloadResponse, error)
	// RestoreWorkload restores a workload from checkpoint that was previously
	// written by CheckpointWorkload.  Ateom will handle downloading the correct
	// gVisor / runsc version to match the checkpoint.
	RestoreWorkload(ctx context.Context, in *RestoreWorkloadRequest, opts ...grpc.CallOption) (*RestoreWorkloadResponse, error)
}

type ateomClient struct {
	cc grpc.ClientConnInterface
}

func NewAteomClient(cc grpc.ClientConnInterface) AteomClient {
	return &ateomClient{cc}
}

func (c *ateomClient) RunWorkload(ctx context.Context, in *RunWorkloadRequest, opts ...grpc.CallOption) (*RunWorkloadResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(RunWorkloadResponse)
	err := c.cc.Invoke(ctx, Ateom_RunWorkload_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *ateomClient) CheckpointWorkload(ctx context.Context, in *CheckpointWorkloadRequest, opts ...grpc.CallOption) (*CheckpointWorkloadResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(CheckpointWorkloadResponse)
	err := c.cc.Invoke(ctx, Ateom_CheckpointWorkload_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *ateomClient) RestoreWorkload(ctx context.Context, in *RestoreWorkloadRequest, opts ...grpc.CallOption) (*RestoreWorkloadResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(RestoreWorkloadResponse)
	err := c.cc.Invoke(ctx, Ateom_RestoreWorkload_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// AteomServer is the server API for Ateom service.
// All implementations must embed UnimplementedAteomServer
// for forward compatibility.
//
// Ateom is the interface to control a single gVisor (or, in the future microVM)
// guest inside a worker pod.
//
// Each ateom server has two main states, "available" and "executing".
//
// When the ateom is "available", the substrate control plane is free to either
// boot a new workload (using RunWorkload), or restore an existing workload from
// a checkpoint (using RestoreWorkload).  These calls move the ateom into
// "executing" state.
//
// When the ateom is "executing", the substrate control plane can checkpoint the
// running workload (with CheckpointWorkload).  This moves the ateom back to
// "free" state.
type AteomServer interface {
	// RunWorkload tells ateom to begin running a new workload (one or more
	// containers, potentially with shared filesystems).
	RunWorkload(context.Context, *RunWorkloadRequest) (*RunWorkloadResponse, error)
	// CheckpointWorkload tells ateom to save the current state of the running
	// workload to object storage, and then completely reset itself to a blank
	// state (back to "available" state.)
	CheckpointWorkload(context.Context, *CheckpointWorkloadRequest) (*CheckpointWorkloadResponse, error)
	// RestoreWorkload restores a workload from checkpoint that was previously
	// written by CheckpointWorkload.  Ateom will handle downloading the correct
	// gVisor / runsc version to match the checkpoint.
	RestoreWorkload(context.Context, *RestoreWorkloadRequest) (*RestoreWorkloadResponse, error)
	mustEmbedUnimplementedAteomServer()
}

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

func (UnimplementedAteomServer) RunWorkload(context.Context, *RunWorkloadRequest) (*RunWorkloadResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method RunWorkload not implemented")
}
func (UnimplementedAteomServer) CheckpointWorkload(context.Context, *CheckpointWorkloadRequest) (*CheckpointWorkloadResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method CheckpointWorkload not implemented")
}
func (UnimplementedAteomServer) RestoreWorkload(context.Context, *RestoreWorkloadRequest) (*RestoreWorkloadResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method RestoreWorkload not implemented")
}
func (UnimplementedAteomServer) mustEmbedUnimplementedAteomServer() {}
func (UnimplementedAteomServer) testEmbeddedByValue()               {}

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

func RegisterAteomServer(s grpc.ServiceRegistrar, srv AteomServer) {
	// If the following call panics, it indicates UnimplementedAteomServer 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(&Ateom_ServiceDesc, srv)
}

func _Ateom_RunWorkload_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(RunWorkloadRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AteomServer).RunWorkload(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Ateom_RunWorkload_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AteomServer).RunWorkload(ctx, req.(*RunWorkloadRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Ateom_CheckpointWorkload_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CheckpointWorkloadRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AteomServer).CheckpointWorkload(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Ateom_CheckpointWorkload_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AteomServer).CheckpointWorkload(ctx, req.(*CheckpointWorkloadRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Ateom_RestoreWorkload_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(RestoreWorkloadRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AteomServer).RestoreWorkload(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Ateom_RestoreWorkload_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AteomServer).RestoreWorkload(ctx, req.(*RestoreWorkloadRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// Ateom_ServiceDesc is the grpc.ServiceDesc for Ateom service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Ateom_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "ateom.Ateom",
	HandlerType: (*AteomServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "RunWorkload",
			Handler:    _Ateom_RunWorkload_Handler,
		},
		{
			MethodName: "CheckpointWorkload",
			Handler:    _Ateom_CheckpointWorkload_Handler,
		},
		{
			MethodName: "RestoreWorkload",
			Handler:    _Ateom_RestoreWorkload_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "ateom.proto",
}
