//go:build !wasip1

// Code generated by protoc-gen-go-ttrpc. DO NOT EDIT.
// source: pkg/api/api.proto
package api

import (
	context "context"
	ttrpc "github.com/containerd/ttrpc"
)

type RuntimeService interface {
	RegisterPlugin(context.Context, *RegisterPluginRequest) (*Empty, error)
	UpdateContainers(context.Context, *UpdateContainersRequest) (*UpdateContainersResponse, error)
}

func RegisterRuntimeService(srv *ttrpc.Server, svc RuntimeService) {
	srv.RegisterService("nri.pkg.api.v1alpha1.Runtime", &ttrpc.ServiceDesc{
		Methods: map[string]ttrpc.Method{
			"RegisterPlugin": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
				var req RegisterPluginRequest
				if err := unmarshal(&req); err != nil {
					return nil, err
				}
				return svc.RegisterPlugin(ctx, &req)
			},
			"UpdateContainers": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
				var req UpdateContainersRequest
				if err := unmarshal(&req); err != nil {
					return nil, err
				}
				return svc.UpdateContainers(ctx, &req)
			},
		},
	})
}

type runtimeClient struct {
	client *ttrpc.Client
}

func NewRuntimeClient(client *ttrpc.Client) RuntimeService {
	return &runtimeClient{
		client: client,
	}
}

func (c *runtimeClient) RegisterPlugin(ctx context.Context, req *RegisterPluginRequest) (*Empty, error) {
	var resp Empty
	if err := c.client.Call(ctx, "nri.pkg.api.v1alpha1.Runtime", "RegisterPlugin", req, &resp); err != nil {
		return nil, err
	}
	return &resp, nil
}

func (c *runtimeClient) UpdateContainers(ctx context.Context, req *UpdateContainersRequest) (*UpdateContainersResponse, error) {
	var resp UpdateContainersResponse
	if err := c.client.Call(ctx, "nri.pkg.api.v1alpha1.Runtime", "UpdateContainers", req, &resp); err != nil {
		return nil, err
	}
	return &resp, nil
}

type PluginService interface {
	Configure(context.Context, *ConfigureRequest) (*ConfigureResponse, error)
	Synchronize(context.Context, *SynchronizeRequest) (*SynchronizeResponse, error)
	Shutdown(context.Context, *Empty) (*Empty, error)
	RunPodSandbox(context.Context, *RunPodSandboxRequest) (*RunPodSandboxResponse, error)
	UpdatePodSandbox(context.Context, *UpdatePodSandboxRequest) (*UpdatePodSandboxResponse, error)
	PostUpdatePodSandbox(context.Context, *PostUpdatePodSandboxRequest) (*PostUpdatePodSandboxResponse, error)
	StopPodSandbox(context.Context, *StopPodSandboxRequest) (*StopPodSandboxResponse, error)
	RemovePodSandbox(context.Context, *RemovePodSandboxRequest) (*RemovePodSandboxResponse, error)
	CreateContainer(context.Context, *CreateContainerRequest) (*CreateContainerResponse, error)
	PostCreateContainer(context.Context, *PostCreateContainerRequest) (*PostCreateContainerResponse, error)
	StartContainer(context.Context, *StartContainerRequest) (*StartContainerResponse, error)
	PostStartContainer(context.Context, *PostStartContainerRequest) (*PostStartContainerResponse, error)
	UpdateContainer(context.Context, *UpdateContainerRequest) (*UpdateContainerResponse, error)
	PostUpdateContainer(context.Context, *PostUpdateContainerRequest) (*PostUpdateContainerResponse, error)
	StopContainer(context.Context, *StopContainerRequest) (*StopContainerResponse, error)
	RemoveContainer(context.Context, *RemoveContainerRequest) (*RemoveContainerResponse, error)
	StateChange(context.Context, *StateChangeEvent) (*Empty, error)
	ValidateContainerAdjustment(context.Context, *ValidateContainerAdjustmentRequest) (*ValidateContainerAdjustmentResponse, error)
}

