packer-cn/vendor/github.com/yandex-cloud/go-sdk/gen/iot/devices/device.go

105 lines
3.6 KiB
Go

// Code generated by sdkgen. DO NOT EDIT.
//nolint
package devices
import (
"context"
"google.golang.org/grpc"
"github.com/yandex-cloud/go-genproto/yandex/cloud/iot/devices/v1"
"github.com/yandex-cloud/go-genproto/yandex/cloud/operation"
)
//revive:disable
// DeviceServiceClient is a devices.DeviceServiceClient with
// lazy GRPC connection initialization.
type DeviceServiceClient struct {
getConn func(ctx context.Context) (*grpc.ClientConn, error)
}
var _ devices.DeviceServiceClient = &DeviceServiceClient{}
// AddCertificate implements devices.DeviceServiceClient
func (c *DeviceServiceClient) AddCertificate(ctx context.Context, in *devices.AddDeviceCertificateRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
conn, err := c.getConn(ctx)
if err != nil {
return nil, err
}
return devices.NewDeviceServiceClient(conn).AddCertificate(ctx, in, opts...)
}
// Create implements devices.DeviceServiceClient
func (c *DeviceServiceClient) Create(ctx context.Context, in *devices.CreateDeviceRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
conn, err := c.getConn(ctx)
if err != nil {
return nil, err
}
return devices.NewDeviceServiceClient(conn).Create(ctx, in, opts...)
}
// Delete implements devices.DeviceServiceClient
func (c *DeviceServiceClient) Delete(ctx context.Context, in *devices.DeleteDeviceRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
conn, err := c.getConn(ctx)
if err != nil {
return nil, err
}
return devices.NewDeviceServiceClient(conn).Delete(ctx, in, opts...)
}
// DeleteCertificate implements devices.DeviceServiceClient
func (c *DeviceServiceClient) DeleteCertificate(ctx context.Context, in *devices.DeleteDeviceCertificateRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
conn, err := c.getConn(ctx)
if err != nil {
return nil, err
}
return devices.NewDeviceServiceClient(conn).DeleteCertificate(ctx, in, opts...)
}
// Get implements devices.DeviceServiceClient
func (c *DeviceServiceClient) Get(ctx context.Context, in *devices.GetDeviceRequest, opts ...grpc.CallOption) (*devices.Device, error) {
conn, err := c.getConn(ctx)
if err != nil {
return nil, err
}
return devices.NewDeviceServiceClient(conn).Get(ctx, in, opts...)
}
// List implements devices.DeviceServiceClient
func (c *DeviceServiceClient) List(ctx context.Context, in *devices.ListDevicesRequest, opts ...grpc.CallOption) (*devices.ListDevicesResponse, error) {
conn, err := c.getConn(ctx)
if err != nil {
return nil, err
}
return devices.NewDeviceServiceClient(conn).List(ctx, in, opts...)
}
// ListCertificates implements devices.DeviceServiceClient
func (c *DeviceServiceClient) ListCertificates(ctx context.Context, in *devices.ListDeviceCertificatesRequest, opts ...grpc.CallOption) (*devices.ListDeviceCertificatesResponse, error) {
conn, err := c.getConn(ctx)
if err != nil {
return nil, err
}
return devices.NewDeviceServiceClient(conn).ListCertificates(ctx, in, opts...)
}
// ListOperations implements devices.DeviceServiceClient
func (c *DeviceServiceClient) ListOperations(ctx context.Context, in *devices.ListDeviceOperationsRequest, opts ...grpc.CallOption) (*devices.ListDeviceOperationsResponse, error) {
conn, err := c.getConn(ctx)
if err != nil {
return nil, err
}
return devices.NewDeviceServiceClient(conn).ListOperations(ctx, in, opts...)
}
// Update implements devices.DeviceServiceClient
func (c *DeviceServiceClient) Update(ctx context.Context, in *devices.UpdateDeviceRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
conn, err := c.getConn(ctx)
if err != nil {
return nil, err
}
return devices.NewDeviceServiceClient(conn).Update(ctx, in, opts...)
}