From 59cef65d409b13dac44af4d05db5e938057675e6 Mon Sep 17 00:00:00 2001 From: Dan Gottlieb Date: Fri, 17 Nov 2023 09:14:07 -0500 Subject: [PATCH] APP-3229: API changes for viam agent. --- app/agent/v1/agent.pb.go | 1132 +++++++++ app/agent/v1/agent.pb.gw.go | 395 +++ app/agent/v1/agent_grpc.pb.go | 233 ++ component/arm/v1/arm.pb.gw.go | 14 +- component/audioinput/v1/audioinput.pb.gw.go | 10 +- component/board/v1/board.pb.gw.go | 10 +- component/motor/v1/motor.pb.gw.go | 10 +- gen/js/app/agent/v1/agent_grpc_web_pb.js | 320 +++ gen/js/app/agent/v1/agent_pb.d.ts | 310 +++ gen/js/app/agent/v1/agent_pb.js | 2341 ++++++++++++++++++ gen/js/app/agent/v1/agent_pb_service.d.ts | 111 + gen/js/app/agent/v1/agent_pb_service.js | 156 ++ proto/viam/app/agent/v1/agent.proto | 114 + service/datamanager/v1/data_manager.pb.gw.go | 6 +- service/motion/v1/motion.pb.gw.go | 6 +- service/sensors/v1/sensors.pb.gw.go | 6 +- service/vision/v1/vision.pb.gw.go | 6 +- 17 files changed, 5146 insertions(+), 34 deletions(-) create mode 100644 app/agent/v1/agent.pb.go create mode 100644 app/agent/v1/agent.pb.gw.go create mode 100644 app/agent/v1/agent_grpc.pb.go create mode 100644 gen/js/app/agent/v1/agent_grpc_web_pb.js create mode 100644 gen/js/app/agent/v1/agent_pb.d.ts create mode 100644 gen/js/app/agent/v1/agent_pb.js create mode 100644 gen/js/app/agent/v1/agent_pb_service.d.ts create mode 100644 gen/js/app/agent/v1/agent_pb_service.js create mode 100644 proto/viam/app/agent/v1/agent.proto diff --git a/app/agent/v1/agent.pb.go b/app/agent/v1/agent.pb.go new file mode 100644 index 000000000..7169ff97e --- /dev/null +++ b/app/agent/v1/agent.pb.go @@ -0,0 +1,1132 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: app/agent/v1/agent.proto + +package v1 + +import ( + _ "github.com/srikrsna/protoc-gen-gotag/tagger" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type PackageFormat int32 + +const ( + // unknown/unset (autodetection may be attempted) + PackageFormat_PACKAGE_FORMAT_UNSPECIFIED PackageFormat = 0 + // do nothing + PackageFormat_PACKAGE_FORMAT_RAW PackageFormat = 1 + // decompress .xz file + PackageFormat_PACKAGE_FORMAT_XZ PackageFormat = 2 + // set executable permissions + PackageFormat_PACKAGE_FORMAT_EXECUTABLE PackageFormat = 3 + // decompress and set executable + PackageFormat_PACKAGE_FORMAT_XZ_EXECUTABLE PackageFormat = 4 +) + +// Enum value maps for PackageFormat. +var ( + PackageFormat_name = map[int32]string{ + 0: "PACKAGE_FORMAT_UNSPECIFIED", + 1: "PACKAGE_FORMAT_RAW", + 2: "PACKAGE_FORMAT_XZ", + 3: "PACKAGE_FORMAT_EXECUTABLE", + 4: "PACKAGE_FORMAT_XZ_EXECUTABLE", + } + PackageFormat_value = map[string]int32{ + "PACKAGE_FORMAT_UNSPECIFIED": 0, + "PACKAGE_FORMAT_RAW": 1, + "PACKAGE_FORMAT_XZ": 2, + "PACKAGE_FORMAT_EXECUTABLE": 3, + "PACKAGE_FORMAT_XZ_EXECUTABLE": 4, + } +) + +func (x PackageFormat) Enum() *PackageFormat { + p := new(PackageFormat) + *p = x + return p +} + +func (x PackageFormat) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (PackageFormat) Descriptor() protoreflect.EnumDescriptor { + return file_app_agent_v1_agent_proto_enumTypes[0].Descriptor() +} + +func (PackageFormat) Type() protoreflect.EnumType { + return &file_app_agent_v1_agent_proto_enumTypes[0] +} + +func (x PackageFormat) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use PackageFormat.Descriptor instead. +func (PackageFormat) EnumDescriptor() ([]byte, []int) { + return file_app_agent_v1_agent_proto_rawDescGZIP(), []int{0} +} + +// App side +type GetAgentConfigRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *GetAgentConfigRequest) Reset() { + *x = GetAgentConfigRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_app_agent_v1_agent_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetAgentConfigRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAgentConfigRequest) ProtoMessage() {} + +func (x *GetAgentConfigRequest) ProtoReflect() protoreflect.Message { + mi := &file_app_agent_v1_agent_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetAgentConfigRequest.ProtoReflect.Descriptor instead. +func (*GetAgentConfigRequest) Descriptor() ([]byte, []int) { + return file_app_agent_v1_agent_proto_rawDescGZIP(), []int{0} +} + +func (x *GetAgentConfigRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type GetAgentConfigResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AgentConfig *AppAgentConfig `protobuf:"bytes,1,opt,name=agent_config,json=agentConfig,proto3" json:"agent_config,omitempty"` +} + +func (x *GetAgentConfigResponse) Reset() { + *x = GetAgentConfigResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_app_agent_v1_agent_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetAgentConfigResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAgentConfigResponse) ProtoMessage() {} + +func (x *GetAgentConfigResponse) ProtoReflect() protoreflect.Message { + mi := &file_app_agent_v1_agent_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetAgentConfigResponse.ProtoReflect.Descriptor instead. +func (*GetAgentConfigResponse) Descriptor() ([]byte, []int) { + return file_app_agent_v1_agent_proto_rawDescGZIP(), []int{1} +} + +func (x *GetAgentConfigResponse) GetAgentConfig() *AppAgentConfig { + if x != nil { + return x.AgentConfig + } + return nil +} + +type UpdateAgentConfigRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + AgentConfig *AppAgentConfig `protobuf:"bytes,2,opt,name=agent_config,json=agentConfig,proto3" json:"agent_config,omitempty"` +} + +func (x *UpdateAgentConfigRequest) Reset() { + *x = UpdateAgentConfigRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_app_agent_v1_agent_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateAgentConfigRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateAgentConfigRequest) ProtoMessage() {} + +func (x *UpdateAgentConfigRequest) ProtoReflect() protoreflect.Message { + mi := &file_app_agent_v1_agent_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateAgentConfigRequest.ProtoReflect.Descriptor instead. +func (*UpdateAgentConfigRequest) Descriptor() ([]byte, []int) { + return file_app_agent_v1_agent_proto_rawDescGZIP(), []int{2} +} + +func (x *UpdateAgentConfigRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *UpdateAgentConfigRequest) GetAgentConfig() *AppAgentConfig { + if x != nil { + return x.AgentConfig + } + return nil +} + +type UpdateAgentConfigResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AgentConfig *AppAgentConfig `protobuf:"bytes,1,opt,name=agent_config,json=agentConfig,proto3" json:"agent_config,omitempty"` +} + +func (x *UpdateAgentConfigResponse) Reset() { + *x = UpdateAgentConfigResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_app_agent_v1_agent_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateAgentConfigResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateAgentConfigResponse) ProtoMessage() {} + +func (x *UpdateAgentConfigResponse) ProtoReflect() protoreflect.Message { + mi := &file_app_agent_v1_agent_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateAgentConfigResponse.ProtoReflect.Descriptor instead. +func (*UpdateAgentConfigResponse) Descriptor() ([]byte, []int) { + return file_app_agent_v1_agent_proto_rawDescGZIP(), []int{3} +} + +func (x *UpdateAgentConfigResponse) GetAgentConfig() *AppAgentConfig { + if x != nil { + return x.AgentConfig + } + return nil +} + +type AppAgentConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SubsystemConfigs map[string]*AppSubsystemConfig `protobuf:"bytes,1,rep,name=subsystem_configs,json=subsystemConfigs,proto3" json:"subsystem_configs" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3" bson:"subsystem_configs"` +} + +func (x *AppAgentConfig) Reset() { + *x = AppAgentConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_app_agent_v1_agent_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AppAgentConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AppAgentConfig) ProtoMessage() {} + +func (x *AppAgentConfig) ProtoReflect() protoreflect.Message { + mi := &file_app_agent_v1_agent_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AppAgentConfig.ProtoReflect.Descriptor instead. +func (*AppAgentConfig) Descriptor() ([]byte, []int) { + return file_app_agent_v1_agent_proto_rawDescGZIP(), []int{4} +} + +func (x *AppAgentConfig) GetSubsystemConfigs() map[string]*AppSubsystemConfig { + if x != nil { + return x.SubsystemConfigs + } + return nil +} + +type AppSubsystemConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ReleaseChannel string `protobuf:"bytes,1,opt,name=release_channel,json=releaseChannel,proto3" json:"release_channel" bson:"release_channel"` + PinVersion string `protobuf:"bytes,2,opt,name=pin_version,json=pinVersion,proto3" json:"pin_version" bson:"pin_version"` + PinUrl string `protobuf:"bytes,3,opt,name=pin_url,json=pinUrl,proto3" json:"pin_url" bson:"pin_url"` + DisableSubsystem bool `protobuf:"varint,4,opt,name=disable_subsystem,json=disableSubsystem,proto3" json:"disable_subsystem" bson:"disable_subsystem"` +} + +func (x *AppSubsystemConfig) Reset() { + *x = AppSubsystemConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_app_agent_v1_agent_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AppSubsystemConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AppSubsystemConfig) ProtoMessage() {} + +func (x *AppSubsystemConfig) ProtoReflect() protoreflect.Message { + mi := &file_app_agent_v1_agent_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AppSubsystemConfig.ProtoReflect.Descriptor instead. +func (*AppSubsystemConfig) Descriptor() ([]byte, []int) { + return file_app_agent_v1_agent_proto_rawDescGZIP(), []int{5} +} + +func (x *AppSubsystemConfig) GetReleaseChannel() string { + if x != nil { + return x.ReleaseChannel + } + return "" +} + +func (x *AppSubsystemConfig) GetPinVersion() string { + if x != nil { + return x.PinVersion + } + return "" +} + +func (x *AppSubsystemConfig) GetPinUrl() string { + if x != nil { + return x.PinUrl + } + return "" +} + +func (x *AppSubsystemConfig) GetDisableSubsystem() bool { + if x != nil { + return x.DisableSubsystem + } + return false +} + +// Device side +type DeviceAgentConfigRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // robot partID + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // info about the host system + HostInfo *HostInfo `protobuf:"bytes,2,opt,name=host_info,json=hostInfo,proto3" json:"host_info,omitempty"` + // current subsystems and versions + SubsystemVersions map[string]string `protobuf:"bytes,3,rep,name=subsystem_versions,json=subsystemVersions,proto3" json:"subsystem_versions,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *DeviceAgentConfigRequest) Reset() { + *x = DeviceAgentConfigRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_app_agent_v1_agent_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeviceAgentConfigRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeviceAgentConfigRequest) ProtoMessage() {} + +func (x *DeviceAgentConfigRequest) ProtoReflect() protoreflect.Message { + mi := &file_app_agent_v1_agent_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeviceAgentConfigRequest.ProtoReflect.Descriptor instead. +func (*DeviceAgentConfigRequest) Descriptor() ([]byte, []int) { + return file_app_agent_v1_agent_proto_rawDescGZIP(), []int{6} +} + +func (x *DeviceAgentConfigRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *DeviceAgentConfigRequest) GetHostInfo() *HostInfo { + if x != nil { + return x.HostInfo + } + return nil +} + +func (x *DeviceAgentConfigRequest) GetSubsystemVersions() map[string]string { + if x != nil { + return x.SubsystemVersions + } + return nil +} + +type DeviceAgentConfigResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // subsystems to be installed/configured/updated + // note: previously installed subsystems will be removed from the system if removed from this list + SubsystemConfigs map[string]*DeviceSubsystemConfig `protobuf:"bytes,1,rep,name=subsystem_configs,json=subsystemConfigs,proto3" json:"subsystem_configs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // how often this request should be repeated + CheckInterval *durationpb.Duration `protobuf:"bytes,2,opt,name=check_interval,json=checkInterval,proto3" json:"check_interval,omitempty"` +} + +func (x *DeviceAgentConfigResponse) Reset() { + *x = DeviceAgentConfigResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_app_agent_v1_agent_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeviceAgentConfigResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeviceAgentConfigResponse) ProtoMessage() {} + +func (x *DeviceAgentConfigResponse) ProtoReflect() protoreflect.Message { + mi := &file_app_agent_v1_agent_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeviceAgentConfigResponse.ProtoReflect.Descriptor instead. +func (*DeviceAgentConfigResponse) Descriptor() ([]byte, []int) { + return file_app_agent_v1_agent_proto_rawDescGZIP(), []int{7} +} + +func (x *DeviceAgentConfigResponse) GetSubsystemConfigs() map[string]*DeviceSubsystemConfig { + if x != nil { + return x.SubsystemConfigs + } + return nil +} + +func (x *DeviceAgentConfigResponse) GetCheckInterval() *durationpb.Duration { + if x != nil { + return x.CheckInterval + } + return nil +} + +type DeviceSubsystemConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // data needed to download/validate the subsystem + UpdateInfo *SubsystemUpdateInfo `protobuf:"bytes,1,opt,name=update_info,json=updateInfo,proto3" json:"update_info,omitempty"` + // if this subsystem is disabled and should not be started by the agent + Disable bool `protobuf:"varint,2,opt,name=disable,proto3" json:"disable,omitempty"` + // force_restart will restart the subsystem, even if no updates are available + ForceRestart bool `protobuf:"varint,3,opt,name=force_restart,json=forceRestart,proto3" json:"force_restart,omitempty"` +} + +func (x *DeviceSubsystemConfig) Reset() { + *x = DeviceSubsystemConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_app_agent_v1_agent_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeviceSubsystemConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeviceSubsystemConfig) ProtoMessage() {} + +func (x *DeviceSubsystemConfig) ProtoReflect() protoreflect.Message { + mi := &file_app_agent_v1_agent_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeviceSubsystemConfig.ProtoReflect.Descriptor instead. +func (*DeviceSubsystemConfig) Descriptor() ([]byte, []int) { + return file_app_agent_v1_agent_proto_rawDescGZIP(), []int{8} +} + +func (x *DeviceSubsystemConfig) GetUpdateInfo() *SubsystemUpdateInfo { + if x != nil { + return x.UpdateInfo + } + return nil +} + +func (x *DeviceSubsystemConfig) GetDisable() bool { + if x != nil { + return x.Disable + } + return false +} + +func (x *DeviceSubsystemConfig) GetForceRestart() bool { + if x != nil { + return x.ForceRestart + } + return false +} + +type HostInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // platform is the docker styled combination of kernel and architecture. Ex: linux/amd64, darwin/arm64 + Platform string `protobuf:"bytes,1,opt,name=platform,proto3" json:"platform,omitempty"` + // ID and VERSION_ID fields from /etc/os-release, colon seperated. Ex: ubuntu:22.04, debian:11 + Distro string `protobuf:"bytes,2,opt,name=distro,proto3" json:"distro,omitempty"` + // additional tags for specific hardware or software that's present and may affect software selection + // ex: "jetson", "rpi4", "systemd", etc. + Tags []string `protobuf:"bytes,3,rep,name=tags,proto3" json:"tags,omitempty"` +} + +func (x *HostInfo) Reset() { + *x = HostInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_app_agent_v1_agent_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HostInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HostInfo) ProtoMessage() {} + +func (x *HostInfo) ProtoReflect() protoreflect.Message { + mi := &file_app_agent_v1_agent_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HostInfo.ProtoReflect.Descriptor instead. +func (*HostInfo) Descriptor() ([]byte, []int) { + return file_app_agent_v1_agent_proto_rawDescGZIP(), []int{9} +} + +func (x *HostInfo) GetPlatform() string { + if x != nil { + return x.Platform + } + return "" +} + +func (x *HostInfo) GetDistro() string { + if x != nil { + return x.Distro + } + return "" +} + +func (x *HostInfo) GetTags() []string { + if x != nil { + return x.Tags + } + return nil +} + +type SubsystemUpdateInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // unpacked filename as it is expected on disk (regardless of url) + Filename string `protobuf:"bytes,1,opt,name=filename,proto3" json:"filename,omitempty"` + // url to download from + Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` + // version expected at the url + Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` + // sha256 sum of file as downloaded + Sha256 []byte `protobuf:"bytes,4,opt,name=sha256,proto3" json:"sha256,omitempty"` + // determines if decompression or executable permissions are needed + Format PackageFormat `protobuf:"varint,5,opt,name=format,proto3,enum=viam.app.agent.v1.PackageFormat" json:"format,omitempty"` +} + +func (x *SubsystemUpdateInfo) Reset() { + *x = SubsystemUpdateInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_app_agent_v1_agent_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SubsystemUpdateInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SubsystemUpdateInfo) ProtoMessage() {} + +func (x *SubsystemUpdateInfo) ProtoReflect() protoreflect.Message { + mi := &file_app_agent_v1_agent_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SubsystemUpdateInfo.ProtoReflect.Descriptor instead. +func (*SubsystemUpdateInfo) Descriptor() ([]byte, []int) { + return file_app_agent_v1_agent_proto_rawDescGZIP(), []int{10} +} + +func (x *SubsystemUpdateInfo) GetFilename() string { + if x != nil { + return x.Filename + } + return "" +} + +func (x *SubsystemUpdateInfo) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +func (x *SubsystemUpdateInfo) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *SubsystemUpdateInfo) GetSha256() []byte { + if x != nil { + return x.Sha256 + } + return nil +} + +func (x *SubsystemUpdateInfo) GetFormat() PackageFormat { + if x != nil { + return x.Format + } + return PackageFormat_PACKAGE_FORMAT_UNSPECIFIED +} + +var File_app_agent_v1_agent_proto protoreflect.FileDescriptor + +var file_app_agent_v1_agent_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x61, 0x70, 0x70, 0x2f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x61, + 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x76, 0x69, 0x61, 0x6d, + 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x1a, 0x1e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x74, + 0x61, 0x67, 0x67, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x61, 0x67, 0x67, 0x65, 0x72, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x27, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x41, 0x67, 0x65, 0x6e, + 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x5e, + 0x0a, 0x16, 0x47, 0x65, 0x74, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x0c, 0x61, 0x67, 0x65, 0x6e, + 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, + 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, + 0x76, 0x31, 0x2e, 0x41, 0x70, 0x70, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x52, 0x0b, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x70, + 0x0a, 0x18, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x44, 0x0a, 0x0c, 0x61, 0x67, + 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x21, 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x61, 0x67, 0x65, 0x6e, + 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x70, 0x70, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x52, 0x0b, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x22, 0x61, 0x0a, 0x19, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, + 0x0c, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x61, + 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x70, 0x70, 0x41, 0x67, 0x65, 0x6e, 0x74, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0b, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x22, 0x9b, 0x02, 0x0a, 0x0e, 0x41, 0x70, 0x70, 0x41, 0x67, 0x65, 0x6e, 0x74, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x9c, 0x01, 0x0a, 0x11, 0x73, 0x75, 0x62, 0x73, 0x79, + 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x61, 0x67, + 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x70, 0x70, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x36, 0x9a, 0x84, 0x9e, + 0x03, 0x31, 0x62, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x73, 0x75, 0x62, 0x73, 0x79, 0x73, 0x74, 0x65, + 0x6d, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x22, 0x20, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, + 0x22, 0x73, 0x75, 0x62, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x73, 0x22, 0x52, 0x10, 0x73, 0x75, 0x62, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x73, 0x1a, 0x6a, 0x0a, 0x15, 0x53, 0x75, 0x62, 0x73, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x3b, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x25, 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, + 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x70, 0x70, 0x53, 0x75, 0x62, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x22, 0xe0, 0x02, 0x0a, 0x12, 0x41, 0x70, 0x70, 0x53, 0x75, 0x62, 0x73, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x5b, 0x0a, 0x0f, 0x72, 0x65, 0x6c, 0x65, + 0x61, 0x73, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x32, 0x9a, 0x84, 0x9e, 0x03, 0x2d, 0x62, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x72, 0x65, + 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x22, 0x20, 0x6a, + 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x63, 0x68, 0x61, + 0x6e, 0x6e, 0x65, 0x6c, 0x22, 0x52, 0x0e, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x43, 0x68, + 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x4b, 0x0a, 0x0b, 0x70, 0x69, 0x6e, 0x5f, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2a, 0x9a, 0x84, 0x9e, 0x03, + 0x25, 0x62, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x70, 0x69, 0x6e, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x22, 0x20, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x70, 0x69, 0x6e, 0x5f, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x52, 0x0a, 0x70, 0x69, 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x3b, 0x0a, 0x07, 0x70, 0x69, 0x6e, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x22, 0x9a, 0x84, 0x9e, 0x03, 0x1d, 0x62, 0x73, 0x6f, 0x6e, 0x3a, 0x22, + 0x70, 0x69, 0x6e, 0x5f, 0x75, 0x72, 0x6c, 0x22, 0x20, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x70, + 0x69, 0x6e, 0x5f, 0x75, 0x72, 0x6c, 0x22, 0x52, 0x06, 0x70, 0x69, 0x6e, 0x55, 0x72, 0x6c, 0x12, + 0x63, 0x0a, 0x11, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x75, 0x62, 0x73, 0x79, + 0x73, 0x74, 0x65, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x42, 0x36, 0x9a, 0x84, 0x9e, 0x03, + 0x31, 0x62, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, + 0x75, 0x62, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x22, 0x20, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, + 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x75, 0x62, 0x73, 0x79, 0x73, 0x74, 0x65, + 0x6d, 0x22, 0x52, 0x10, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x75, 0x62, 0x73, 0x79, + 0x73, 0x74, 0x65, 0x6d, 0x22, 0x9d, 0x02, 0x0a, 0x18, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x41, + 0x67, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x38, 0x0a, 0x09, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x2e, + 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x6f, 0x73, 0x74, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x71, 0x0a, 0x12, 0x73, + 0x75, 0x62, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x42, 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x61, + 0x70, 0x70, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x76, 0x69, + 0x63, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x56, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x73, 0x75, 0x62, + 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x44, + 0x0a, 0x16, 0x53, 0x75, 0x62, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x56, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x22, 0xbd, 0x02, 0x0a, 0x19, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x41, + 0x67, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x6f, 0x0a, 0x11, 0x73, 0x75, 0x62, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x42, 0x2e, + 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x76, + 0x31, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x75, 0x62, 0x73, + 0x79, 0x73, 0x74, 0x65, 0x6d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x10, 0x73, 0x75, 0x62, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x73, 0x12, 0x40, 0x0a, 0x0e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x6e, 0x74, + 0x65, 0x72, 0x76, 0x61, 0x6c, 0x1a, 0x6d, 0x0a, 0x15, 0x53, 0x75, 0x62, 0x73, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x3e, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x28, 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, + 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, 0x75, 0x62, 0x73, 0x79, 0x73, + 0x74, 0x65, 0x6d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x22, 0x9f, 0x01, 0x0a, 0x15, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, + 0x75, 0x62, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x47, + 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x61, + 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x79, 0x73, 0x74, 0x65, + 0x6d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x69, 0x73, 0x61, 0x62, + 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, + 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x52, + 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x22, 0x52, 0x0a, 0x08, 0x48, 0x6f, 0x73, 0x74, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x16, + 0x0a, 0x06, 0x64, 0x69, 0x73, 0x74, 0x72, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x64, 0x69, 0x73, 0x74, 0x72, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x22, 0xaf, 0x01, 0x0a, 0x13, 0x53, + 0x75, 0x62, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, + 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, + 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x68, + 0x61, 0x32, 0x35, 0x36, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, 0x68, 0x61, 0x32, + 0x35, 0x36, 0x12, 0x38, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x61, 0x67, + 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x46, 0x6f, + 0x72, 0x6d, 0x61, 0x74, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2a, 0x9f, 0x01, 0x0a, + 0x0d, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x1e, + 0x0a, 0x1a, 0x50, 0x41, 0x43, 0x4b, 0x41, 0x47, 0x45, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, + 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x16, + 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x41, 0x47, 0x45, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, + 0x5f, 0x52, 0x41, 0x57, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x50, 0x41, 0x43, 0x4b, 0x41, 0x47, + 0x45, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x58, 0x5a, 0x10, 0x02, 0x12, 0x1d, 0x0a, + 0x19, 0x50, 0x41, 0x43, 0x4b, 0x41, 0x47, 0x45, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, + 0x45, 0x58, 0x45, 0x43, 0x55, 0x54, 0x41, 0x42, 0x4c, 0x45, 0x10, 0x03, 0x12, 0x20, 0x0a, 0x1c, + 0x50, 0x41, 0x43, 0x4b, 0x41, 0x47, 0x45, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x58, + 0x5a, 0x5f, 0x45, 0x58, 0x45, 0x43, 0x55, 0x54, 0x41, 0x42, 0x4c, 0x45, 0x10, 0x04, 0x32, 0xe8, + 0x01, 0x0a, 0x0f, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x41, 0x70, 0x70, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x65, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x12, 0x28, 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x2e, + 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x67, 0x65, 0x6e, + 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, + 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, + 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6e, 0x0a, 0x11, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2b, + 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, + 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x76, 0x69, + 0x61, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x84, 0x01, 0x0a, 0x12, 0x41, 0x67, + 0x65, 0x6e, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x6e, 0x0a, 0x11, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2b, 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x61, 0x70, 0x70, + 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, + 0x41, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x61, 0x67, + 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x41, 0x67, 0x65, + 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x42, 0x1e, 0x5a, 0x1c, 0x67, 0x6f, 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x76, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_app_agent_v1_agent_proto_rawDescOnce sync.Once + file_app_agent_v1_agent_proto_rawDescData = file_app_agent_v1_agent_proto_rawDesc +) + +func file_app_agent_v1_agent_proto_rawDescGZIP() []byte { + file_app_agent_v1_agent_proto_rawDescOnce.Do(func() { + file_app_agent_v1_agent_proto_rawDescData = protoimpl.X.CompressGZIP(file_app_agent_v1_agent_proto_rawDescData) + }) + return file_app_agent_v1_agent_proto_rawDescData +} + +var file_app_agent_v1_agent_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_app_agent_v1_agent_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_app_agent_v1_agent_proto_goTypes = []interface{}{ + (PackageFormat)(0), // 0: viam.app.agent.v1.PackageFormat + (*GetAgentConfigRequest)(nil), // 1: viam.app.agent.v1.GetAgentConfigRequest + (*GetAgentConfigResponse)(nil), // 2: viam.app.agent.v1.GetAgentConfigResponse + (*UpdateAgentConfigRequest)(nil), // 3: viam.app.agent.v1.UpdateAgentConfigRequest + (*UpdateAgentConfigResponse)(nil), // 4: viam.app.agent.v1.UpdateAgentConfigResponse + (*AppAgentConfig)(nil), // 5: viam.app.agent.v1.AppAgentConfig + (*AppSubsystemConfig)(nil), // 6: viam.app.agent.v1.AppSubsystemConfig + (*DeviceAgentConfigRequest)(nil), // 7: viam.app.agent.v1.DeviceAgentConfigRequest + (*DeviceAgentConfigResponse)(nil), // 8: viam.app.agent.v1.DeviceAgentConfigResponse + (*DeviceSubsystemConfig)(nil), // 9: viam.app.agent.v1.DeviceSubsystemConfig + (*HostInfo)(nil), // 10: viam.app.agent.v1.HostInfo + (*SubsystemUpdateInfo)(nil), // 11: viam.app.agent.v1.SubsystemUpdateInfo + nil, // 12: viam.app.agent.v1.AppAgentConfig.SubsystemConfigsEntry + nil, // 13: viam.app.agent.v1.DeviceAgentConfigRequest.SubsystemVersionsEntry + nil, // 14: viam.app.agent.v1.DeviceAgentConfigResponse.SubsystemConfigsEntry + (*durationpb.Duration)(nil), // 15: google.protobuf.Duration +} +var file_app_agent_v1_agent_proto_depIdxs = []int32{ + 5, // 0: viam.app.agent.v1.GetAgentConfigResponse.agent_config:type_name -> viam.app.agent.v1.AppAgentConfig + 5, // 1: viam.app.agent.v1.UpdateAgentConfigRequest.agent_config:type_name -> viam.app.agent.v1.AppAgentConfig + 5, // 2: viam.app.agent.v1.UpdateAgentConfigResponse.agent_config:type_name -> viam.app.agent.v1.AppAgentConfig + 12, // 3: viam.app.agent.v1.AppAgentConfig.subsystem_configs:type_name -> viam.app.agent.v1.AppAgentConfig.SubsystemConfigsEntry + 10, // 4: viam.app.agent.v1.DeviceAgentConfigRequest.host_info:type_name -> viam.app.agent.v1.HostInfo + 13, // 5: viam.app.agent.v1.DeviceAgentConfigRequest.subsystem_versions:type_name -> viam.app.agent.v1.DeviceAgentConfigRequest.SubsystemVersionsEntry + 14, // 6: viam.app.agent.v1.DeviceAgentConfigResponse.subsystem_configs:type_name -> viam.app.agent.v1.DeviceAgentConfigResponse.SubsystemConfigsEntry + 15, // 7: viam.app.agent.v1.DeviceAgentConfigResponse.check_interval:type_name -> google.protobuf.Duration + 11, // 8: viam.app.agent.v1.DeviceSubsystemConfig.update_info:type_name -> viam.app.agent.v1.SubsystemUpdateInfo + 0, // 9: viam.app.agent.v1.SubsystemUpdateInfo.format:type_name -> viam.app.agent.v1.PackageFormat + 6, // 10: viam.app.agent.v1.AppAgentConfig.SubsystemConfigsEntry.value:type_name -> viam.app.agent.v1.AppSubsystemConfig + 9, // 11: viam.app.agent.v1.DeviceAgentConfigResponse.SubsystemConfigsEntry.value:type_name -> viam.app.agent.v1.DeviceSubsystemConfig + 1, // 12: viam.app.agent.v1.AgentAppService.GetAgentConfig:input_type -> viam.app.agent.v1.GetAgentConfigRequest + 3, // 13: viam.app.agent.v1.AgentAppService.UpdateAgentConfig:input_type -> viam.app.agent.v1.UpdateAgentConfigRequest + 7, // 14: viam.app.agent.v1.AgentDeviceService.DeviceAgentConfig:input_type -> viam.app.agent.v1.DeviceAgentConfigRequest + 2, // 15: viam.app.agent.v1.AgentAppService.GetAgentConfig:output_type -> viam.app.agent.v1.GetAgentConfigResponse + 4, // 16: viam.app.agent.v1.AgentAppService.UpdateAgentConfig:output_type -> viam.app.agent.v1.UpdateAgentConfigResponse + 8, // 17: viam.app.agent.v1.AgentDeviceService.DeviceAgentConfig:output_type -> viam.app.agent.v1.DeviceAgentConfigResponse + 15, // [15:18] is the sub-list for method output_type + 12, // [12:15] is the sub-list for method input_type + 12, // [12:12] is the sub-list for extension type_name + 12, // [12:12] is the sub-list for extension extendee + 0, // [0:12] is the sub-list for field type_name +} + +func init() { file_app_agent_v1_agent_proto_init() } +func file_app_agent_v1_agent_proto_init() { + if File_app_agent_v1_agent_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_app_agent_v1_agent_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAgentConfigRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_app_agent_v1_agent_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAgentConfigResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_app_agent_v1_agent_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateAgentConfigRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_app_agent_v1_agent_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateAgentConfigResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_app_agent_v1_agent_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AppAgentConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_app_agent_v1_agent_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AppSubsystemConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_app_agent_v1_agent_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeviceAgentConfigRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_app_agent_v1_agent_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeviceAgentConfigResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_app_agent_v1_agent_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeviceSubsystemConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_app_agent_v1_agent_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HostInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_app_agent_v1_agent_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SubsystemUpdateInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_app_agent_v1_agent_proto_rawDesc, + NumEnums: 1, + NumMessages: 14, + NumExtensions: 0, + NumServices: 2, + }, + GoTypes: file_app_agent_v1_agent_proto_goTypes, + DependencyIndexes: file_app_agent_v1_agent_proto_depIdxs, + EnumInfos: file_app_agent_v1_agent_proto_enumTypes, + MessageInfos: file_app_agent_v1_agent_proto_msgTypes, + }.Build() + File_app_agent_v1_agent_proto = out.File + file_app_agent_v1_agent_proto_rawDesc = nil + file_app_agent_v1_agent_proto_goTypes = nil + file_app_agent_v1_agent_proto_depIdxs = nil +} diff --git a/app/agent/v1/agent.pb.gw.go b/app/agent/v1/agent.pb.gw.go new file mode 100644 index 000000000..9b26a2713 --- /dev/null +++ b/app/agent/v1/agent.pb.gw.go @@ -0,0 +1,395 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: app/agent/v1/agent.proto + +/* +Package v1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package v1 + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_AgentAppService_GetAgentConfig_0(ctx context.Context, marshaler runtime.Marshaler, client AgentAppServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetAgentConfigRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetAgentConfig(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_AgentAppService_GetAgentConfig_0(ctx context.Context, marshaler runtime.Marshaler, server AgentAppServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetAgentConfigRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetAgentConfig(ctx, &protoReq) + return msg, metadata, err + +} + +func request_AgentAppService_UpdateAgentConfig_0(ctx context.Context, marshaler runtime.Marshaler, client AgentAppServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateAgentConfigRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UpdateAgentConfig(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_AgentAppService_UpdateAgentConfig_0(ctx context.Context, marshaler runtime.Marshaler, server AgentAppServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateAgentConfigRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UpdateAgentConfig(ctx, &protoReq) + return msg, metadata, err + +} + +func request_AgentDeviceService_DeviceAgentConfig_0(ctx context.Context, marshaler runtime.Marshaler, client AgentDeviceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeviceAgentConfigRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DeviceAgentConfig(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_AgentDeviceService_DeviceAgentConfig_0(ctx context.Context, marshaler runtime.Marshaler, server AgentDeviceServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeviceAgentConfigRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DeviceAgentConfig(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterAgentAppServiceHandlerServer registers the http handlers for service AgentAppService to "mux". +// UnaryRPC :call AgentAppServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAgentAppServiceHandlerFromEndpoint instead. +func RegisterAgentAppServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AgentAppServiceServer) error { + + mux.Handle("POST", pattern_AgentAppService_GetAgentConfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/viam.app.agent.v1.AgentAppService/GetAgentConfig", runtime.WithHTTPPathPattern("/viam.app.agent.v1.AgentAppService/GetAgentConfig")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_AgentAppService_GetAgentConfig_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_AgentAppService_GetAgentConfig_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_AgentAppService_UpdateAgentConfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/viam.app.agent.v1.AgentAppService/UpdateAgentConfig", runtime.WithHTTPPathPattern("/viam.app.agent.v1.AgentAppService/UpdateAgentConfig")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_AgentAppService_UpdateAgentConfig_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_AgentAppService_UpdateAgentConfig_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterAgentDeviceServiceHandlerServer registers the http handlers for service AgentDeviceService to "mux". +// UnaryRPC :call AgentDeviceServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAgentDeviceServiceHandlerFromEndpoint instead. +func RegisterAgentDeviceServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AgentDeviceServiceServer) error { + + mux.Handle("POST", pattern_AgentDeviceService_DeviceAgentConfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/viam.app.agent.v1.AgentDeviceService/DeviceAgentConfig", runtime.WithHTTPPathPattern("/viam.app.agent.v1.AgentDeviceService/DeviceAgentConfig")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_AgentDeviceService_DeviceAgentConfig_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_AgentDeviceService_DeviceAgentConfig_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterAgentAppServiceHandlerFromEndpoint is same as RegisterAgentAppServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterAgentAppServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterAgentAppServiceHandler(ctx, mux, conn) +} + +// RegisterAgentAppServiceHandler registers the http handlers for service AgentAppService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterAgentAppServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterAgentAppServiceHandlerClient(ctx, mux, NewAgentAppServiceClient(conn)) +} + +// RegisterAgentAppServiceHandlerClient registers the http handlers for service AgentAppService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AgentAppServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AgentAppServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "AgentAppServiceClient" to call the correct interceptors. +func RegisterAgentAppServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AgentAppServiceClient) error { + + mux.Handle("POST", pattern_AgentAppService_GetAgentConfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/viam.app.agent.v1.AgentAppService/GetAgentConfig", runtime.WithHTTPPathPattern("/viam.app.agent.v1.AgentAppService/GetAgentConfig")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_AgentAppService_GetAgentConfig_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_AgentAppService_GetAgentConfig_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_AgentAppService_UpdateAgentConfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/viam.app.agent.v1.AgentAppService/UpdateAgentConfig", runtime.WithHTTPPathPattern("/viam.app.agent.v1.AgentAppService/UpdateAgentConfig")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_AgentAppService_UpdateAgentConfig_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_AgentAppService_UpdateAgentConfig_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_AgentAppService_GetAgentConfig_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"viam.app.agent.v1.AgentAppService", "GetAgentConfig"}, "")) + + pattern_AgentAppService_UpdateAgentConfig_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"viam.app.agent.v1.AgentAppService", "UpdateAgentConfig"}, "")) +) + +var ( + forward_AgentAppService_GetAgentConfig_0 = runtime.ForwardResponseMessage + + forward_AgentAppService_UpdateAgentConfig_0 = runtime.ForwardResponseMessage +) + +// RegisterAgentDeviceServiceHandlerFromEndpoint is same as RegisterAgentDeviceServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterAgentDeviceServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterAgentDeviceServiceHandler(ctx, mux, conn) +} + +// RegisterAgentDeviceServiceHandler registers the http handlers for service AgentDeviceService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterAgentDeviceServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterAgentDeviceServiceHandlerClient(ctx, mux, NewAgentDeviceServiceClient(conn)) +} + +// RegisterAgentDeviceServiceHandlerClient registers the http handlers for service AgentDeviceService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AgentDeviceServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AgentDeviceServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "AgentDeviceServiceClient" to call the correct interceptors. +func RegisterAgentDeviceServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AgentDeviceServiceClient) error { + + mux.Handle("POST", pattern_AgentDeviceService_DeviceAgentConfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/viam.app.agent.v1.AgentDeviceService/DeviceAgentConfig", runtime.WithHTTPPathPattern("/viam.app.agent.v1.AgentDeviceService/DeviceAgentConfig")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_AgentDeviceService_DeviceAgentConfig_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_AgentDeviceService_DeviceAgentConfig_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_AgentDeviceService_DeviceAgentConfig_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"viam.app.agent.v1.AgentDeviceService", "DeviceAgentConfig"}, "")) +) + +var ( + forward_AgentDeviceService_DeviceAgentConfig_0 = runtime.ForwardResponseMessage +) diff --git a/app/agent/v1/agent_grpc.pb.go b/app/agent/v1/agent_grpc.pb.go new file mode 100644 index 000000000..e7e7a11e6 --- /dev/null +++ b/app/agent/v1/agent_grpc.pb.go @@ -0,0 +1,233 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc (unknown) +// source: app/agent/v1/agent.proto + +package v1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// AgentAppServiceClient is the client API for AgentAppService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type AgentAppServiceClient interface { + // GetAgentConfig is for retrieving config in App. + GetAgentConfig(ctx context.Context, in *GetAgentConfigRequest, opts ...grpc.CallOption) (*GetAgentConfigResponse, error) + // UpdateAgentConfig is for editing config in App. + UpdateAgentConfig(ctx context.Context, in *UpdateAgentConfigRequest, opts ...grpc.CallOption) (*UpdateAgentConfigResponse, error) +} + +type agentAppServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewAgentAppServiceClient(cc grpc.ClientConnInterface) AgentAppServiceClient { + return &agentAppServiceClient{cc} +} + +func (c *agentAppServiceClient) GetAgentConfig(ctx context.Context, in *GetAgentConfigRequest, opts ...grpc.CallOption) (*GetAgentConfigResponse, error) { + out := new(GetAgentConfigResponse) + err := c.cc.Invoke(ctx, "/viam.app.agent.v1.AgentAppService/GetAgentConfig", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *agentAppServiceClient) UpdateAgentConfig(ctx context.Context, in *UpdateAgentConfigRequest, opts ...grpc.CallOption) (*UpdateAgentConfigResponse, error) { + out := new(UpdateAgentConfigResponse) + err := c.cc.Invoke(ctx, "/viam.app.agent.v1.AgentAppService/UpdateAgentConfig", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AgentAppServiceServer is the server API for AgentAppService service. +// All implementations must embed UnimplementedAgentAppServiceServer +// for forward compatibility +type AgentAppServiceServer interface { + // GetAgentConfig is for retrieving config in App. + GetAgentConfig(context.Context, *GetAgentConfigRequest) (*GetAgentConfigResponse, error) + // UpdateAgentConfig is for editing config in App. + UpdateAgentConfig(context.Context, *UpdateAgentConfigRequest) (*UpdateAgentConfigResponse, error) + mustEmbedUnimplementedAgentAppServiceServer() +} + +// UnimplementedAgentAppServiceServer must be embedded to have forward compatible implementations. +type UnimplementedAgentAppServiceServer struct { +} + +func (UnimplementedAgentAppServiceServer) GetAgentConfig(context.Context, *GetAgentConfigRequest) (*GetAgentConfigResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAgentConfig not implemented") +} +func (UnimplementedAgentAppServiceServer) UpdateAgentConfig(context.Context, *UpdateAgentConfigRequest) (*UpdateAgentConfigResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateAgentConfig not implemented") +} +func (UnimplementedAgentAppServiceServer) mustEmbedUnimplementedAgentAppServiceServer() {} + +// UnsafeAgentAppServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to AgentAppServiceServer will +// result in compilation errors. +type UnsafeAgentAppServiceServer interface { + mustEmbedUnimplementedAgentAppServiceServer() +} + +func RegisterAgentAppServiceServer(s grpc.ServiceRegistrar, srv AgentAppServiceServer) { + s.RegisterService(&AgentAppService_ServiceDesc, srv) +} + +func _AgentAppService_GetAgentConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetAgentConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AgentAppServiceServer).GetAgentConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/viam.app.agent.v1.AgentAppService/GetAgentConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AgentAppServiceServer).GetAgentConfig(ctx, req.(*GetAgentConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AgentAppService_UpdateAgentConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateAgentConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AgentAppServiceServer).UpdateAgentConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/viam.app.agent.v1.AgentAppService/UpdateAgentConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AgentAppServiceServer).UpdateAgentConfig(ctx, req.(*UpdateAgentConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// AgentAppService_ServiceDesc is the grpc.ServiceDesc for AgentAppService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var AgentAppService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "viam.app.agent.v1.AgentAppService", + HandlerType: (*AgentAppServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetAgentConfig", + Handler: _AgentAppService_GetAgentConfig_Handler, + }, + { + MethodName: "UpdateAgentConfig", + Handler: _AgentAppService_UpdateAgentConfig_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "app/agent/v1/agent.proto", +} + +// AgentDeviceServiceClient is the client API for AgentDeviceService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type AgentDeviceServiceClient interface { + // DeviceAgentConfig is for retrieving config by the on-device agent. + DeviceAgentConfig(ctx context.Context, in *DeviceAgentConfigRequest, opts ...grpc.CallOption) (*DeviceAgentConfigResponse, error) +} + +type agentDeviceServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewAgentDeviceServiceClient(cc grpc.ClientConnInterface) AgentDeviceServiceClient { + return &agentDeviceServiceClient{cc} +} + +func (c *agentDeviceServiceClient) DeviceAgentConfig(ctx context.Context, in *DeviceAgentConfigRequest, opts ...grpc.CallOption) (*DeviceAgentConfigResponse, error) { + out := new(DeviceAgentConfigResponse) + err := c.cc.Invoke(ctx, "/viam.app.agent.v1.AgentDeviceService/DeviceAgentConfig", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AgentDeviceServiceServer is the server API for AgentDeviceService service. +// All implementations must embed UnimplementedAgentDeviceServiceServer +// for forward compatibility +type AgentDeviceServiceServer interface { + // DeviceAgentConfig is for retrieving config by the on-device agent. + DeviceAgentConfig(context.Context, *DeviceAgentConfigRequest) (*DeviceAgentConfigResponse, error) + mustEmbedUnimplementedAgentDeviceServiceServer() +} + +// UnimplementedAgentDeviceServiceServer must be embedded to have forward compatible implementations. +type UnimplementedAgentDeviceServiceServer struct { +} + +func (UnimplementedAgentDeviceServiceServer) DeviceAgentConfig(context.Context, *DeviceAgentConfigRequest) (*DeviceAgentConfigResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeviceAgentConfig not implemented") +} +func (UnimplementedAgentDeviceServiceServer) mustEmbedUnimplementedAgentDeviceServiceServer() {} + +// UnsafeAgentDeviceServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to AgentDeviceServiceServer will +// result in compilation errors. +type UnsafeAgentDeviceServiceServer interface { + mustEmbedUnimplementedAgentDeviceServiceServer() +} + +func RegisterAgentDeviceServiceServer(s grpc.ServiceRegistrar, srv AgentDeviceServiceServer) { + s.RegisterService(&AgentDeviceService_ServiceDesc, srv) +} + +func _AgentDeviceService_DeviceAgentConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeviceAgentConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AgentDeviceServiceServer).DeviceAgentConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/viam.app.agent.v1.AgentDeviceService/DeviceAgentConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AgentDeviceServiceServer).DeviceAgentConfig(ctx, req.(*DeviceAgentConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// AgentDeviceService_ServiceDesc is the grpc.ServiceDesc for AgentDeviceService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var AgentDeviceService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "viam.app.agent.v1.AgentDeviceService", + HandlerType: (*AgentDeviceServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "DeviceAgentConfig", + Handler: _AgentDeviceService_DeviceAgentConfig_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "app/agent/v1/agent.proto", +} diff --git a/component/arm/v1/arm.pb.gw.go b/component/arm/v1/arm.pb.gw.go index 90c742bb6..e9d51a96f 100644 --- a/component/arm/v1/arm.pb.gw.go +++ b/component/arm/v1/arm.pb.gw.go @@ -15,7 +15,7 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - v1_0 "go.viam.com/api/common/v1" + "go.viam.com/api/common/v1" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" @@ -439,7 +439,7 @@ var ( ) func request_ArmService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, client ArmServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1_0.DoCommandRequest + var protoReq v1.DoCommandRequest var metadata runtime.ServerMetadata var ( @@ -472,7 +472,7 @@ func request_ArmService_DoCommand_0(ctx context.Context, marshaler runtime.Marsh } func local_request_ArmService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, server ArmServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1_0.DoCommandRequest + var protoReq v1.DoCommandRequest var metadata runtime.ServerMetadata var ( @@ -509,7 +509,7 @@ var ( ) func request_ArmService_GetKinematics_0(ctx context.Context, marshaler runtime.Marshaler, client ArmServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1_0.GetKinematicsRequest + var protoReq v1.GetKinematicsRequest var metadata runtime.ServerMetadata var ( @@ -542,7 +542,7 @@ func request_ArmService_GetKinematics_0(ctx context.Context, marshaler runtime.M } func local_request_ArmService_GetKinematics_0(ctx context.Context, marshaler runtime.Marshaler, server ArmServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1_0.GetKinematicsRequest + var protoReq v1.GetKinematicsRequest var metadata runtime.ServerMetadata var ( @@ -579,7 +579,7 @@ var ( ) func request_ArmService_GetGeometries_0(ctx context.Context, marshaler runtime.Marshaler, client ArmServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1_0.GetGeometriesRequest + var protoReq v1.GetGeometriesRequest var metadata runtime.ServerMetadata var ( @@ -612,7 +612,7 @@ func request_ArmService_GetGeometries_0(ctx context.Context, marshaler runtime.M } func local_request_ArmService_GetGeometries_0(ctx context.Context, marshaler runtime.Marshaler, server ArmServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1_0.GetGeometriesRequest + var protoReq v1.GetGeometriesRequest var metadata runtime.ServerMetadata var ( diff --git a/component/audioinput/v1/audioinput.pb.gw.go b/component/audioinput/v1/audioinput.pb.gw.go index 97662546a..571f1e11f 100644 --- a/component/audioinput/v1/audioinput.pb.gw.go +++ b/component/audioinput/v1/audioinput.pb.gw.go @@ -15,7 +15,7 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "go.viam.com/api/common/v1" + v1_0 "go.viam.com/api/common/v1" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" @@ -184,7 +184,7 @@ var ( ) func request_AudioInputService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, client AudioInputServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.DoCommandRequest + var protoReq v1_0.DoCommandRequest var metadata runtime.ServerMetadata var ( @@ -217,7 +217,7 @@ func request_AudioInputService_DoCommand_0(ctx context.Context, marshaler runtim } func local_request_AudioInputService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, server AudioInputServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.DoCommandRequest + var protoReq v1_0.DoCommandRequest var metadata runtime.ServerMetadata var ( @@ -254,7 +254,7 @@ var ( ) func request_AudioInputService_GetGeometries_0(ctx context.Context, marshaler runtime.Marshaler, client AudioInputServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.GetGeometriesRequest + var protoReq v1_0.GetGeometriesRequest var metadata runtime.ServerMetadata var ( @@ -287,7 +287,7 @@ func request_AudioInputService_GetGeometries_0(ctx context.Context, marshaler ru } func local_request_AudioInputService_GetGeometries_0(ctx context.Context, marshaler runtime.Marshaler, server AudioInputServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.GetGeometriesRequest + var protoReq v1_0.GetGeometriesRequest var metadata runtime.ServerMetadata var ( diff --git a/component/board/v1/board.pb.gw.go b/component/board/v1/board.pb.gw.go index bbebd2fb5..84b5b756d 100644 --- a/component/board/v1/board.pb.gw.go +++ b/component/board/v1/board.pb.gw.go @@ -15,7 +15,7 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "go.viam.com/api/common/v1" + v1_0 "go.viam.com/api/common/v1" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" @@ -527,7 +527,7 @@ var ( ) func request_BoardService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, client BoardServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.DoCommandRequest + var protoReq v1_0.DoCommandRequest var metadata runtime.ServerMetadata var ( @@ -560,7 +560,7 @@ func request_BoardService_DoCommand_0(ctx context.Context, marshaler runtime.Mar } func local_request_BoardService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, server BoardServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.DoCommandRequest + var protoReq v1_0.DoCommandRequest var metadata runtime.ServerMetadata var ( @@ -917,7 +917,7 @@ var ( ) func request_BoardService_GetGeometries_0(ctx context.Context, marshaler runtime.Marshaler, client BoardServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.GetGeometriesRequest + var protoReq v1_0.GetGeometriesRequest var metadata runtime.ServerMetadata var ( @@ -950,7 +950,7 @@ func request_BoardService_GetGeometries_0(ctx context.Context, marshaler runtime } func local_request_BoardService_GetGeometries_0(ctx context.Context, marshaler runtime.Marshaler, server BoardServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.GetGeometriesRequest + var protoReq v1_0.GetGeometriesRequest var metadata runtime.ServerMetadata var ( diff --git a/component/motor/v1/motor.pb.gw.go b/component/motor/v1/motor.pb.gw.go index 6a3de9c6a..09b3358c0 100644 --- a/component/motor/v1/motor.pb.gw.go +++ b/component/motor/v1/motor.pb.gw.go @@ -15,7 +15,7 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "go.viam.com/api/common/v1" + v1_0 "go.viam.com/api/common/v1" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" @@ -649,7 +649,7 @@ var ( ) func request_MotorService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, client MotorServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.DoCommandRequest + var protoReq v1_0.DoCommandRequest var metadata runtime.ServerMetadata var ( @@ -682,7 +682,7 @@ func request_MotorService_DoCommand_0(ctx context.Context, marshaler runtime.Mar } func local_request_MotorService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, server MotorServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.DoCommandRequest + var protoReq v1_0.DoCommandRequest var metadata runtime.ServerMetadata var ( @@ -719,7 +719,7 @@ var ( ) func request_MotorService_GetGeometries_0(ctx context.Context, marshaler runtime.Marshaler, client MotorServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.GetGeometriesRequest + var protoReq v1_0.GetGeometriesRequest var metadata runtime.ServerMetadata var ( @@ -752,7 +752,7 @@ func request_MotorService_GetGeometries_0(ctx context.Context, marshaler runtime } func local_request_MotorService_GetGeometries_0(ctx context.Context, marshaler runtime.Marshaler, server MotorServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.GetGeometriesRequest + var protoReq v1_0.GetGeometriesRequest var metadata runtime.ServerMetadata var ( diff --git a/gen/js/app/agent/v1/agent_grpc_web_pb.js b/gen/js/app/agent/v1/agent_grpc_web_pb.js new file mode 100644 index 000000000..c70e5b333 --- /dev/null +++ b/gen/js/app/agent/v1/agent_grpc_web_pb.js @@ -0,0 +1,320 @@ +/** + * @fileoverview gRPC-Web generated client stub for viam.app.agent.v1 + * @enhanceable + * @public + */ + +// Code generated by protoc-gen-grpc-web. DO NOT EDIT. +// versions: +// protoc-gen-grpc-web v1.4.2 +// protoc v0.0.0 +// source: app/agent/v1/agent.proto + + +/* eslint-disable */ +// @ts-nocheck + + + +const grpc = {}; +grpc.web = require('grpc-web'); + + +var google_protobuf_duration_pb = require('google-protobuf/google/protobuf/duration_pb.js') + +var tagger_v1_tagger_pb = require('../../../tagger/v1/tagger_pb.js') +const proto = {}; +proto.viam = {}; +proto.viam.app = {}; +proto.viam.app.agent = {}; +proto.viam.app.agent.v1 = require('./agent_pb.js'); + +/** + * @param {string} hostname + * @param {?Object} credentials + * @param {?grpc.web.ClientOptions} options + * @constructor + * @struct + * @final + */ +proto.viam.app.agent.v1.AgentAppServiceClient = + function(hostname, credentials, options) { + if (!options) options = {}; + options.format = 'text'; + + /** + * @private @const {!grpc.web.GrpcWebClientBase} The client + */ + this.client_ = new grpc.web.GrpcWebClientBase(options); + + /** + * @private @const {string} The hostname + */ + this.hostname_ = hostname.replace(/\/+$/, ''); + +}; + + +/** + * @param {string} hostname + * @param {?Object} credentials + * @param {?grpc.web.ClientOptions} options + * @constructor + * @struct + * @final + */ +proto.viam.app.agent.v1.AgentAppServicePromiseClient = + function(hostname, credentials, options) { + if (!options) options = {}; + options.format = 'text'; + + /** + * @private @const {!grpc.web.GrpcWebClientBase} The client + */ + this.client_ = new grpc.web.GrpcWebClientBase(options); + + /** + * @private @const {string} The hostname + */ + this.hostname_ = hostname.replace(/\/+$/, ''); + +}; + + +/** + * @const + * @type {!grpc.web.MethodDescriptor< + * !proto.viam.app.agent.v1.GetAgentConfigRequest, + * !proto.viam.app.agent.v1.GetAgentConfigResponse>} + */ +const methodDescriptor_AgentAppService_GetAgentConfig = new grpc.web.MethodDescriptor( + '/viam.app.agent.v1.AgentAppService/GetAgentConfig', + grpc.web.MethodType.UNARY, + proto.viam.app.agent.v1.GetAgentConfigRequest, + proto.viam.app.agent.v1.GetAgentConfigResponse, + /** + * @param {!proto.viam.app.agent.v1.GetAgentConfigRequest} request + * @return {!Uint8Array} + */ + function(request) { + return request.serializeBinary(); + }, + proto.viam.app.agent.v1.GetAgentConfigResponse.deserializeBinary +); + + +/** + * @param {!proto.viam.app.agent.v1.GetAgentConfigRequest} request The + * request proto + * @param {?Object} metadata User defined + * call metadata + * @param {function(?grpc.web.RpcError, ?proto.viam.app.agent.v1.GetAgentConfigResponse)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.viam.app.agent.v1.AgentAppServiceClient.prototype.getAgentConfig = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/viam.app.agent.v1.AgentAppService/GetAgentConfig', + request, + metadata || {}, + methodDescriptor_AgentAppService_GetAgentConfig, + callback); +}; + + +/** + * @param {!proto.viam.app.agent.v1.GetAgentConfigRequest} request The + * request proto + * @param {?Object=} metadata User defined + * call metadata + * @return {!Promise} + * Promise that resolves to the response + */ +proto.viam.app.agent.v1.AgentAppServicePromiseClient.prototype.getAgentConfig = + function(request, metadata) { + return this.client_.unaryCall(this.hostname_ + + '/viam.app.agent.v1.AgentAppService/GetAgentConfig', + request, + metadata || {}, + methodDescriptor_AgentAppService_GetAgentConfig); +}; + + +/** + * @const + * @type {!grpc.web.MethodDescriptor< + * !proto.viam.app.agent.v1.UpdateAgentConfigRequest, + * !proto.viam.app.agent.v1.UpdateAgentConfigResponse>} + */ +const methodDescriptor_AgentAppService_UpdateAgentConfig = new grpc.web.MethodDescriptor( + '/viam.app.agent.v1.AgentAppService/UpdateAgentConfig', + grpc.web.MethodType.UNARY, + proto.viam.app.agent.v1.UpdateAgentConfigRequest, + proto.viam.app.agent.v1.UpdateAgentConfigResponse, + /** + * @param {!proto.viam.app.agent.v1.UpdateAgentConfigRequest} request + * @return {!Uint8Array} + */ + function(request) { + return request.serializeBinary(); + }, + proto.viam.app.agent.v1.UpdateAgentConfigResponse.deserializeBinary +); + + +/** + * @param {!proto.viam.app.agent.v1.UpdateAgentConfigRequest} request The + * request proto + * @param {?Object} metadata User defined + * call metadata + * @param {function(?grpc.web.RpcError, ?proto.viam.app.agent.v1.UpdateAgentConfigResponse)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.viam.app.agent.v1.AgentAppServiceClient.prototype.updateAgentConfig = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/viam.app.agent.v1.AgentAppService/UpdateAgentConfig', + request, + metadata || {}, + methodDescriptor_AgentAppService_UpdateAgentConfig, + callback); +}; + + +/** + * @param {!proto.viam.app.agent.v1.UpdateAgentConfigRequest} request The + * request proto + * @param {?Object=} metadata User defined + * call metadata + * @return {!Promise} + * Promise that resolves to the response + */ +proto.viam.app.agent.v1.AgentAppServicePromiseClient.prototype.updateAgentConfig = + function(request, metadata) { + return this.client_.unaryCall(this.hostname_ + + '/viam.app.agent.v1.AgentAppService/UpdateAgentConfig', + request, + metadata || {}, + methodDescriptor_AgentAppService_UpdateAgentConfig); +}; + + +/** + * @param {string} hostname + * @param {?Object} credentials + * @param {?grpc.web.ClientOptions} options + * @constructor + * @struct + * @final + */ +proto.viam.app.agent.v1.AgentDeviceServiceClient = + function(hostname, credentials, options) { + if (!options) options = {}; + options.format = 'text'; + + /** + * @private @const {!grpc.web.GrpcWebClientBase} The client + */ + this.client_ = new grpc.web.GrpcWebClientBase(options); + + /** + * @private @const {string} The hostname + */ + this.hostname_ = hostname.replace(/\/+$/, ''); + +}; + + +/** + * @param {string} hostname + * @param {?Object} credentials + * @param {?grpc.web.ClientOptions} options + * @constructor + * @struct + * @final + */ +proto.viam.app.agent.v1.AgentDeviceServicePromiseClient = + function(hostname, credentials, options) { + if (!options) options = {}; + options.format = 'text'; + + /** + * @private @const {!grpc.web.GrpcWebClientBase} The client + */ + this.client_ = new grpc.web.GrpcWebClientBase(options); + + /** + * @private @const {string} The hostname + */ + this.hostname_ = hostname.replace(/\/+$/, ''); + +}; + + +/** + * @const + * @type {!grpc.web.MethodDescriptor< + * !proto.viam.app.agent.v1.DeviceAgentConfigRequest, + * !proto.viam.app.agent.v1.DeviceAgentConfigResponse>} + */ +const methodDescriptor_AgentDeviceService_DeviceAgentConfig = new grpc.web.MethodDescriptor( + '/viam.app.agent.v1.AgentDeviceService/DeviceAgentConfig', + grpc.web.MethodType.UNARY, + proto.viam.app.agent.v1.DeviceAgentConfigRequest, + proto.viam.app.agent.v1.DeviceAgentConfigResponse, + /** + * @param {!proto.viam.app.agent.v1.DeviceAgentConfigRequest} request + * @return {!Uint8Array} + */ + function(request) { + return request.serializeBinary(); + }, + proto.viam.app.agent.v1.DeviceAgentConfigResponse.deserializeBinary +); + + +/** + * @param {!proto.viam.app.agent.v1.DeviceAgentConfigRequest} request The + * request proto + * @param {?Object} metadata User defined + * call metadata + * @param {function(?grpc.web.RpcError, ?proto.viam.app.agent.v1.DeviceAgentConfigResponse)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.viam.app.agent.v1.AgentDeviceServiceClient.prototype.deviceAgentConfig = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/viam.app.agent.v1.AgentDeviceService/DeviceAgentConfig', + request, + metadata || {}, + methodDescriptor_AgentDeviceService_DeviceAgentConfig, + callback); +}; + + +/** + * @param {!proto.viam.app.agent.v1.DeviceAgentConfigRequest} request The + * request proto + * @param {?Object=} metadata User defined + * call metadata + * @return {!Promise} + * Promise that resolves to the response + */ +proto.viam.app.agent.v1.AgentDeviceServicePromiseClient.prototype.deviceAgentConfig = + function(request, metadata) { + return this.client_.unaryCall(this.hostname_ + + '/viam.app.agent.v1.AgentDeviceService/DeviceAgentConfig', + request, + metadata || {}, + methodDescriptor_AgentDeviceService_DeviceAgentConfig); +}; + + +module.exports = proto.viam.app.agent.v1; + diff --git a/gen/js/app/agent/v1/agent_pb.d.ts b/gen/js/app/agent/v1/agent_pb.d.ts new file mode 100644 index 000000000..8ecfab4b6 --- /dev/null +++ b/gen/js/app/agent/v1/agent_pb.d.ts @@ -0,0 +1,310 @@ +// package: viam.app.agent.v1 +// file: app/agent/v1/agent.proto + +import * as jspb from "google-protobuf"; +import * as google_protobuf_duration_pb from "google-protobuf/google/protobuf/duration_pb"; +import * as tagger_v1_tagger_pb from "../../../tagger/v1/tagger_pb"; + +export class GetAgentConfigRequest extends jspb.Message { + getId(): string; + setId(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetAgentConfigRequest.AsObject; + static toObject(includeInstance: boolean, msg: GetAgentConfigRequest): GetAgentConfigRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetAgentConfigRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetAgentConfigRequest; + static deserializeBinaryFromReader(message: GetAgentConfigRequest, reader: jspb.BinaryReader): GetAgentConfigRequest; +} + +export namespace GetAgentConfigRequest { + export type AsObject = { + id: string, + } +} + +export class GetAgentConfigResponse extends jspb.Message { + hasAgentConfig(): boolean; + clearAgentConfig(): void; + getAgentConfig(): AppAgentConfig | undefined; + setAgentConfig(value?: AppAgentConfig): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetAgentConfigResponse.AsObject; + static toObject(includeInstance: boolean, msg: GetAgentConfigResponse): GetAgentConfigResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetAgentConfigResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetAgentConfigResponse; + static deserializeBinaryFromReader(message: GetAgentConfigResponse, reader: jspb.BinaryReader): GetAgentConfigResponse; +} + +export namespace GetAgentConfigResponse { + export type AsObject = { + agentConfig?: AppAgentConfig.AsObject, + } +} + +export class UpdateAgentConfigRequest extends jspb.Message { + getId(): string; + setId(value: string): void; + + hasAgentConfig(): boolean; + clearAgentConfig(): void; + getAgentConfig(): AppAgentConfig | undefined; + setAgentConfig(value?: AppAgentConfig): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): UpdateAgentConfigRequest.AsObject; + static toObject(includeInstance: boolean, msg: UpdateAgentConfigRequest): UpdateAgentConfigRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: UpdateAgentConfigRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): UpdateAgentConfigRequest; + static deserializeBinaryFromReader(message: UpdateAgentConfigRequest, reader: jspb.BinaryReader): UpdateAgentConfigRequest; +} + +export namespace UpdateAgentConfigRequest { + export type AsObject = { + id: string, + agentConfig?: AppAgentConfig.AsObject, + } +} + +export class UpdateAgentConfigResponse extends jspb.Message { + hasAgentConfig(): boolean; + clearAgentConfig(): void; + getAgentConfig(): AppAgentConfig | undefined; + setAgentConfig(value?: AppAgentConfig): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): UpdateAgentConfigResponse.AsObject; + static toObject(includeInstance: boolean, msg: UpdateAgentConfigResponse): UpdateAgentConfigResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: UpdateAgentConfigResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): UpdateAgentConfigResponse; + static deserializeBinaryFromReader(message: UpdateAgentConfigResponse, reader: jspb.BinaryReader): UpdateAgentConfigResponse; +} + +export namespace UpdateAgentConfigResponse { + export type AsObject = { + agentConfig?: AppAgentConfig.AsObject, + } +} + +export class AppAgentConfig extends jspb.Message { + getSubsystemConfigsMap(): jspb.Map; + clearSubsystemConfigsMap(): void; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): AppAgentConfig.AsObject; + static toObject(includeInstance: boolean, msg: AppAgentConfig): AppAgentConfig.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: AppAgentConfig, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): AppAgentConfig; + static deserializeBinaryFromReader(message: AppAgentConfig, reader: jspb.BinaryReader): AppAgentConfig; +} + +export namespace AppAgentConfig { + export type AsObject = { + subsystemConfigsMap: Array<[string, AppSubsystemConfig.AsObject]>, + } +} + +export class AppSubsystemConfig extends jspb.Message { + getReleaseChannel(): string; + setReleaseChannel(value: string): void; + + getPinVersion(): string; + setPinVersion(value: string): void; + + getPinUrl(): string; + setPinUrl(value: string): void; + + getDisableSubsystem(): boolean; + setDisableSubsystem(value: boolean): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): AppSubsystemConfig.AsObject; + static toObject(includeInstance: boolean, msg: AppSubsystemConfig): AppSubsystemConfig.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: AppSubsystemConfig, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): AppSubsystemConfig; + static deserializeBinaryFromReader(message: AppSubsystemConfig, reader: jspb.BinaryReader): AppSubsystemConfig; +} + +export namespace AppSubsystemConfig { + export type AsObject = { + releaseChannel: string, + pinVersion: string, + pinUrl: string, + disableSubsystem: boolean, + } +} + +export class DeviceAgentConfigRequest extends jspb.Message { + getId(): string; + setId(value: string): void; + + hasHostInfo(): boolean; + clearHostInfo(): void; + getHostInfo(): HostInfo | undefined; + setHostInfo(value?: HostInfo): void; + + getSubsystemVersionsMap(): jspb.Map; + clearSubsystemVersionsMap(): void; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): DeviceAgentConfigRequest.AsObject; + static toObject(includeInstance: boolean, msg: DeviceAgentConfigRequest): DeviceAgentConfigRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: DeviceAgentConfigRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): DeviceAgentConfigRequest; + static deserializeBinaryFromReader(message: DeviceAgentConfigRequest, reader: jspb.BinaryReader): DeviceAgentConfigRequest; +} + +export namespace DeviceAgentConfigRequest { + export type AsObject = { + id: string, + hostInfo?: HostInfo.AsObject, + subsystemVersionsMap: Array<[string, string]>, + } +} + +export class DeviceAgentConfigResponse extends jspb.Message { + getSubsystemConfigsMap(): jspb.Map; + clearSubsystemConfigsMap(): void; + hasCheckInterval(): boolean; + clearCheckInterval(): void; + getCheckInterval(): google_protobuf_duration_pb.Duration | undefined; + setCheckInterval(value?: google_protobuf_duration_pb.Duration): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): DeviceAgentConfigResponse.AsObject; + static toObject(includeInstance: boolean, msg: DeviceAgentConfigResponse): DeviceAgentConfigResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: DeviceAgentConfigResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): DeviceAgentConfigResponse; + static deserializeBinaryFromReader(message: DeviceAgentConfigResponse, reader: jspb.BinaryReader): DeviceAgentConfigResponse; +} + +export namespace DeviceAgentConfigResponse { + export type AsObject = { + subsystemConfigsMap: Array<[string, DeviceSubsystemConfig.AsObject]>, + checkInterval?: google_protobuf_duration_pb.Duration.AsObject, + } +} + +export class DeviceSubsystemConfig extends jspb.Message { + hasUpdateInfo(): boolean; + clearUpdateInfo(): void; + getUpdateInfo(): SubsystemUpdateInfo | undefined; + setUpdateInfo(value?: SubsystemUpdateInfo): void; + + getDisable(): boolean; + setDisable(value: boolean): void; + + getForceRestart(): boolean; + setForceRestart(value: boolean): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): DeviceSubsystemConfig.AsObject; + static toObject(includeInstance: boolean, msg: DeviceSubsystemConfig): DeviceSubsystemConfig.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: DeviceSubsystemConfig, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): DeviceSubsystemConfig; + static deserializeBinaryFromReader(message: DeviceSubsystemConfig, reader: jspb.BinaryReader): DeviceSubsystemConfig; +} + +export namespace DeviceSubsystemConfig { + export type AsObject = { + updateInfo?: SubsystemUpdateInfo.AsObject, + disable: boolean, + forceRestart: boolean, + } +} + +export class HostInfo extends jspb.Message { + getPlatform(): string; + setPlatform(value: string): void; + + getDistro(): string; + setDistro(value: string): void; + + clearTagsList(): void; + getTagsList(): Array; + setTagsList(value: Array): void; + addTags(value: string, index?: number): string; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): HostInfo.AsObject; + static toObject(includeInstance: boolean, msg: HostInfo): HostInfo.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: HostInfo, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): HostInfo; + static deserializeBinaryFromReader(message: HostInfo, reader: jspb.BinaryReader): HostInfo; +} + +export namespace HostInfo { + export type AsObject = { + platform: string, + distro: string, + tagsList: Array, + } +} + +export class SubsystemUpdateInfo extends jspb.Message { + getFilename(): string; + setFilename(value: string): void; + + getUrl(): string; + setUrl(value: string): void; + + getVersion(): string; + setVersion(value: string): void; + + getSha256(): Uint8Array | string; + getSha256_asU8(): Uint8Array; + getSha256_asB64(): string; + setSha256(value: Uint8Array | string): void; + + getFormat(): PackageFormatMap[keyof PackageFormatMap]; + setFormat(value: PackageFormatMap[keyof PackageFormatMap]): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SubsystemUpdateInfo.AsObject; + static toObject(includeInstance: boolean, msg: SubsystemUpdateInfo): SubsystemUpdateInfo.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SubsystemUpdateInfo, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SubsystemUpdateInfo; + static deserializeBinaryFromReader(message: SubsystemUpdateInfo, reader: jspb.BinaryReader): SubsystemUpdateInfo; +} + +export namespace SubsystemUpdateInfo { + export type AsObject = { + filename: string, + url: string, + version: string, + sha256: Uint8Array | string, + format: PackageFormatMap[keyof PackageFormatMap], + } +} + +export interface PackageFormatMap { + PACKAGE_FORMAT_UNSPECIFIED: 0; + PACKAGE_FORMAT_RAW: 1; + PACKAGE_FORMAT_XZ: 2; + PACKAGE_FORMAT_EXECUTABLE: 3; + PACKAGE_FORMAT_XZ_EXECUTABLE: 4; +} + +export const PackageFormat: PackageFormatMap; + diff --git a/gen/js/app/agent/v1/agent_pb.js b/gen/js/app/agent/v1/agent_pb.js new file mode 100644 index 000000000..4626d3b0a --- /dev/null +++ b/gen/js/app/agent/v1/agent_pb.js @@ -0,0 +1,2341 @@ +// source: app/agent/v1/agent.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = (function() { return this || window || global || self || Function('return this')(); }).call(null); + +var google_protobuf_duration_pb = require('google-protobuf/google/protobuf/duration_pb.js'); +goog.object.extend(proto, google_protobuf_duration_pb); +var tagger_v1_tagger_pb = require('../../../tagger/v1/tagger_pb.js'); +goog.object.extend(proto, tagger_v1_tagger_pb); +goog.exportSymbol('proto.viam.app.agent.v1.AppAgentConfig', null, global); +goog.exportSymbol('proto.viam.app.agent.v1.AppSubsystemConfig', null, global); +goog.exportSymbol('proto.viam.app.agent.v1.DeviceAgentConfigRequest', null, global); +goog.exportSymbol('proto.viam.app.agent.v1.DeviceAgentConfigResponse', null, global); +goog.exportSymbol('proto.viam.app.agent.v1.DeviceSubsystemConfig', null, global); +goog.exportSymbol('proto.viam.app.agent.v1.GetAgentConfigRequest', null, global); +goog.exportSymbol('proto.viam.app.agent.v1.GetAgentConfigResponse', null, global); +goog.exportSymbol('proto.viam.app.agent.v1.HostInfo', null, global); +goog.exportSymbol('proto.viam.app.agent.v1.PackageFormat', null, global); +goog.exportSymbol('proto.viam.app.agent.v1.SubsystemUpdateInfo', null, global); +goog.exportSymbol('proto.viam.app.agent.v1.UpdateAgentConfigRequest', null, global); +goog.exportSymbol('proto.viam.app.agent.v1.UpdateAgentConfigResponse', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.viam.app.agent.v1.GetAgentConfigRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.viam.app.agent.v1.GetAgentConfigRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.viam.app.agent.v1.GetAgentConfigRequest.displayName = 'proto.viam.app.agent.v1.GetAgentConfigRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.viam.app.agent.v1.GetAgentConfigResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.viam.app.agent.v1.GetAgentConfigResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.viam.app.agent.v1.GetAgentConfigResponse.displayName = 'proto.viam.app.agent.v1.GetAgentConfigResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.viam.app.agent.v1.UpdateAgentConfigRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.viam.app.agent.v1.UpdateAgentConfigRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.viam.app.agent.v1.UpdateAgentConfigRequest.displayName = 'proto.viam.app.agent.v1.UpdateAgentConfigRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.viam.app.agent.v1.UpdateAgentConfigResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.viam.app.agent.v1.UpdateAgentConfigResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.viam.app.agent.v1.UpdateAgentConfigResponse.displayName = 'proto.viam.app.agent.v1.UpdateAgentConfigResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.viam.app.agent.v1.AppAgentConfig = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.viam.app.agent.v1.AppAgentConfig, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.viam.app.agent.v1.AppAgentConfig.displayName = 'proto.viam.app.agent.v1.AppAgentConfig'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.viam.app.agent.v1.AppSubsystemConfig = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.viam.app.agent.v1.AppSubsystemConfig, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.viam.app.agent.v1.AppSubsystemConfig.displayName = 'proto.viam.app.agent.v1.AppSubsystemConfig'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.viam.app.agent.v1.DeviceAgentConfigRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.viam.app.agent.v1.DeviceAgentConfigRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.viam.app.agent.v1.DeviceAgentConfigRequest.displayName = 'proto.viam.app.agent.v1.DeviceAgentConfigRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.viam.app.agent.v1.DeviceAgentConfigResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.viam.app.agent.v1.DeviceAgentConfigResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.viam.app.agent.v1.DeviceAgentConfigResponse.displayName = 'proto.viam.app.agent.v1.DeviceAgentConfigResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.viam.app.agent.v1.DeviceSubsystemConfig = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.viam.app.agent.v1.DeviceSubsystemConfig, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.viam.app.agent.v1.DeviceSubsystemConfig.displayName = 'proto.viam.app.agent.v1.DeviceSubsystemConfig'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.viam.app.agent.v1.HostInfo = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.viam.app.agent.v1.HostInfo.repeatedFields_, null); +}; +goog.inherits(proto.viam.app.agent.v1.HostInfo, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.viam.app.agent.v1.HostInfo.displayName = 'proto.viam.app.agent.v1.HostInfo'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.viam.app.agent.v1.SubsystemUpdateInfo = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.viam.app.agent.v1.SubsystemUpdateInfo, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.viam.app.agent.v1.SubsystemUpdateInfo.displayName = 'proto.viam.app.agent.v1.SubsystemUpdateInfo'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.viam.app.agent.v1.GetAgentConfigRequest.prototype.toObject = function(opt_includeInstance) { + return proto.viam.app.agent.v1.GetAgentConfigRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.viam.app.agent.v1.GetAgentConfigRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.viam.app.agent.v1.GetAgentConfigRequest.toObject = function(includeInstance, msg) { + var f, obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.viam.app.agent.v1.GetAgentConfigRequest} + */ +proto.viam.app.agent.v1.GetAgentConfigRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.viam.app.agent.v1.GetAgentConfigRequest; + return proto.viam.app.agent.v1.GetAgentConfigRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.viam.app.agent.v1.GetAgentConfigRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.viam.app.agent.v1.GetAgentConfigRequest} + */ +proto.viam.app.agent.v1.GetAgentConfigRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.viam.app.agent.v1.GetAgentConfigRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.viam.app.agent.v1.GetAgentConfigRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.viam.app.agent.v1.GetAgentConfigRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.viam.app.agent.v1.GetAgentConfigRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string id = 1; + * @return {string} + */ +proto.viam.app.agent.v1.GetAgentConfigRequest.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.viam.app.agent.v1.GetAgentConfigRequest} returns this + */ +proto.viam.app.agent.v1.GetAgentConfigRequest.prototype.setId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.viam.app.agent.v1.GetAgentConfigResponse.prototype.toObject = function(opt_includeInstance) { + return proto.viam.app.agent.v1.GetAgentConfigResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.viam.app.agent.v1.GetAgentConfigResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.viam.app.agent.v1.GetAgentConfigResponse.toObject = function(includeInstance, msg) { + var f, obj = { + agentConfig: (f = msg.getAgentConfig()) && proto.viam.app.agent.v1.AppAgentConfig.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.viam.app.agent.v1.GetAgentConfigResponse} + */ +proto.viam.app.agent.v1.GetAgentConfigResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.viam.app.agent.v1.GetAgentConfigResponse; + return proto.viam.app.agent.v1.GetAgentConfigResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.viam.app.agent.v1.GetAgentConfigResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.viam.app.agent.v1.GetAgentConfigResponse} + */ +proto.viam.app.agent.v1.GetAgentConfigResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.viam.app.agent.v1.AppAgentConfig; + reader.readMessage(value,proto.viam.app.agent.v1.AppAgentConfig.deserializeBinaryFromReader); + msg.setAgentConfig(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.viam.app.agent.v1.GetAgentConfigResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.viam.app.agent.v1.GetAgentConfigResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.viam.app.agent.v1.GetAgentConfigResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.viam.app.agent.v1.GetAgentConfigResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getAgentConfig(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.viam.app.agent.v1.AppAgentConfig.serializeBinaryToWriter + ); + } +}; + + +/** + * optional AppAgentConfig agent_config = 1; + * @return {?proto.viam.app.agent.v1.AppAgentConfig} + */ +proto.viam.app.agent.v1.GetAgentConfigResponse.prototype.getAgentConfig = function() { + return /** @type{?proto.viam.app.agent.v1.AppAgentConfig} */ ( + jspb.Message.getWrapperField(this, proto.viam.app.agent.v1.AppAgentConfig, 1)); +}; + + +/** + * @param {?proto.viam.app.agent.v1.AppAgentConfig|undefined} value + * @return {!proto.viam.app.agent.v1.GetAgentConfigResponse} returns this +*/ +proto.viam.app.agent.v1.GetAgentConfigResponse.prototype.setAgentConfig = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.viam.app.agent.v1.GetAgentConfigResponse} returns this + */ +proto.viam.app.agent.v1.GetAgentConfigResponse.prototype.clearAgentConfig = function() { + return this.setAgentConfig(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.viam.app.agent.v1.GetAgentConfigResponse.prototype.hasAgentConfig = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.viam.app.agent.v1.UpdateAgentConfigRequest.prototype.toObject = function(opt_includeInstance) { + return proto.viam.app.agent.v1.UpdateAgentConfigRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.viam.app.agent.v1.UpdateAgentConfigRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.viam.app.agent.v1.UpdateAgentConfigRequest.toObject = function(includeInstance, msg) { + var f, obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, ""), + agentConfig: (f = msg.getAgentConfig()) && proto.viam.app.agent.v1.AppAgentConfig.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.viam.app.agent.v1.UpdateAgentConfigRequest} + */ +proto.viam.app.agent.v1.UpdateAgentConfigRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.viam.app.agent.v1.UpdateAgentConfigRequest; + return proto.viam.app.agent.v1.UpdateAgentConfigRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.viam.app.agent.v1.UpdateAgentConfigRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.viam.app.agent.v1.UpdateAgentConfigRequest} + */ +proto.viam.app.agent.v1.UpdateAgentConfigRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setId(value); + break; + case 2: + var value = new proto.viam.app.agent.v1.AppAgentConfig; + reader.readMessage(value,proto.viam.app.agent.v1.AppAgentConfig.deserializeBinaryFromReader); + msg.setAgentConfig(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.viam.app.agent.v1.UpdateAgentConfigRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.viam.app.agent.v1.UpdateAgentConfigRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.viam.app.agent.v1.UpdateAgentConfigRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.viam.app.agent.v1.UpdateAgentConfigRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getAgentConfig(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.viam.app.agent.v1.AppAgentConfig.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string id = 1; + * @return {string} + */ +proto.viam.app.agent.v1.UpdateAgentConfigRequest.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.viam.app.agent.v1.UpdateAgentConfigRequest} returns this + */ +proto.viam.app.agent.v1.UpdateAgentConfigRequest.prototype.setId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional AppAgentConfig agent_config = 2; + * @return {?proto.viam.app.agent.v1.AppAgentConfig} + */ +proto.viam.app.agent.v1.UpdateAgentConfigRequest.prototype.getAgentConfig = function() { + return /** @type{?proto.viam.app.agent.v1.AppAgentConfig} */ ( + jspb.Message.getWrapperField(this, proto.viam.app.agent.v1.AppAgentConfig, 2)); +}; + + +/** + * @param {?proto.viam.app.agent.v1.AppAgentConfig|undefined} value + * @return {!proto.viam.app.agent.v1.UpdateAgentConfigRequest} returns this +*/ +proto.viam.app.agent.v1.UpdateAgentConfigRequest.prototype.setAgentConfig = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.viam.app.agent.v1.UpdateAgentConfigRequest} returns this + */ +proto.viam.app.agent.v1.UpdateAgentConfigRequest.prototype.clearAgentConfig = function() { + return this.setAgentConfig(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.viam.app.agent.v1.UpdateAgentConfigRequest.prototype.hasAgentConfig = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.viam.app.agent.v1.UpdateAgentConfigResponse.prototype.toObject = function(opt_includeInstance) { + return proto.viam.app.agent.v1.UpdateAgentConfigResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.viam.app.agent.v1.UpdateAgentConfigResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.viam.app.agent.v1.UpdateAgentConfigResponse.toObject = function(includeInstance, msg) { + var f, obj = { + agentConfig: (f = msg.getAgentConfig()) && proto.viam.app.agent.v1.AppAgentConfig.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.viam.app.agent.v1.UpdateAgentConfigResponse} + */ +proto.viam.app.agent.v1.UpdateAgentConfigResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.viam.app.agent.v1.UpdateAgentConfigResponse; + return proto.viam.app.agent.v1.UpdateAgentConfigResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.viam.app.agent.v1.UpdateAgentConfigResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.viam.app.agent.v1.UpdateAgentConfigResponse} + */ +proto.viam.app.agent.v1.UpdateAgentConfigResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.viam.app.agent.v1.AppAgentConfig; + reader.readMessage(value,proto.viam.app.agent.v1.AppAgentConfig.deserializeBinaryFromReader); + msg.setAgentConfig(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.viam.app.agent.v1.UpdateAgentConfigResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.viam.app.agent.v1.UpdateAgentConfigResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.viam.app.agent.v1.UpdateAgentConfigResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.viam.app.agent.v1.UpdateAgentConfigResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getAgentConfig(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.viam.app.agent.v1.AppAgentConfig.serializeBinaryToWriter + ); + } +}; + + +/** + * optional AppAgentConfig agent_config = 1; + * @return {?proto.viam.app.agent.v1.AppAgentConfig} + */ +proto.viam.app.agent.v1.UpdateAgentConfigResponse.prototype.getAgentConfig = function() { + return /** @type{?proto.viam.app.agent.v1.AppAgentConfig} */ ( + jspb.Message.getWrapperField(this, proto.viam.app.agent.v1.AppAgentConfig, 1)); +}; + + +/** + * @param {?proto.viam.app.agent.v1.AppAgentConfig|undefined} value + * @return {!proto.viam.app.agent.v1.UpdateAgentConfigResponse} returns this +*/ +proto.viam.app.agent.v1.UpdateAgentConfigResponse.prototype.setAgentConfig = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.viam.app.agent.v1.UpdateAgentConfigResponse} returns this + */ +proto.viam.app.agent.v1.UpdateAgentConfigResponse.prototype.clearAgentConfig = function() { + return this.setAgentConfig(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.viam.app.agent.v1.UpdateAgentConfigResponse.prototype.hasAgentConfig = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.viam.app.agent.v1.AppAgentConfig.prototype.toObject = function(opt_includeInstance) { + return proto.viam.app.agent.v1.AppAgentConfig.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.viam.app.agent.v1.AppAgentConfig} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.viam.app.agent.v1.AppAgentConfig.toObject = function(includeInstance, msg) { + var f, obj = { + subsystemConfigsMap: (f = msg.getSubsystemConfigsMap()) ? f.toObject(includeInstance, proto.viam.app.agent.v1.AppSubsystemConfig.toObject) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.viam.app.agent.v1.AppAgentConfig} + */ +proto.viam.app.agent.v1.AppAgentConfig.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.viam.app.agent.v1.AppAgentConfig; + return proto.viam.app.agent.v1.AppAgentConfig.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.viam.app.agent.v1.AppAgentConfig} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.viam.app.agent.v1.AppAgentConfig} + */ +proto.viam.app.agent.v1.AppAgentConfig.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = msg.getSubsystemConfigsMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.viam.app.agent.v1.AppSubsystemConfig.deserializeBinaryFromReader, "", new proto.viam.app.agent.v1.AppSubsystemConfig()); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.viam.app.agent.v1.AppAgentConfig.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.viam.app.agent.v1.AppAgentConfig.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.viam.app.agent.v1.AppAgentConfig} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.viam.app.agent.v1.AppAgentConfig.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSubsystemConfigsMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.viam.app.agent.v1.AppSubsystemConfig.serializeBinaryToWriter); + } +}; + + +/** + * map subsystem_configs = 1; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.viam.app.agent.v1.AppAgentConfig.prototype.getSubsystemConfigsMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 1, opt_noLazyCreate, + proto.viam.app.agent.v1.AppSubsystemConfig)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.viam.app.agent.v1.AppAgentConfig} returns this + */ +proto.viam.app.agent.v1.AppAgentConfig.prototype.clearSubsystemConfigsMap = function() { + this.getSubsystemConfigsMap().clear(); + return this;}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.viam.app.agent.v1.AppSubsystemConfig.prototype.toObject = function(opt_includeInstance) { + return proto.viam.app.agent.v1.AppSubsystemConfig.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.viam.app.agent.v1.AppSubsystemConfig} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.viam.app.agent.v1.AppSubsystemConfig.toObject = function(includeInstance, msg) { + var f, obj = { + releaseChannel: jspb.Message.getFieldWithDefault(msg, 1, ""), + pinVersion: jspb.Message.getFieldWithDefault(msg, 2, ""), + pinUrl: jspb.Message.getFieldWithDefault(msg, 3, ""), + disableSubsystem: jspb.Message.getBooleanFieldWithDefault(msg, 4, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.viam.app.agent.v1.AppSubsystemConfig} + */ +proto.viam.app.agent.v1.AppSubsystemConfig.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.viam.app.agent.v1.AppSubsystemConfig; + return proto.viam.app.agent.v1.AppSubsystemConfig.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.viam.app.agent.v1.AppSubsystemConfig} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.viam.app.agent.v1.AppSubsystemConfig} + */ +proto.viam.app.agent.v1.AppSubsystemConfig.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setReleaseChannel(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setPinVersion(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setPinUrl(value); + break; + case 4: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setDisableSubsystem(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.viam.app.agent.v1.AppSubsystemConfig.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.viam.app.agent.v1.AppSubsystemConfig.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.viam.app.agent.v1.AppSubsystemConfig} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.viam.app.agent.v1.AppSubsystemConfig.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getReleaseChannel(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getPinVersion(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getPinUrl(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getDisableSubsystem(); + if (f) { + writer.writeBool( + 4, + f + ); + } +}; + + +/** + * optional string release_channel = 1; + * @return {string} + */ +proto.viam.app.agent.v1.AppSubsystemConfig.prototype.getReleaseChannel = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.viam.app.agent.v1.AppSubsystemConfig} returns this + */ +proto.viam.app.agent.v1.AppSubsystemConfig.prototype.setReleaseChannel = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string pin_version = 2; + * @return {string} + */ +proto.viam.app.agent.v1.AppSubsystemConfig.prototype.getPinVersion = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.viam.app.agent.v1.AppSubsystemConfig} returns this + */ +proto.viam.app.agent.v1.AppSubsystemConfig.prototype.setPinVersion = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string pin_url = 3; + * @return {string} + */ +proto.viam.app.agent.v1.AppSubsystemConfig.prototype.getPinUrl = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.viam.app.agent.v1.AppSubsystemConfig} returns this + */ +proto.viam.app.agent.v1.AppSubsystemConfig.prototype.setPinUrl = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional bool disable_subsystem = 4; + * @return {boolean} + */ +proto.viam.app.agent.v1.AppSubsystemConfig.prototype.getDisableSubsystem = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.viam.app.agent.v1.AppSubsystemConfig} returns this + */ +proto.viam.app.agent.v1.AppSubsystemConfig.prototype.setDisableSubsystem = function(value) { + return jspb.Message.setProto3BooleanField(this, 4, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.viam.app.agent.v1.DeviceAgentConfigRequest.prototype.toObject = function(opt_includeInstance) { + return proto.viam.app.agent.v1.DeviceAgentConfigRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.viam.app.agent.v1.DeviceAgentConfigRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.viam.app.agent.v1.DeviceAgentConfigRequest.toObject = function(includeInstance, msg) { + var f, obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, ""), + hostInfo: (f = msg.getHostInfo()) && proto.viam.app.agent.v1.HostInfo.toObject(includeInstance, f), + subsystemVersionsMap: (f = msg.getSubsystemVersionsMap()) ? f.toObject(includeInstance, undefined) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.viam.app.agent.v1.DeviceAgentConfigRequest} + */ +proto.viam.app.agent.v1.DeviceAgentConfigRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.viam.app.agent.v1.DeviceAgentConfigRequest; + return proto.viam.app.agent.v1.DeviceAgentConfigRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.viam.app.agent.v1.DeviceAgentConfigRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.viam.app.agent.v1.DeviceAgentConfigRequest} + */ +proto.viam.app.agent.v1.DeviceAgentConfigRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setId(value); + break; + case 2: + var value = new proto.viam.app.agent.v1.HostInfo; + reader.readMessage(value,proto.viam.app.agent.v1.HostInfo.deserializeBinaryFromReader); + msg.setHostInfo(value); + break; + case 3: + var value = msg.getSubsystemVersionsMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.viam.app.agent.v1.DeviceAgentConfigRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.viam.app.agent.v1.DeviceAgentConfigRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.viam.app.agent.v1.DeviceAgentConfigRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.viam.app.agent.v1.DeviceAgentConfigRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getHostInfo(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.viam.app.agent.v1.HostInfo.serializeBinaryToWriter + ); + } + f = message.getSubsystemVersionsMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(3, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } +}; + + +/** + * optional string id = 1; + * @return {string} + */ +proto.viam.app.agent.v1.DeviceAgentConfigRequest.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.viam.app.agent.v1.DeviceAgentConfigRequest} returns this + */ +proto.viam.app.agent.v1.DeviceAgentConfigRequest.prototype.setId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional HostInfo host_info = 2; + * @return {?proto.viam.app.agent.v1.HostInfo} + */ +proto.viam.app.agent.v1.DeviceAgentConfigRequest.prototype.getHostInfo = function() { + return /** @type{?proto.viam.app.agent.v1.HostInfo} */ ( + jspb.Message.getWrapperField(this, proto.viam.app.agent.v1.HostInfo, 2)); +}; + + +/** + * @param {?proto.viam.app.agent.v1.HostInfo|undefined} value + * @return {!proto.viam.app.agent.v1.DeviceAgentConfigRequest} returns this +*/ +proto.viam.app.agent.v1.DeviceAgentConfigRequest.prototype.setHostInfo = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.viam.app.agent.v1.DeviceAgentConfigRequest} returns this + */ +proto.viam.app.agent.v1.DeviceAgentConfigRequest.prototype.clearHostInfo = function() { + return this.setHostInfo(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.viam.app.agent.v1.DeviceAgentConfigRequest.prototype.hasHostInfo = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * map subsystem_versions = 3; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.viam.app.agent.v1.DeviceAgentConfigRequest.prototype.getSubsystemVersionsMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 3, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.viam.app.agent.v1.DeviceAgentConfigRequest} returns this + */ +proto.viam.app.agent.v1.DeviceAgentConfigRequest.prototype.clearSubsystemVersionsMap = function() { + this.getSubsystemVersionsMap().clear(); + return this;}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.viam.app.agent.v1.DeviceAgentConfigResponse.prototype.toObject = function(opt_includeInstance) { + return proto.viam.app.agent.v1.DeviceAgentConfigResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.viam.app.agent.v1.DeviceAgentConfigResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.viam.app.agent.v1.DeviceAgentConfigResponse.toObject = function(includeInstance, msg) { + var f, obj = { + subsystemConfigsMap: (f = msg.getSubsystemConfigsMap()) ? f.toObject(includeInstance, proto.viam.app.agent.v1.DeviceSubsystemConfig.toObject) : [], + checkInterval: (f = msg.getCheckInterval()) && google_protobuf_duration_pb.Duration.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.viam.app.agent.v1.DeviceAgentConfigResponse} + */ +proto.viam.app.agent.v1.DeviceAgentConfigResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.viam.app.agent.v1.DeviceAgentConfigResponse; + return proto.viam.app.agent.v1.DeviceAgentConfigResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.viam.app.agent.v1.DeviceAgentConfigResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.viam.app.agent.v1.DeviceAgentConfigResponse} + */ +proto.viam.app.agent.v1.DeviceAgentConfigResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = msg.getSubsystemConfigsMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.viam.app.agent.v1.DeviceSubsystemConfig.deserializeBinaryFromReader, "", new proto.viam.app.agent.v1.DeviceSubsystemConfig()); + }); + break; + case 2: + var value = new google_protobuf_duration_pb.Duration; + reader.readMessage(value,google_protobuf_duration_pb.Duration.deserializeBinaryFromReader); + msg.setCheckInterval(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.viam.app.agent.v1.DeviceAgentConfigResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.viam.app.agent.v1.DeviceAgentConfigResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.viam.app.agent.v1.DeviceAgentConfigResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.viam.app.agent.v1.DeviceAgentConfigResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSubsystemConfigsMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.viam.app.agent.v1.DeviceSubsystemConfig.serializeBinaryToWriter); + } + f = message.getCheckInterval(); + if (f != null) { + writer.writeMessage( + 2, + f, + google_protobuf_duration_pb.Duration.serializeBinaryToWriter + ); + } +}; + + +/** + * map subsystem_configs = 1; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.viam.app.agent.v1.DeviceAgentConfigResponse.prototype.getSubsystemConfigsMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 1, opt_noLazyCreate, + proto.viam.app.agent.v1.DeviceSubsystemConfig)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.viam.app.agent.v1.DeviceAgentConfigResponse} returns this + */ +proto.viam.app.agent.v1.DeviceAgentConfigResponse.prototype.clearSubsystemConfigsMap = function() { + this.getSubsystemConfigsMap().clear(); + return this;}; + + +/** + * optional google.protobuf.Duration check_interval = 2; + * @return {?proto.google.protobuf.Duration} + */ +proto.viam.app.agent.v1.DeviceAgentConfigResponse.prototype.getCheckInterval = function() { + return /** @type{?proto.google.protobuf.Duration} */ ( + jspb.Message.getWrapperField(this, google_protobuf_duration_pb.Duration, 2)); +}; + + +/** + * @param {?proto.google.protobuf.Duration|undefined} value + * @return {!proto.viam.app.agent.v1.DeviceAgentConfigResponse} returns this +*/ +proto.viam.app.agent.v1.DeviceAgentConfigResponse.prototype.setCheckInterval = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.viam.app.agent.v1.DeviceAgentConfigResponse} returns this + */ +proto.viam.app.agent.v1.DeviceAgentConfigResponse.prototype.clearCheckInterval = function() { + return this.setCheckInterval(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.viam.app.agent.v1.DeviceAgentConfigResponse.prototype.hasCheckInterval = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.viam.app.agent.v1.DeviceSubsystemConfig.prototype.toObject = function(opt_includeInstance) { + return proto.viam.app.agent.v1.DeviceSubsystemConfig.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.viam.app.agent.v1.DeviceSubsystemConfig} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.viam.app.agent.v1.DeviceSubsystemConfig.toObject = function(includeInstance, msg) { + var f, obj = { + updateInfo: (f = msg.getUpdateInfo()) && proto.viam.app.agent.v1.SubsystemUpdateInfo.toObject(includeInstance, f), + disable: jspb.Message.getBooleanFieldWithDefault(msg, 2, false), + forceRestart: jspb.Message.getBooleanFieldWithDefault(msg, 3, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.viam.app.agent.v1.DeviceSubsystemConfig} + */ +proto.viam.app.agent.v1.DeviceSubsystemConfig.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.viam.app.agent.v1.DeviceSubsystemConfig; + return proto.viam.app.agent.v1.DeviceSubsystemConfig.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.viam.app.agent.v1.DeviceSubsystemConfig} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.viam.app.agent.v1.DeviceSubsystemConfig} + */ +proto.viam.app.agent.v1.DeviceSubsystemConfig.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.viam.app.agent.v1.SubsystemUpdateInfo; + reader.readMessage(value,proto.viam.app.agent.v1.SubsystemUpdateInfo.deserializeBinaryFromReader); + msg.setUpdateInfo(value); + break; + case 2: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setDisable(value); + break; + case 3: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setForceRestart(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.viam.app.agent.v1.DeviceSubsystemConfig.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.viam.app.agent.v1.DeviceSubsystemConfig.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.viam.app.agent.v1.DeviceSubsystemConfig} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.viam.app.agent.v1.DeviceSubsystemConfig.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getUpdateInfo(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.viam.app.agent.v1.SubsystemUpdateInfo.serializeBinaryToWriter + ); + } + f = message.getDisable(); + if (f) { + writer.writeBool( + 2, + f + ); + } + f = message.getForceRestart(); + if (f) { + writer.writeBool( + 3, + f + ); + } +}; + + +/** + * optional SubsystemUpdateInfo update_info = 1; + * @return {?proto.viam.app.agent.v1.SubsystemUpdateInfo} + */ +proto.viam.app.agent.v1.DeviceSubsystemConfig.prototype.getUpdateInfo = function() { + return /** @type{?proto.viam.app.agent.v1.SubsystemUpdateInfo} */ ( + jspb.Message.getWrapperField(this, proto.viam.app.agent.v1.SubsystemUpdateInfo, 1)); +}; + + +/** + * @param {?proto.viam.app.agent.v1.SubsystemUpdateInfo|undefined} value + * @return {!proto.viam.app.agent.v1.DeviceSubsystemConfig} returns this +*/ +proto.viam.app.agent.v1.DeviceSubsystemConfig.prototype.setUpdateInfo = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.viam.app.agent.v1.DeviceSubsystemConfig} returns this + */ +proto.viam.app.agent.v1.DeviceSubsystemConfig.prototype.clearUpdateInfo = function() { + return this.setUpdateInfo(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.viam.app.agent.v1.DeviceSubsystemConfig.prototype.hasUpdateInfo = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional bool disable = 2; + * @return {boolean} + */ +proto.viam.app.agent.v1.DeviceSubsystemConfig.prototype.getDisable = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.viam.app.agent.v1.DeviceSubsystemConfig} returns this + */ +proto.viam.app.agent.v1.DeviceSubsystemConfig.prototype.setDisable = function(value) { + return jspb.Message.setProto3BooleanField(this, 2, value); +}; + + +/** + * optional bool force_restart = 3; + * @return {boolean} + */ +proto.viam.app.agent.v1.DeviceSubsystemConfig.prototype.getForceRestart = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.viam.app.agent.v1.DeviceSubsystemConfig} returns this + */ +proto.viam.app.agent.v1.DeviceSubsystemConfig.prototype.setForceRestart = function(value) { + return jspb.Message.setProto3BooleanField(this, 3, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.viam.app.agent.v1.HostInfo.repeatedFields_ = [3]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.viam.app.agent.v1.HostInfo.prototype.toObject = function(opt_includeInstance) { + return proto.viam.app.agent.v1.HostInfo.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.viam.app.agent.v1.HostInfo} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.viam.app.agent.v1.HostInfo.toObject = function(includeInstance, msg) { + var f, obj = { + platform: jspb.Message.getFieldWithDefault(msg, 1, ""), + distro: jspb.Message.getFieldWithDefault(msg, 2, ""), + tagsList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.viam.app.agent.v1.HostInfo} + */ +proto.viam.app.agent.v1.HostInfo.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.viam.app.agent.v1.HostInfo; + return proto.viam.app.agent.v1.HostInfo.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.viam.app.agent.v1.HostInfo} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.viam.app.agent.v1.HostInfo} + */ +proto.viam.app.agent.v1.HostInfo.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setPlatform(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setDistro(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.addTags(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.viam.app.agent.v1.HostInfo.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.viam.app.agent.v1.HostInfo.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.viam.app.agent.v1.HostInfo} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.viam.app.agent.v1.HostInfo.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getPlatform(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getDistro(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getTagsList(); + if (f.length > 0) { + writer.writeRepeatedString( + 3, + f + ); + } +}; + + +/** + * optional string platform = 1; + * @return {string} + */ +proto.viam.app.agent.v1.HostInfo.prototype.getPlatform = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.viam.app.agent.v1.HostInfo} returns this + */ +proto.viam.app.agent.v1.HostInfo.prototype.setPlatform = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string distro = 2; + * @return {string} + */ +proto.viam.app.agent.v1.HostInfo.prototype.getDistro = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.viam.app.agent.v1.HostInfo} returns this + */ +proto.viam.app.agent.v1.HostInfo.prototype.setDistro = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * repeated string tags = 3; + * @return {!Array} + */ +proto.viam.app.agent.v1.HostInfo.prototype.getTagsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 3)); +}; + + +/** + * @param {!Array} value + * @return {!proto.viam.app.agent.v1.HostInfo} returns this + */ +proto.viam.app.agent.v1.HostInfo.prototype.setTagsList = function(value) { + return jspb.Message.setField(this, 3, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.viam.app.agent.v1.HostInfo} returns this + */ +proto.viam.app.agent.v1.HostInfo.prototype.addTags = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 3, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.viam.app.agent.v1.HostInfo} returns this + */ +proto.viam.app.agent.v1.HostInfo.prototype.clearTagsList = function() { + return this.setTagsList([]); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.viam.app.agent.v1.SubsystemUpdateInfo.prototype.toObject = function(opt_includeInstance) { + return proto.viam.app.agent.v1.SubsystemUpdateInfo.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.viam.app.agent.v1.SubsystemUpdateInfo} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.viam.app.agent.v1.SubsystemUpdateInfo.toObject = function(includeInstance, msg) { + var f, obj = { + filename: jspb.Message.getFieldWithDefault(msg, 1, ""), + url: jspb.Message.getFieldWithDefault(msg, 2, ""), + version: jspb.Message.getFieldWithDefault(msg, 3, ""), + sha256: msg.getSha256_asB64(), + format: jspb.Message.getFieldWithDefault(msg, 5, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.viam.app.agent.v1.SubsystemUpdateInfo} + */ +proto.viam.app.agent.v1.SubsystemUpdateInfo.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.viam.app.agent.v1.SubsystemUpdateInfo; + return proto.viam.app.agent.v1.SubsystemUpdateInfo.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.viam.app.agent.v1.SubsystemUpdateInfo} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.viam.app.agent.v1.SubsystemUpdateInfo} + */ +proto.viam.app.agent.v1.SubsystemUpdateInfo.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setFilename(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setUrl(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setVersion(value); + break; + case 4: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setSha256(value); + break; + case 5: + var value = /** @type {!proto.viam.app.agent.v1.PackageFormat} */ (reader.readEnum()); + msg.setFormat(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.viam.app.agent.v1.SubsystemUpdateInfo.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.viam.app.agent.v1.SubsystemUpdateInfo.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.viam.app.agent.v1.SubsystemUpdateInfo} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.viam.app.agent.v1.SubsystemUpdateInfo.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getFilename(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getUrl(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getVersion(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getSha256_asU8(); + if (f.length > 0) { + writer.writeBytes( + 4, + f + ); + } + f = message.getFormat(); + if (f !== 0.0) { + writer.writeEnum( + 5, + f + ); + } +}; + + +/** + * optional string filename = 1; + * @return {string} + */ +proto.viam.app.agent.v1.SubsystemUpdateInfo.prototype.getFilename = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.viam.app.agent.v1.SubsystemUpdateInfo} returns this + */ +proto.viam.app.agent.v1.SubsystemUpdateInfo.prototype.setFilename = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string url = 2; + * @return {string} + */ +proto.viam.app.agent.v1.SubsystemUpdateInfo.prototype.getUrl = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.viam.app.agent.v1.SubsystemUpdateInfo} returns this + */ +proto.viam.app.agent.v1.SubsystemUpdateInfo.prototype.setUrl = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string version = 3; + * @return {string} + */ +proto.viam.app.agent.v1.SubsystemUpdateInfo.prototype.getVersion = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.viam.app.agent.v1.SubsystemUpdateInfo} returns this + */ +proto.viam.app.agent.v1.SubsystemUpdateInfo.prototype.setVersion = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional bytes sha256 = 4; + * @return {string} + */ +proto.viam.app.agent.v1.SubsystemUpdateInfo.prototype.getSha256 = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * optional bytes sha256 = 4; + * This is a type-conversion wrapper around `getSha256()` + * @return {string} + */ +proto.viam.app.agent.v1.SubsystemUpdateInfo.prototype.getSha256_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getSha256())); +}; + + +/** + * optional bytes sha256 = 4; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getSha256()` + * @return {!Uint8Array} + */ +proto.viam.app.agent.v1.SubsystemUpdateInfo.prototype.getSha256_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getSha256())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.viam.app.agent.v1.SubsystemUpdateInfo} returns this + */ +proto.viam.app.agent.v1.SubsystemUpdateInfo.prototype.setSha256 = function(value) { + return jspb.Message.setProto3BytesField(this, 4, value); +}; + + +/** + * optional PackageFormat format = 5; + * @return {!proto.viam.app.agent.v1.PackageFormat} + */ +proto.viam.app.agent.v1.SubsystemUpdateInfo.prototype.getFormat = function() { + return /** @type {!proto.viam.app.agent.v1.PackageFormat} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); +}; + + +/** + * @param {!proto.viam.app.agent.v1.PackageFormat} value + * @return {!proto.viam.app.agent.v1.SubsystemUpdateInfo} returns this + */ +proto.viam.app.agent.v1.SubsystemUpdateInfo.prototype.setFormat = function(value) { + return jspb.Message.setProto3EnumField(this, 5, value); +}; + + +/** + * @enum {number} + */ +proto.viam.app.agent.v1.PackageFormat = { + PACKAGE_FORMAT_UNSPECIFIED: 0, + PACKAGE_FORMAT_RAW: 1, + PACKAGE_FORMAT_XZ: 2, + PACKAGE_FORMAT_EXECUTABLE: 3, + PACKAGE_FORMAT_XZ_EXECUTABLE: 4 +}; + +goog.object.extend(exports, proto.viam.app.agent.v1); diff --git a/gen/js/app/agent/v1/agent_pb_service.d.ts b/gen/js/app/agent/v1/agent_pb_service.d.ts new file mode 100644 index 000000000..16db22c7d --- /dev/null +++ b/gen/js/app/agent/v1/agent_pb_service.d.ts @@ -0,0 +1,111 @@ +// package: viam.app.agent.v1 +// file: app/agent/v1/agent.proto + +import * as app_agent_v1_agent_pb from "../../../app/agent/v1/agent_pb"; +import {grpc} from "@improbable-eng/grpc-web"; + +type AgentAppServiceGetAgentConfig = { + readonly methodName: string; + readonly service: typeof AgentAppService; + readonly requestStream: false; + readonly responseStream: false; + readonly requestType: typeof app_agent_v1_agent_pb.GetAgentConfigRequest; + readonly responseType: typeof app_agent_v1_agent_pb.GetAgentConfigResponse; +}; + +type AgentAppServiceUpdateAgentConfig = { + readonly methodName: string; + readonly service: typeof AgentAppService; + readonly requestStream: false; + readonly responseStream: false; + readonly requestType: typeof app_agent_v1_agent_pb.UpdateAgentConfigRequest; + readonly responseType: typeof app_agent_v1_agent_pb.UpdateAgentConfigResponse; +}; + +export class AgentAppService { + static readonly serviceName: string; + static readonly GetAgentConfig: AgentAppServiceGetAgentConfig; + static readonly UpdateAgentConfig: AgentAppServiceUpdateAgentConfig; +} + +type AgentDeviceServiceDeviceAgentConfig = { + readonly methodName: string; + readonly service: typeof AgentDeviceService; + readonly requestStream: false; + readonly responseStream: false; + readonly requestType: typeof app_agent_v1_agent_pb.DeviceAgentConfigRequest; + readonly responseType: typeof app_agent_v1_agent_pb.DeviceAgentConfigResponse; +}; + +export class AgentDeviceService { + static readonly serviceName: string; + static readonly DeviceAgentConfig: AgentDeviceServiceDeviceAgentConfig; +} + +export type ServiceError = { message: string, code: number; metadata: grpc.Metadata } +export type Status = { details: string, code: number; metadata: grpc.Metadata } + +interface UnaryResponse { + cancel(): void; +} +interface ResponseStream { + cancel(): void; + on(type: 'data', handler: (message: T) => void): ResponseStream; + on(type: 'end', handler: (status?: Status) => void): ResponseStream; + on(type: 'status', handler: (status: Status) => void): ResponseStream; +} +interface RequestStream { + write(message: T): RequestStream; + end(): void; + cancel(): void; + on(type: 'end', handler: (status?: Status) => void): RequestStream; + on(type: 'status', handler: (status: Status) => void): RequestStream; +} +interface BidirectionalStream { + write(message: ReqT): BidirectionalStream; + end(): void; + cancel(): void; + on(type: 'data', handler: (message: ResT) => void): BidirectionalStream; + on(type: 'end', handler: (status?: Status) => void): BidirectionalStream; + on(type: 'status', handler: (status: Status) => void): BidirectionalStream; +} + +export class AgentAppServiceClient { + readonly serviceHost: string; + + constructor(serviceHost: string, options?: grpc.RpcOptions); + getAgentConfig( + requestMessage: app_agent_v1_agent_pb.GetAgentConfigRequest, + metadata: grpc.Metadata, + callback: (error: ServiceError|null, responseMessage: app_agent_v1_agent_pb.GetAgentConfigResponse|null) => void + ): UnaryResponse; + getAgentConfig( + requestMessage: app_agent_v1_agent_pb.GetAgentConfigRequest, + callback: (error: ServiceError|null, responseMessage: app_agent_v1_agent_pb.GetAgentConfigResponse|null) => void + ): UnaryResponse; + updateAgentConfig( + requestMessage: app_agent_v1_agent_pb.UpdateAgentConfigRequest, + metadata: grpc.Metadata, + callback: (error: ServiceError|null, responseMessage: app_agent_v1_agent_pb.UpdateAgentConfigResponse|null) => void + ): UnaryResponse; + updateAgentConfig( + requestMessage: app_agent_v1_agent_pb.UpdateAgentConfigRequest, + callback: (error: ServiceError|null, responseMessage: app_agent_v1_agent_pb.UpdateAgentConfigResponse|null) => void + ): UnaryResponse; +} + +export class AgentDeviceServiceClient { + readonly serviceHost: string; + + constructor(serviceHost: string, options?: grpc.RpcOptions); + deviceAgentConfig( + requestMessage: app_agent_v1_agent_pb.DeviceAgentConfigRequest, + metadata: grpc.Metadata, + callback: (error: ServiceError|null, responseMessage: app_agent_v1_agent_pb.DeviceAgentConfigResponse|null) => void + ): UnaryResponse; + deviceAgentConfig( + requestMessage: app_agent_v1_agent_pb.DeviceAgentConfigRequest, + callback: (error: ServiceError|null, responseMessage: app_agent_v1_agent_pb.DeviceAgentConfigResponse|null) => void + ): UnaryResponse; +} + diff --git a/gen/js/app/agent/v1/agent_pb_service.js b/gen/js/app/agent/v1/agent_pb_service.js new file mode 100644 index 000000000..2c4f6816b --- /dev/null +++ b/gen/js/app/agent/v1/agent_pb_service.js @@ -0,0 +1,156 @@ +// package: viam.app.agent.v1 +// file: app/agent/v1/agent.proto + +var app_agent_v1_agent_pb = require("../../../app/agent/v1/agent_pb"); +var grpc = require("@improbable-eng/grpc-web").grpc; + +var AgentAppService = (function () { + function AgentAppService() {} + AgentAppService.serviceName = "viam.app.agent.v1.AgentAppService"; + return AgentAppService; +}()); + +AgentAppService.GetAgentConfig = { + methodName: "GetAgentConfig", + service: AgentAppService, + requestStream: false, + responseStream: false, + requestType: app_agent_v1_agent_pb.GetAgentConfigRequest, + responseType: app_agent_v1_agent_pb.GetAgentConfigResponse +}; + +AgentAppService.UpdateAgentConfig = { + methodName: "UpdateAgentConfig", + service: AgentAppService, + requestStream: false, + responseStream: false, + requestType: app_agent_v1_agent_pb.UpdateAgentConfigRequest, + responseType: app_agent_v1_agent_pb.UpdateAgentConfigResponse +}; + +exports.AgentAppService = AgentAppService; + +function AgentAppServiceClient(serviceHost, options) { + this.serviceHost = serviceHost; + this.options = options || {}; +} + +AgentAppServiceClient.prototype.getAgentConfig = function getAgentConfig(requestMessage, metadata, callback) { + if (arguments.length === 2) { + callback = arguments[1]; + } + var client = grpc.unary(AgentAppService.GetAgentConfig, { + request: requestMessage, + host: this.serviceHost, + metadata: metadata, + transport: this.options.transport, + debug: this.options.debug, + onEnd: function (response) { + if (callback) { + if (response.status !== grpc.Code.OK) { + var err = new Error(response.statusMessage); + err.code = response.status; + err.metadata = response.trailers; + callback(err, null); + } else { + callback(null, response.message); + } + } + } + }); + return { + cancel: function () { + callback = null; + client.close(); + } + }; +}; + +AgentAppServiceClient.prototype.updateAgentConfig = function updateAgentConfig(requestMessage, metadata, callback) { + if (arguments.length === 2) { + callback = arguments[1]; + } + var client = grpc.unary(AgentAppService.UpdateAgentConfig, { + request: requestMessage, + host: this.serviceHost, + metadata: metadata, + transport: this.options.transport, + debug: this.options.debug, + onEnd: function (response) { + if (callback) { + if (response.status !== grpc.Code.OK) { + var err = new Error(response.statusMessage); + err.code = response.status; + err.metadata = response.trailers; + callback(err, null); + } else { + callback(null, response.message); + } + } + } + }); + return { + cancel: function () { + callback = null; + client.close(); + } + }; +}; + +exports.AgentAppServiceClient = AgentAppServiceClient; + +var AgentDeviceService = (function () { + function AgentDeviceService() {} + AgentDeviceService.serviceName = "viam.app.agent.v1.AgentDeviceService"; + return AgentDeviceService; +}()); + +AgentDeviceService.DeviceAgentConfig = { + methodName: "DeviceAgentConfig", + service: AgentDeviceService, + requestStream: false, + responseStream: false, + requestType: app_agent_v1_agent_pb.DeviceAgentConfigRequest, + responseType: app_agent_v1_agent_pb.DeviceAgentConfigResponse +}; + +exports.AgentDeviceService = AgentDeviceService; + +function AgentDeviceServiceClient(serviceHost, options) { + this.serviceHost = serviceHost; + this.options = options || {}; +} + +AgentDeviceServiceClient.prototype.deviceAgentConfig = function deviceAgentConfig(requestMessage, metadata, callback) { + if (arguments.length === 2) { + callback = arguments[1]; + } + var client = grpc.unary(AgentDeviceService.DeviceAgentConfig, { + request: requestMessage, + host: this.serviceHost, + metadata: metadata, + transport: this.options.transport, + debug: this.options.debug, + onEnd: function (response) { + if (callback) { + if (response.status !== grpc.Code.OK) { + var err = new Error(response.statusMessage); + err.code = response.status; + err.metadata = response.trailers; + callback(err, null); + } else { + callback(null, response.message); + } + } + } + }); + return { + cancel: function () { + callback = null; + client.close(); + } + }; +}; + +exports.AgentDeviceServiceClient = AgentDeviceServiceClient; + diff --git a/proto/viam/app/agent/v1/agent.proto b/proto/viam/app/agent/v1/agent.proto new file mode 100644 index 000000000..727494b7c --- /dev/null +++ b/proto/viam/app/agent/v1/agent.proto @@ -0,0 +1,114 @@ +syntax = "proto3"; + +package viam.app.agent.v1; + +import "google/protobuf/duration.proto"; +import "tagger/v1/tagger.proto"; + +option go_package = "go.viam.com/api/app/agent/v1"; + +// AgentService is used by viam-agent to retrieve update info for subsystems. +service AgentAppService { + // GetAgentConfig is for retrieving config in App. + rpc GetAgentConfig(GetAgentConfigRequest) returns (GetAgentConfigResponse); + + // UpdateAgentConfig is for editing config in App. + rpc UpdateAgentConfig(UpdateAgentConfigRequest) returns (UpdateAgentConfigResponse); +} + +service AgentDeviceService { + // DeviceAgentConfig is for retrieving config by the on-device agent. + rpc DeviceAgentConfig(DeviceAgentConfigRequest) returns (DeviceAgentConfigResponse); +} + +// App side +message GetAgentConfigRequest { + string id = 1; +} + +message GetAgentConfigResponse { + AppAgentConfig agent_config = 1; +} + +message UpdateAgentConfigRequest { + string id = 1; + AppAgentConfig agent_config = 2; +} + +message UpdateAgentConfigResponse { + AppAgentConfig agent_config = 1; +} + +message AppAgentConfig { + map subsystem_configs = 1 [(tagger.v1.tags) = "bson:\"subsystem_configs\" json:\"subsystem_configs\""]; +} + +message AppSubsystemConfig { + string release_channel = 1 [(tagger.v1.tags) = "bson:\"release_channel\" json:\"release_channel\""]; + string pin_version = 2 [(tagger.v1.tags) = "bson:\"pin_version\" json:\"pin_version\""]; + string pin_url = 3 [(tagger.v1.tags) = "bson:\"pin_url\" json:\"pin_url\""]; + bool disable_subsystem = 4 [(tagger.v1.tags) = "bson:\"disable_subsystem\" json:\"disable_subsystem\""]; +} + +// Device side +message DeviceAgentConfigRequest { + // robot partID + string id = 1; + // info about the host system + HostInfo host_info = 2; + // current subsystems and versions + map subsystem_versions = 3; +} + +message DeviceAgentConfigResponse { + // subsystems to be installed/configured/updated + // note: previously installed subsystems will be removed from the system if removed from this list + map subsystem_configs = 1; + // how often this request should be repeated + google.protobuf.Duration check_interval = 2; +} + +message DeviceSubsystemConfig { + // data needed to download/validate the subsystem + SubsystemUpdateInfo update_info = 1; + // if this subsystem is disabled and should not be started by the agent + bool disable = 2; + // force_restart will restart the subsystem, even if no updates are available + bool force_restart = 3; +} + +message HostInfo { + // platform is the docker styled combination of kernel and architecture. Ex: linux/amd64, darwin/arm64 + string platform = 1; + // ID and VERSION_ID fields from /etc/os-release, colon seperated. Ex: ubuntu:22.04, debian:11 + string distro = 2; + // additional tags for specific hardware or software that's present and may affect software selection + // ex: "jetson", "rpi4", "systemd", etc. + repeated string tags = 3; +} + +message SubsystemUpdateInfo { + // unpacked filename as it is expected on disk (regardless of url) + string filename = 1; + // url to download from + string url = 2; + // version expected at the url + string version = 3; + // sha256 sum of file as downloaded + bytes sha256 = 4; + // determines if decompression or executable permissions are needed + PackageFormat format = 5; +} + +enum PackageFormat { + // unknown/unset (autodetection may be attempted) + PACKAGE_FORMAT_UNSPECIFIED = 0; + // do nothing + PACKAGE_FORMAT_RAW = 1; + // decompress .xz file + PACKAGE_FORMAT_XZ = 2; + // set executable permissions + PACKAGE_FORMAT_EXECUTABLE = 3; + // decompress and set executable + PACKAGE_FORMAT_XZ_EXECUTABLE = 4; +} diff --git a/service/datamanager/v1/data_manager.pb.gw.go b/service/datamanager/v1/data_manager.pb.gw.go index 5a7e61ab2..5f497f653 100644 --- a/service/datamanager/v1/data_manager.pb.gw.go +++ b/service/datamanager/v1/data_manager.pb.gw.go @@ -15,7 +15,7 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - v1_0 "go.viam.com/api/common/v1" + "go.viam.com/api/common/v1" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" @@ -107,7 +107,7 @@ var ( ) func request_DataManagerService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, client DataManagerServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1_0.DoCommandRequest + var protoReq v1.DoCommandRequest var metadata runtime.ServerMetadata var ( @@ -140,7 +140,7 @@ func request_DataManagerService_DoCommand_0(ctx context.Context, marshaler runti } func local_request_DataManagerService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, server DataManagerServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1_0.DoCommandRequest + var protoReq v1.DoCommandRequest var metadata runtime.ServerMetadata var ( diff --git a/service/motion/v1/motion.pb.gw.go b/service/motion/v1/motion.pb.gw.go index 91bc2a4b0..aa33b532f 100644 --- a/service/motion/v1/motion.pb.gw.go +++ b/service/motion/v1/motion.pb.gw.go @@ -15,7 +15,7 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - v1_0 "go.viam.com/api/common/v1" + "go.viam.com/api/common/v1" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" @@ -597,7 +597,7 @@ var ( ) func request_MotionService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, client MotionServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1_0.DoCommandRequest + var protoReq v1.DoCommandRequest var metadata runtime.ServerMetadata var ( @@ -630,7 +630,7 @@ func request_MotionService_DoCommand_0(ctx context.Context, marshaler runtime.Ma } func local_request_MotionService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, server MotionServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1_0.DoCommandRequest + var protoReq v1.DoCommandRequest var metadata runtime.ServerMetadata var ( diff --git a/service/sensors/v1/sensors.pb.gw.go b/service/sensors/v1/sensors.pb.gw.go index 9fc2a2808..b0c69d02f 100644 --- a/service/sensors/v1/sensors.pb.gw.go +++ b/service/sensors/v1/sensors.pb.gw.go @@ -15,7 +15,7 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - v1_0 "go.viam.com/api/common/v1" + "go.viam.com/api/common/v1" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" @@ -177,7 +177,7 @@ var ( ) func request_SensorsService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, client SensorsServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1_0.DoCommandRequest + var protoReq v1.DoCommandRequest var metadata runtime.ServerMetadata var ( @@ -210,7 +210,7 @@ func request_SensorsService_DoCommand_0(ctx context.Context, marshaler runtime.M } func local_request_SensorsService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, server SensorsServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1_0.DoCommandRequest + var protoReq v1.DoCommandRequest var metadata runtime.ServerMetadata var ( diff --git a/service/vision/v1/vision.pb.gw.go b/service/vision/v1/vision.pb.gw.go index bb8aa90da..174735d0a 100644 --- a/service/vision/v1/vision.pb.gw.go +++ b/service/vision/v1/vision.pb.gw.go @@ -15,7 +15,7 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "go.viam.com/api/common/v1" + v1_0 "go.viam.com/api/common/v1" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" @@ -387,7 +387,7 @@ var ( ) func request_VisionService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, client VisionServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.DoCommandRequest + var protoReq v1_0.DoCommandRequest var metadata runtime.ServerMetadata var ( @@ -420,7 +420,7 @@ func request_VisionService_DoCommand_0(ctx context.Context, marshaler runtime.Ma } func local_request_VisionService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, server VisionServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.DoCommandRequest + var protoReq v1_0.DoCommandRequest var metadata runtime.ServerMetadata var (