func RegisterPluginService(srv *ttrpc.Server, svc PluginService) {
	srv.RegisterService("nri.pkg.api.v1alpha1.Plugin", &ttrpc.ServiceDesc{
		Methods: map[string]ttrpc.Method{
			"Configure": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
				var req ConfigureRequest
				if err := unmarshal(&req); err != nil {
					return nil, err
				}
				return svc.Configure(ctx, &req)
			},
			"Synchronize": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
				var req SynchronizeRequest
				if err := unmarshal(&req); err != nil {
					return nil, err
				}
				return svc.Synchronize(ctx, &req)
			},
			"Shutdown": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
				var req Empty
				if err := unmarshal(&req); err != nil {
					return nil, err
				}
				return svc.Shutdown(ctx, &req)
			},
			"RunPodSandbox": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
				var req RunPodSandboxRequest
				if err := unmarshal(&req); err != nil {
					return nil, err
				}
				return svc.RunPodSandbox(ctx, &req)
			},
			"UpdatePodSandbox": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
				var req UpdatePodSandboxRequest
				if err := unmarshal(&req); err != nil {
					return nil, err
				}
				return svc.UpdatePodSandbox(ctx, &req)
			},
			"PostUpdatePodSandbox": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
				var req PostUpdatePodSandboxRequest
				if err := unmarshal(&req); err != nil {
					return nil, err
				}
				return svc.PostUpdatePodSandbox(ctx, &req)
			},
			"StopPodSandbox": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
				var req StopPodSandboxRequest
				if err := unmarshal(&req); err != nil {
					return nil, err
				}
				return svc.StopPodSandbox(ctx, &req)
			},
			"RemovePodSandbox": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
				var req RemovePodSandboxRequest
				if err := unmarshal(&req); err != nil {
					return nil, err
				}
				return svc.RemovePodSandbox(ctx, &req)
			},
			"CreateContainer": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
				var req CreateContainerRequest
				if err := unmarshal(&req); err != nil {
					return nil, err
				}
				return svc.CreateContainer(ctx, &req)
			},
			"PostCreateContainer": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
				var req PostCreateContainerRequest
				if err := unmarshal(&req); err != nil {
					return nil, err
				}
				return svc.PostCreateContainer(ctx, &req)
			},
			"StartContainer": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
				var req StartContainerRequest
				if err := unmarshal(&req); err != nil {
					return nil, err
				}
				return svc.StartContainer(ctx, &req)
			},
			"PostStartContainer": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
				var req PostStartContainerRequest
				if err := unmarshal(&req); err != nil {
					return nil, err
				}
				return svc.PostStartContainer(ctx, &req)
			},
			"UpdateContainer": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
				var req UpdateContainerRequest
				if err := unmarshal(&req); err != nil {
					return nil, err
				}
				return svc.UpdateContainer(ctx, &req)
			},
			"PostUpdateContainer": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
				var req PostUpdateContainerRequest
				if err := unmarshal(&req); err != nil {
					return nil, err
				}
				return svc.PostUpdateContainer(ctx, &req)
			},
			"StopContainer": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
				var req StopContainerRequest
				if err := unmarshal(&req); err != nil {
					return nil, err
				}
				return svc.StopContainer(ctx, &req)
			},
			"RemoveContainer": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
				var req RemoveContainerRequest
				if err := unmarshal(&req); err != nil {
					return nil, err
				}
				return svc.RemoveContainer(ctx, &req)
			},
			"StateChange": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
				var req StateChangeEvent
				if err := unmarshal(&req); err != nil {
					return nil, err
				}
				return svc.StateChange(ctx, &req)
			},
			"ValidateContainerAdjustment": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
				var req ValidateContainerAdjustmentRequest
				if err := unmarshal(&req); err != nil {
					return nil, err
				}
				return svc.ValidateContainerAdjustment(ctx, &req)
			},
		},
	})
}

type pluginClient struct {
	client *ttrpc.Client
}

