// Code generated by sdkgen. DO NOT EDIT.

// nolint
package agent

import (
	"context"

	"google.golang.org/grpc"

	agent "github.com/yandex-cloud/go-genproto/yandex/cloud/loadtesting/agent/v1"
	"github.com/yandex-cloud/go-genproto/yandex/cloud/operation"
)

//revive:disable

// TestServiceClient is a agent.TestServiceClient with
// lazy GRPC connection initialization.
type TestServiceClient struct {
	getConn func(ctx context.Context) (*grpc.ClientConn, error)
}

// Get implements agent.TestServiceClient
func (c *TestServiceClient) Get(ctx context.Context, in *agent.GetTestRequest, opts ...grpc.CallOption) (*agent.Test, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return agent.NewTestServiceClient(conn).Get(ctx, in, opts...)
}

// Update implements agent.TestServiceClient
func (c *TestServiceClient) Update(ctx context.Context, in *agent.UpdateTestRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return agent.NewTestServiceClient(conn).Update(ctx, in, opts...)
}
