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

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

type NetworkConfigProxyService interface {
	RegisterComputeAgent(context.Context, *RegisterComputeAgentRequest) (*RegisterComputeAgentResponse, error)
	UnregisterComputeAgent(context.Context, *UnregisterComputeAgentRequest) (*UnregisterComputeAgentResponse, error)
	ConfigureNetworking(context.Context, *ConfigureNetworkingInternalRequest) (*ConfigureNetworkingInternalResponse, error)
}

func RegisterNetworkConfigProxyService(srv *ttrpc.Server, svc NetworkConfigProxyService) {
	srv.RegisterService("NetworkConfigProxy", &ttrpc.ServiceDesc{
		Methods: map[string]ttrpc.Method{
			"RegisterComputeAgent": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
				var req RegisterComputeAgentRequest
				if err := unmarshal(&req); err != nil {
					return nil, err
				}
				return svc.RegisterComputeAgent(ctx, &req)
			},
			"UnregisterComputeAgent": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
				var req UnregisterComputeAgentRequest
				if err := unmarshal(&req); err != nil {
					return nil, err
				}
				return svc.UnregisterComputeAgent(ctx, &req)
			},
			"ConfigureNetworking": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
				var req ConfigureNetworkingInternalRequest
				if err := unmarshal(&req); err != nil {
					return nil, err
				}
				return svc.ConfigureNetworking(ctx, &req)
			},
		},
	})
}

type networkconfigproxyClient struct {
	client *ttrpc.Client
}

func NewNetworkConfigProxyClient(client *ttrpc.Client) NetworkConfigProxyService {
	return &networkconfigproxyClient{
		client: client,
	}
}

func (c *networkconfigproxyClient) RegisterComputeAgent(ctx context.Context, req *RegisterComputeAgentRequest) (*RegisterComputeAgentResponse, error) {
	var resp RegisterComputeAgentResponse
	if err := c.client.Call(ctx, "NetworkConfigProxy", "RegisterComputeAgent", req, &resp); err != nil {
		return nil, err
	}
	return &resp, nil
}

func (c *networkconfigproxyClient) UnregisterComputeAgent(ctx context.Context, req *UnregisterComputeAgentRequest) (*UnregisterComputeAgentResponse, error) {
	var resp UnregisterComputeAgentResponse
	if err := c.client.Call(ctx, "NetworkConfigProxy", "UnregisterComputeAgent", req, &resp); err != nil {
		return nil, err
	}
	return &resp, nil
}

func (c *networkconfigproxyClient) ConfigureNetworking(ctx context.Context, req *ConfigureNetworkingInternalRequest) (*ConfigureNetworkingInternalResponse, error) {
	var resp ConfigureNetworkingInternalResponse
	if err := c.client.Call(ctx, "NetworkConfigProxy", "ConfigureNetworking", req, &resp); err != nil {
		return nil, err
	}
	return &resp, nil
}
