github.com/cloudwan/edgelq-sdk@v1.15.4/devices/client/v1/device/device_service.pb.client.go (about) 1 // Code generated by protoc-gen-goten-client 2 // API: DeviceService 3 // DO NOT EDIT!!! 4 5 package device_client 6 7 import ( 8 "context" 9 10 "google.golang.org/grpc" 11 "google.golang.org/protobuf/runtime/protoimpl" 12 ) 13 14 // proto imports 15 import ( 16 device "github.com/cloudwan/edgelq-sdk/devices/resources/v1/device" 17 emptypb "google.golang.org/protobuf/types/known/emptypb" 18 ) 19 20 // Reference imports to suppress errors if they are not otherwise used. 21 var ( 22 _ = protoimpl.DescBuilder{} 23 _ = new(context.Context) 24 _ = grpc.ClientConn{} 25 ) 26 27 // make sure we're using proto imports 28 var ( 29 _ = &device.Device{} 30 _ = &emptypb.Empty{} 31 ) 32 33 // This is a compile-time assertion to ensure that this generated file 34 // is compatible with the proto package it is being compiled against. 35 // A compilation error at this line likely means your copy of the 36 // proto package needs to be updated. 37 const ( 38 // Verify that this generated code is sufficiently up-to-date. 39 _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 40 // Verify that runtime/protoimpl is sufficiently up-to-date. 41 _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 42 ) 43 44 // This is a compile-time assertion to ensure that this generated file 45 // is compatible with the grpc package it is being compiled against. 46 const _ = grpc.SupportPackageIsVersion6 47 48 // DeviceServiceClient is the client API for DeviceService. 49 // 50 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. 51 type DeviceServiceClient interface { 52 GetDevice(ctx context.Context, in *GetDeviceRequest, opts ...grpc.CallOption) (*device.Device, error) 53 BatchGetDevices(ctx context.Context, in *BatchGetDevicesRequest, opts ...grpc.CallOption) (*BatchGetDevicesResponse, error) 54 ListDevices(ctx context.Context, in *ListDevicesRequest, opts ...grpc.CallOption) (*ListDevicesResponse, error) 55 WatchDevice(ctx context.Context, in *WatchDeviceRequest, opts ...grpc.CallOption) (WatchDeviceClientStream, error) 56 WatchDevices(ctx context.Context, in *WatchDevicesRequest, opts ...grpc.CallOption) (WatchDevicesClientStream, error) 57 CreateDevice(ctx context.Context, in *CreateDeviceRequest, opts ...grpc.CallOption) (*device.Device, error) 58 UpdateDevice(ctx context.Context, in *UpdateDeviceRequest, opts ...grpc.CallOption) (*device.Device, error) 59 DeleteDevice(ctx context.Context, in *DeleteDeviceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) 60 GetDedicatedEndpoints(ctx context.Context, in *GetDedicatedEndpointsRequest, opts ...grpc.CallOption) (*GetDedicatedEndpointsResponse, error) 61 ProvisionServiceAccountToDevice(ctx context.Context, in *ProvisionServiceAccountToDeviceRequest, opts ...grpc.CallOption) (*ProvisionServiceAccountToDeviceResponse, error) 62 RemoveServiceAccountFromDevice(ctx context.Context, in *RemoveServiceAccountFromDeviceRequest, opts ...grpc.CallOption) (*RemoveServiceAccountFromDeviceResponse, error) 63 Heartbeat(ctx context.Context, opts ...grpc.CallOption) (HeartbeatClientStream, error) 64 ReportDeviceMetrics(ctx context.Context, opts ...grpc.CallOption) (ReportDeviceMetricsClientStream, error) 65 } 66 67 type client struct { 68 cc grpc.ClientConnInterface 69 } 70 71 func NewDeviceServiceClient(cc grpc.ClientConnInterface) DeviceServiceClient { 72 return &client{cc} 73 } 74 75 func (c *client) GetDevice(ctx context.Context, in *GetDeviceRequest, opts ...grpc.CallOption) (*device.Device, error) { 76 out := new(device.Device) 77 err := c.cc.Invoke(ctx, "/ntt.devices.v1.DeviceService/GetDevice", in, out, opts...) 78 if err != nil { 79 return nil, err 80 } 81 return out, nil 82 } 83 84 func (c *client) BatchGetDevices(ctx context.Context, in *BatchGetDevicesRequest, opts ...grpc.CallOption) (*BatchGetDevicesResponse, error) { 85 out := new(BatchGetDevicesResponse) 86 err := c.cc.Invoke(ctx, "/ntt.devices.v1.DeviceService/BatchGetDevices", in, out, opts...) 87 if err != nil { 88 return nil, err 89 } 90 return out, nil 91 } 92 93 func (c *client) ListDevices(ctx context.Context, in *ListDevicesRequest, opts ...grpc.CallOption) (*ListDevicesResponse, error) { 94 out := new(ListDevicesResponse) 95 err := c.cc.Invoke(ctx, "/ntt.devices.v1.DeviceService/ListDevices", in, out, opts...) 96 if err != nil { 97 return nil, err 98 } 99 return out, nil 100 } 101 102 func (c *client) WatchDevice(ctx context.Context, in *WatchDeviceRequest, opts ...grpc.CallOption) (WatchDeviceClientStream, error) { 103 stream, err := c.cc.NewStream(ctx, 104 &grpc.StreamDesc{ 105 StreamName: "WatchDevice", 106 ServerStreams: true, 107 }, 108 "/ntt.devices.v1.DeviceService/WatchDevice", opts...) 109 if err != nil { 110 return nil, err 111 } 112 x := &watchDeviceWatchDeviceClient{stream} 113 if err := x.ClientStream.SendMsg(in); err != nil { 114 return nil, err 115 } 116 if err := x.ClientStream.CloseSend(); err != nil { 117 return nil, err 118 } 119 return x, nil 120 } 121 122 type WatchDeviceClientStream interface { 123 Recv() (*WatchDeviceResponse, error) 124 grpc.ClientStream 125 } 126 127 type watchDeviceWatchDeviceClient struct { 128 grpc.ClientStream 129 } 130 131 func (x *watchDeviceWatchDeviceClient) Recv() (*WatchDeviceResponse, error) { 132 m := new(WatchDeviceResponse) 133 if err := x.ClientStream.RecvMsg(m); err != nil { 134 return nil, err 135 } 136 return m, nil 137 } 138 139 func (c *client) WatchDevices(ctx context.Context, in *WatchDevicesRequest, opts ...grpc.CallOption) (WatchDevicesClientStream, error) { 140 stream, err := c.cc.NewStream(ctx, 141 &grpc.StreamDesc{ 142 StreamName: "WatchDevices", 143 ServerStreams: true, 144 }, 145 "/ntt.devices.v1.DeviceService/WatchDevices", opts...) 146 if err != nil { 147 return nil, err 148 } 149 x := &watchDevicesWatchDevicesClient{stream} 150 if err := x.ClientStream.SendMsg(in); err != nil { 151 return nil, err 152 } 153 if err := x.ClientStream.CloseSend(); err != nil { 154 return nil, err 155 } 156 return x, nil 157 } 158 159 type WatchDevicesClientStream interface { 160 Recv() (*WatchDevicesResponse, error) 161 grpc.ClientStream 162 } 163 164 type watchDevicesWatchDevicesClient struct { 165 grpc.ClientStream 166 } 167 168 func (x *watchDevicesWatchDevicesClient) Recv() (*WatchDevicesResponse, error) { 169 m := new(WatchDevicesResponse) 170 if err := x.ClientStream.RecvMsg(m); err != nil { 171 return nil, err 172 } 173 return m, nil 174 } 175 176 func (c *client) CreateDevice(ctx context.Context, in *CreateDeviceRequest, opts ...grpc.CallOption) (*device.Device, error) { 177 out := new(device.Device) 178 err := c.cc.Invoke(ctx, "/ntt.devices.v1.DeviceService/CreateDevice", in, out, opts...) 179 if err != nil { 180 return nil, err 181 } 182 return out, nil 183 } 184 185 func (c *client) UpdateDevice(ctx context.Context, in *UpdateDeviceRequest, opts ...grpc.CallOption) (*device.Device, error) { 186 out := new(device.Device) 187 err := c.cc.Invoke(ctx, "/ntt.devices.v1.DeviceService/UpdateDevice", in, out, opts...) 188 if err != nil { 189 return nil, err 190 } 191 return out, nil 192 } 193 194 func (c *client) DeleteDevice(ctx context.Context, in *DeleteDeviceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { 195 out := new(emptypb.Empty) 196 err := c.cc.Invoke(ctx, "/ntt.devices.v1.DeviceService/DeleteDevice", in, out, opts...) 197 if err != nil { 198 return nil, err 199 } 200 return out, nil 201 } 202 203 func (c *client) GetDedicatedEndpoints(ctx context.Context, in *GetDedicatedEndpointsRequest, opts ...grpc.CallOption) (*GetDedicatedEndpointsResponse, error) { 204 out := new(GetDedicatedEndpointsResponse) 205 err := c.cc.Invoke(ctx, "/ntt.devices.v1.DeviceService/GetDedicatedEndpoints", in, out, opts...) 206 if err != nil { 207 return nil, err 208 } 209 return out, nil 210 } 211 212 func (c *client) ProvisionServiceAccountToDevice(ctx context.Context, in *ProvisionServiceAccountToDeviceRequest, opts ...grpc.CallOption) (*ProvisionServiceAccountToDeviceResponse, error) { 213 out := new(ProvisionServiceAccountToDeviceResponse) 214 err := c.cc.Invoke(ctx, "/ntt.devices.v1.DeviceService/ProvisionServiceAccountToDevice", in, out, opts...) 215 if err != nil { 216 return nil, err 217 } 218 return out, nil 219 } 220 221 func (c *client) RemoveServiceAccountFromDevice(ctx context.Context, in *RemoveServiceAccountFromDeviceRequest, opts ...grpc.CallOption) (*RemoveServiceAccountFromDeviceResponse, error) { 222 out := new(RemoveServiceAccountFromDeviceResponse) 223 err := c.cc.Invoke(ctx, "/ntt.devices.v1.DeviceService/RemoveServiceAccountFromDevice", in, out, opts...) 224 if err != nil { 225 return nil, err 226 } 227 return out, nil 228 } 229 230 func (c *client) Heartbeat(ctx context.Context, opts ...grpc.CallOption) (HeartbeatClientStream, error) { 231 stream, err := c.cc.NewStream(ctx, 232 &grpc.StreamDesc{ 233 StreamName: "Heartbeat", 234 ServerStreams: true, 235 ClientStreams: true, 236 }, 237 "/ntt.devices.v1.DeviceService/Heartbeat", opts...) 238 if err != nil { 239 return nil, err 240 } 241 x := &heartbeatHeartbeatClient{stream} 242 return x, nil 243 } 244 245 type HeartbeatClientStream interface { 246 Send(*HeartbeatMsg) error 247 Recv() (*HeartbeatResponse, error) 248 grpc.ClientStream 249 } 250 251 type heartbeatHeartbeatClient struct { 252 grpc.ClientStream 253 } 254 255 func (x *heartbeatHeartbeatClient) Send(m *HeartbeatMsg) error { 256 return x.ClientStream.SendMsg(m) 257 } 258 259 func (x *heartbeatHeartbeatClient) Recv() (*HeartbeatResponse, error) { 260 m := new(HeartbeatResponse) 261 if err := x.ClientStream.RecvMsg(m); err != nil { 262 return nil, err 263 } 264 return m, nil 265 } 266 267 func (c *client) ReportDeviceMetrics(ctx context.Context, opts ...grpc.CallOption) (ReportDeviceMetricsClientStream, error) { 268 stream, err := c.cc.NewStream(ctx, 269 &grpc.StreamDesc{ 270 StreamName: "ReportDeviceMetrics", 271 ServerStreams: true, 272 ClientStreams: true, 273 }, 274 "/ntt.devices.v1.DeviceService/ReportDeviceMetrics", opts...) 275 if err != nil { 276 return nil, err 277 } 278 x := &reportDeviceMetricsReportDeviceMetricsClient{stream} 279 return x, nil 280 } 281 282 type ReportDeviceMetricsClientStream interface { 283 Send(*ReportDeviceMetricsRequest) error 284 Recv() (*ReportDeviceMetricsResponse, error) 285 grpc.ClientStream 286 } 287 288 type reportDeviceMetricsReportDeviceMetricsClient struct { 289 grpc.ClientStream 290 } 291 292 func (x *reportDeviceMetricsReportDeviceMetricsClient) Send(m *ReportDeviceMetricsRequest) error { 293 return x.ClientStream.SendMsg(m) 294 } 295 296 func (x *reportDeviceMetricsReportDeviceMetricsClient) Recv() (*ReportDeviceMetricsResponse, error) { 297 m := new(ReportDeviceMetricsResponse) 298 if err := x.ClientStream.RecvMsg(m); err != nil { 299 return nil, err 300 } 301 return m, nil 302 }