func NewPluginClient(client *ttrpc.Client) PluginService {
	return &pluginClient{
		client: client,
	}
}

func (c *pluginClient) Configure(ctx context.Context, req *ConfigureRequest) (*ConfigureResponse, error) {
	var resp ConfigureResponse
	if err := c.client.Call(ctx, "nri.pkg.api.v1alpha1.Plugin", "Configure", req, &resp); err != nil {
		return nil, err
	}
	return &resp, nil
}

func (c *pluginClient) Synchronize(ctx context.Context, req *SynchronizeRequest) (*SynchronizeResponse, error) {
	var resp SynchronizeResponse
	if err := c.client.Call(ctx, "nri.pkg.api.v1alpha1.Plugin", "Synchronize", req, &resp); err != nil {
		return nil, err
	}
	return &resp, nil
}

func (c *pluginClient) Shutdown(ctx context.Context, req *Empty) (*Empty, error) {
	var resp Empty
	if err := c.client.Call(ctx, "nri.pkg.api.v1alpha1.Plugin", "Shutdown", req, &resp); err != nil {
		return nil, err
	}
	return &resp, nil
}

func (c *pluginClient) RunPodSandbox(ctx context.Context, req *RunPodSandboxRequest) (*RunPodSandboxResponse, error) {
	var resp RunPodSandboxResponse
	if err := c.client.Call(ctx, "nri.pkg.api.v1alpha1.Plugin", "RunPodSandbox", req, &resp); err != nil {
		return nil, err
	}
	return &resp, nil
}

func (c *pluginClient) UpdatePodSandbox(ctx context.Context, req *UpdatePodSandboxRequest) (*UpdatePodSandboxResponse, error) {
	var resp UpdatePodSandboxResponse
	if err := c.client.Call(ctx, "nri.pkg.api.v1alpha1.Plugin", "UpdatePodSandbox", req, &resp); err != nil {
		return nil, err
	}
	return &resp, nil
}

func (c *pluginClient) PostUpdatePodSandbox(ctx context.Context, req *PostUpdatePodSandboxRequest) (*PostUpdatePodSandboxResponse, error) {
	var resp PostUpdatePodSandboxResponse
	if err := c.client.Call(ctx, "nri.pkg.api.v1alpha1.Plugin", "PostUpdatePodSandbox", req, &resp); err != nil {
		return nil, err
	}
	return &resp, nil
}

func (c *pluginClient) StopPodSandbox(ctx context.Context, req *StopPodSandboxRequest) (*StopPodSandboxResponse, error) {
	var resp StopPodSandboxResponse
	if err := c.client.Call(ctx, "nri.pkg.api.v1alpha1.Plugin", "StopPodSandbox", req, &resp); err != nil {
		return nil, err
	}
	return &resp, nil
}

func (c *pluginClient) RemovePodSandbox(ctx context.Context, req *RemovePodSandboxRequest) (*RemovePodSandboxResponse, error) {
	var resp RemovePodSandboxResponse
	if err := c.client.Call(ctx, "nri.pkg.api.v1alpha1.Plugin", "RemovePodSandbox", req, &resp); err != nil {
		return nil, err
	}
	return &resp, nil
}

func (c *pluginClient) CreateContainer(ctx context.Context, req *CreateContainerRequest) (*CreateContainerResponse, error) {
	var resp CreateContainerResponse
	if err := c.client.Call(ctx, "nri.pkg.api.v1alpha1.Plugin", "CreateContainer", req, &resp); err != nil {
		return nil, err
	}
	return &resp, nil
}

func (c *pluginClient) PostCreateContainer(ctx context.Context, req *PostCreateContainerRequest) (*PostCreateContainerResponse, error) {
	var resp PostCreateContainerResponse
	if err := c.client.Call(ctx, "nri.pkg.api.v1alpha1.Plugin", "PostCreateContainer", req, &resp); err != nil {
		return nil, err
	}
	return &resp, nil
}

