// Code generated by sdkgen. DO NOT EDIT.

// nolint
package websocket

import (
	"context"

	"google.golang.org/grpc"

	websocket "github.com/yandex-cloud/go-genproto/yandex/cloud/serverless/apigateway/websocket/v1"
)

//revive:disable

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

// Disconnect implements websocket.ConnectionServiceClient
func (c *ConnectionServiceClient) Disconnect(ctx context.Context, in *websocket.DisconnectRequest, opts ...grpc.CallOption) (*websocket.DisconnectResponse, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return websocket.NewConnectionServiceClient(conn).Disconnect(ctx, in, opts...)
}

// Get implements websocket.ConnectionServiceClient
func (c *ConnectionServiceClient) Get(ctx context.Context, in *websocket.GetConnectionRequest, opts ...grpc.CallOption) (*websocket.Connection, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return websocket.NewConnectionServiceClient(conn).Get(ctx, in, opts...)
}

// Send implements websocket.ConnectionServiceClient
func (c *ConnectionServiceClient) Send(ctx context.Context, in *websocket.SendToConnectionRequest, opts ...grpc.CallOption) (*websocket.SendToConnectionResponse, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return websocket.NewConnectionServiceClient(conn).Send(ctx, in, opts...)
}
