// Code generated by protoc-gen-go-ttrpc. DO NOT EDIT.
// source: github.com/Microsoft/hcsshim/internal/computeagent/computeagent.proto
package computeagent

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

type ComputeAgentService interface {
	AddNIC(context.Context, *AddNICInternalRequest) (*AddNICInternalResponse, error)
	ModifyNIC(context.Context, *ModifyNICInternalRequest) (*ModifyNICInternalResponse, error)
	DeleteNIC(context.Context, *DeleteNICInternalRequest) (*DeleteNICInternalResponse, error)
	AssignPCI(context.Context, *AssignPCIInternalRequest) (*AssignPCIInternalResponse, error)
	RemovePCI(context.Context, *RemovePCIInternalRequest) (*RemovePCIInternalResponse, error)
}

func RegisterComputeAgentService(srv *ttrpc.Server, svc ComputeAgentService) {
	srv.RegisterService("ComputeAgent", &ttrpc.ServiceDesc{
		Methods: map[string]ttrpc.Method{
			"AddNIC": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
				var req AddNICInternalRequest
				if err := unmarshal(&req); err != nil {
					return nil, err
				}
				return svc.AddNIC(ctx, &req)
			},
			"ModifyNIC": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
				var req ModifyNICInternalRequest
				if err := unmarshal(&req); err != nil {
					return nil, err
				}
				return svc.ModifyNIC(ctx, &req)
			},
			"DeleteNIC": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
				var req DeleteNICInternalRequest
				if err := unmarshal(&req); err != nil {
					return nil, err
				}
				return svc.DeleteNIC(ctx, &req)
			},
			"AssignPCI": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
				var req AssignPCIInternalRequest
				if err := unmarshal(&req); err != nil {
					return nil, err
				}
				return svc.AssignPCI(ctx, &req)
			},
			"RemovePCI": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
				var req RemovePCIInternalRequest
				if err := unmarshal(&req); err != nil {
					return nil, err
				}
				return svc.RemovePCI(ctx, &req)
			},
		},
	})
}

type computeagentClient struct {
	client *ttrpc.Client
}

func NewComputeAgentClient(client *ttrpc.Client) ComputeAgentService {
	return &computeagentClient{
		client: client,
	}
}

func (c *computeagentClient) AddNIC(ctx context.Context, req *AddNICInternalRequest) (*AddNICInternalResponse, error) {
	var resp AddNICInternalResponse
	if err := c.client.Call(ctx, "ComputeAgent", "AddNIC", req, &resp); err != nil {
		return nil, err
	}
	return &resp, nil
}

func (c *computeagentClient) ModifyNIC(ctx context.Context, req *ModifyNICInternalRequest) (*ModifyNICInternalResponse, error) {
	var resp ModifyNICInternalResponse
	if err := c.client.Call(ctx, "ComputeAgent", "ModifyNIC", req, &resp); err != nil {
		return nil, err
	}
	return &resp, nil
}

func (c *computeagentClient) DeleteNIC(ctx context.Context, req *DeleteNICInternalRequest) (*DeleteNICInternalResponse, error) {
	var resp DeleteNICInternalResponse
	if err := c.client.Call(ctx, "ComputeAgent", "DeleteNIC", req, &resp); err != nil {
		return nil, err
	}
	return &resp, nil
}

func (c *computeagentClient) AssignPCI(ctx context.Context, req *AssignPCIInternalRequest) (*AssignPCIInternalResponse, error) {
	var resp AssignPCIInternalResponse
	if err := c.client.Call(ctx, "ComputeAgent", "AssignPCI", req, &resp); err != nil {
		return nil, err
	}
	return &resp, nil
}

func (c *computeagentClient) RemovePCI(ctx context.Context, req *RemovePCIInternalRequest) (*RemovePCIInternalResponse, error) {
	var resp RemovePCIInternalResponse
	if err := c.client.Call(ctx, "ComputeAgent", "RemovePCI", req, &resp); err != nil {
		return nil, err
	}
	return &resp, nil
}