func (c *pluginClient) StartContainer(ctx context.Context, req *StartContainerRequest) (*StartContainerResponse, error) {
	var resp StartContainerResponse
	if err := c.client.Call(ctx, "nri.pkg.api.v1alpha1.Plugin", "StartContainer", req, &resp); err != nil {
		return nil, err
	}
	return &resp, nil
}

func (c *pluginClient) PostStartContainer(ctx context.Context, req *PostStartContainerRequest) (*PostStartContainerResponse, error) {
	var resp PostStartContainerResponse
	if err := c.client.Call(ctx, "nri.pkg.api.v1alpha1.Plugin", "PostStartContainer", req, &resp); err != nil {
		return nil, err
	}
	return &resp, nil
}

func (c *pluginClient) UpdateContainer(ctx context.Context, req *UpdateContainerRequest) (*UpdateContainerResponse, error) {
	var resp UpdateContainerResponse
	if err := c.client.Call(ctx, "nri.pkg.api.v1alpha1.Plugin", "UpdateContainer", req, &resp); err != nil {
		return nil, err
	}
	return &resp, nil
}

func (c *pluginClient) PostUpdateContainer(ctx context.Context, req *PostUpdateContainerRequest) (*PostUpdateContainerResponse, error) {
	var resp PostUpdateContainerResponse
	if err := c.client.Call(ctx, "nri.pkg.api.v1alpha1.Plugin", "PostUpdateContainer", req, &resp); err != nil {
		return nil, err
	}
	return &resp, nil
}

func (c *pluginClient) StopContainer(ctx context.Context, req *StopContainerRequest) (*StopContainerResponse, error) {
	var resp StopContainerResponse
	if err := c.client.Call(ctx, "nri.pkg.api.v1alpha1.Plugin", "StopContainer", req, &resp); err != nil {
		return nil, err
	}
	return &resp, nil
}

func (c *pluginClient) RemoveContainer(ctx context.Context, req *RemoveContainerRequest) (*RemoveContainerResponse, error) {
	var resp RemoveContainerResponse
	if err := c.client.Call(ctx, "nri.pkg.api.v1alpha1.Plugin", "RemoveContainer", req, &resp); err != nil {
		return nil, err
	}
	return &resp, nil
}

func (c *pluginClient) StateChange(ctx context.Context, req *StateChangeEvent) (*Empty, error) {
	var resp Empty
	if err := c.client.Call(ctx, "nri.pkg.api.v1alpha1.Plugin", "StateChange", req, &resp); err != nil {
		return nil, err
	}
	return &resp, nil
}

func (c *pluginClient) ValidateContainerAdjustment(ctx context.Context, req *ValidateContainerAdjustmentRequest) (*ValidateContainerAdjustmentResponse, error) {
	var resp ValidateContainerAdjustmentResponse
	if err := c.client.Call(ctx, "nri.pkg.api.v1alpha1.Plugin", "ValidateContainerAdjustment", req, &resp); err != nil {
		return nil, err
	}
	return &resp, nil
}

type HostFunctionsService interface {
	Log(context.Context, *LogRequest) (*Empty, error)
}

func RegisterHostFunctionsService(srv *ttrpc.Server, svc HostFunctionsService) {
	srv.RegisterService("nri.pkg.api.v1alpha1.HostFunctions", &ttrpc.ServiceDesc{
		Methods: map[string]ttrpc.Method{
			"Log": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
				var req LogRequest
				if err := unmarshal(&req); err != nil {
					return nil, err
				}
				return svc.Log(ctx, &req)
			},
		},
	})
}

type hostfunctionsClient struct {
	client *ttrpc.Client
}

func NewHostFunctionsClient(client *ttrpc.Client) HostFunctionsService {
	return &hostfunctionsClient{
		client: client,
	}
}

func (c *hostfunctionsClient) Log(ctx context.Context, req *LogRequest) (*Empty, error) {
	var resp Empty
	if err := c.client.Call(ctx, "nri.pkg.api.v1alpha1.HostFunctions", "Log", req, &resp); err != nil {
		return nil, err
	}
	return &resp, nil
}
