Skip to content

Commit 8b94c06

Browse files
github-actions[bot]viambotbenjirewis
authored
Automated Protos Update (#228)
Co-authored-by: viambot <[email protected]> Co-authored-by: Benji Rewis <[email protected]>
1 parent e3d6bbc commit 8b94c06

File tree

14 files changed

+87
-83
lines changed

14 files changed

+87
-83
lines changed

src/viam/components/generic/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
from typing import Any, Mapping, Optional
22
from grpclib import GRPCError, Status
33
from grpclib.client import Channel
4-
from viam.proto.component.generic import GenericServiceStub, DoCommandRequest, DoCommandResponse
4+
from viam.proto.common import DoCommandRequest, DoCommandResponse
5+
from viam.proto.component.generic import GenericServiceStub
56
from viam.utils import dict_to_struct, struct_to_dict, ValueTypes
67

78
from .generic import Generic

src/viam/components/generic/service.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@
44
from viam.components.component_base import ComponentBase
55
from viam.components.service_base import ComponentServiceBase
66
from viam.errors import ResourceNotFoundError
7-
from viam.proto.component.generic import (
8-
DoCommandRequest,
9-
DoCommandResponse,
10-
GenericServiceBase,
11-
)
7+
from viam.proto.component.generic import GenericServiceBase
8+
from viam.proto.common import DoCommandRequest, DoCommandResponse
129
from viam.utils import dict_to_struct, struct_to_dict
1310

1411
# from .generic import Generic

src/viam/gen/component/generic/v1/generic_grpc.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@
44
import grpclib.client
55
if typing.TYPE_CHECKING:
66
import grpclib.server
7+
from .... import common
78
import google.api.annotations_pb2
8-
import google.protobuf.struct_pb2
99
from .... import component
1010

1111
class GenericServiceBase(abc.ABC):
1212

1313
@abc.abstractmethod
14-
async def DoCommand(self, stream: 'grpclib.server.Stream[component.generic.v1.generic_pb2.DoCommandRequest, component.generic.v1.generic_pb2.DoCommandResponse]') -> None:
14+
async def DoCommand(self, stream: 'grpclib.server.Stream[common.v1.common_pb2.DoCommandRequest, common.v1.common_pb2.DoCommandResponse]') -> None:
1515
pass
1616

1717
def __mapping__(self) -> typing.Dict[str, grpclib.const.Handler]:
18-
return {'/viam.component.generic.v1.GenericService/DoCommand': grpclib.const.Handler(self.DoCommand, grpclib.const.Cardinality.UNARY_UNARY, component.generic.v1.generic_pb2.DoCommandRequest, component.generic.v1.generic_pb2.DoCommandResponse)}
18+
return {'/viam.component.generic.v1.GenericService/DoCommand': grpclib.const.Handler(self.DoCommand, grpclib.const.Cardinality.UNARY_UNARY, common.v1.common_pb2.DoCommandRequest, common.v1.common_pb2.DoCommandResponse)}
1919

2020
class GenericServiceStub:
2121

2222
def __init__(self, channel: grpclib.client.Channel) -> None:
23-
self.DoCommand = grpclib.client.UnaryUnaryMethod(channel, '/viam.component.generic.v1.GenericService/DoCommand', component.generic.v1.generic_pb2.DoCommandRequest, component.generic.v1.generic_pb2.DoCommandResponse)
23+
self.DoCommand = grpclib.client.UnaryUnaryMethod(channel, '/viam.component.generic.v1.GenericService/DoCommand', common.v1.common_pb2.DoCommandRequest, common.v1.common_pb2.DoCommandResponse)

src/viam/gen/component/generic/v1/generic_pb2.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,15 @@
44
from google.protobuf import descriptor_pool as _descriptor_pool
55
from google.protobuf import symbol_database as _symbol_database
66
_sym_db = _symbol_database.Default()
7+
from ....common.v1 import common_pb2 as common_dot_v1_dot_common__pb2
78
from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2
8-
from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2
9-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n"component/generic/v1/generic.proto\x12\x19viam.component.generic.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x1cgoogle/protobuf/struct.proto"Y\n\x10DoCommandRequest\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x121\n\x07command\x18\x02 \x01(\x0b2\x17.google.protobuf.StructR\x07command"D\n\x11DoCommandResponse\x12/\n\x06result\x18\x01 \x01(\x0b2\x17.google.protobuf.StructR\x06result2\xb3\x01\n\x0eGenericService\x12\xa0\x01\n\tDoCommand\x12+.viam.component.generic.v1.DoCommandRequest\x1a,.viam.component.generic.v1.DoCommandResponse"8\x82\xd3\xe4\x93\x022"0/viam/api/v1/component/generic/{name}/do_commandBE\n\x1dcom.viam.component.generic.v1Z$go.viam.com/api/component/generic/v1b\x06proto3')
9+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n"component/generic/v1/generic.proto\x12\x19viam.component.generic.v1\x1a\x16common/v1/common.proto\x1a\x1cgoogle/api/annotations.proto2\x9d\x01\n\x0eGenericService\x12\x8a\x01\n\tDoCommand\x12 .viam.common.v1.DoCommandRequest\x1a!.viam.common.v1.DoCommandResponse"8\x82\xd3\xe4\x93\x022"0/viam/api/v1/component/generic/{name}/do_commandBE\n\x1dcom.viam.component.generic.v1Z$go.viam.com/api/component/generic/v1b\x06proto3')
1010
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
1111
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'component.generic.v1.generic_pb2', globals())
1212
if _descriptor._USE_C_DESCRIPTORS == False:
1313
DESCRIPTOR._options = None
1414
DESCRIPTOR._serialized_options = b'\n\x1dcom.viam.component.generic.v1Z$go.viam.com/api/component/generic/v1'
1515
_GENERICSERVICE.methods_by_name['DoCommand']._options = None
1616
_GENERICSERVICE.methods_by_name['DoCommand']._serialized_options = b'\x82\xd3\xe4\x93\x022"0/viam/api/v1/component/generic/{name}/do_command'
17-
_DOCOMMANDREQUEST._serialized_start = 125
18-
_DOCOMMANDREQUEST._serialized_end = 214
19-
_DOCOMMANDRESPONSE._serialized_start = 216
20-
_DOCOMMANDRESPONSE._serialized_end = 284
21-
_GENERICSERVICE._serialized_start = 287
22-
_GENERICSERVICE._serialized_end = 466
17+
_GENERICSERVICE._serialized_start = 120
18+
_GENERICSERVICE._serialized_end = 277

src/viam/gen/component/generic/v1/generic_pb2.pyi

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -2,53 +2,5 @@
22
@generated by mypy-protobuf. Do not edit manually!
33
isort:skip_file
44
"""
5-
import builtins
65
import google.protobuf.descriptor
7-
import google.protobuf.message
8-
import google.protobuf.struct_pb2
9-
import sys
10-
if sys.version_info >= (3, 8):
11-
import typing as typing_extensions
12-
else:
13-
import typing_extensions
14-
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
15-
16-
@typing_extensions.final
17-
class DoCommandRequest(google.protobuf.message.Message):
18-
DESCRIPTOR: google.protobuf.descriptor.Descriptor
19-
NAME_FIELD_NUMBER: builtins.int
20-
COMMAND_FIELD_NUMBER: builtins.int
21-
name: builtins.str
22-
23-
@property
24-
def command(self) -> google.protobuf.struct_pb2.Struct:
25-
...
26-
27-
def __init__(self, *, name: builtins.str=..., command: google.protobuf.struct_pb2.Struct | None=...) -> None:
28-
...
29-
30-
def HasField(self, field_name: typing_extensions.Literal['command', b'command']) -> builtins.bool:
31-
...
32-
33-
def ClearField(self, field_name: typing_extensions.Literal['command', b'command', 'name', b'name']) -> None:
34-
...
35-
global___DoCommandRequest = DoCommandRequest
36-
37-
@typing_extensions.final
38-
class DoCommandResponse(google.protobuf.message.Message):
39-
DESCRIPTOR: google.protobuf.descriptor.Descriptor
40-
RESULT_FIELD_NUMBER: builtins.int
41-
42-
@property
43-
def result(self) -> google.protobuf.struct_pb2.Struct:
44-
...
45-
46-
def __init__(self, *, result: google.protobuf.struct_pb2.Struct | None=...) -> None:
47-
...
48-
49-
def HasField(self, field_name: typing_extensions.Literal['result', b'result']) -> builtins.bool:
50-
...
51-
52-
def ClearField(self, field_name: typing_extensions.Literal['result', b'result']) -> None:
53-
...
54-
global___DoCommandResponse = DoCommandResponse
6+
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor

src/viam/gen/module/v1/module_grpc.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,18 @@ async def RemoveResource(self, stream: 'grpclib.server.Stream[module.v1.module_p
2626
async def Ready(self, stream: 'grpclib.server.Stream[module.v1.module_pb2.ReadyRequest, module.v1.module_pb2.ReadyResponse]') -> None:
2727
pass
2828

29+
@abc.abstractmethod
30+
async def ValidateConfig(self, stream: 'grpclib.server.Stream[module.v1.module_pb2.ValidateConfigRequest, module.v1.module_pb2.ValidateConfigResponse]') -> None:
31+
pass
32+
2933
def __mapping__(self) -> typing.Dict[str, grpclib.const.Handler]:
30-
return {'/viam.module.v1.ModuleService/AddResource': grpclib.const.Handler(self.AddResource, grpclib.const.Cardinality.UNARY_UNARY, module.v1.module_pb2.AddResourceRequest, module.v1.module_pb2.AddResourceResponse), '/viam.module.v1.ModuleService/ReconfigureResource': grpclib.const.Handler(self.ReconfigureResource, grpclib.const.Cardinality.UNARY_UNARY, module.v1.module_pb2.ReconfigureResourceRequest, module.v1.module_pb2.ReconfigureResourceResponse), '/viam.module.v1.ModuleService/RemoveResource': grpclib.const.Handler(self.RemoveResource, grpclib.const.Cardinality.UNARY_UNARY, module.v1.module_pb2.RemoveResourceRequest, module.v1.module_pb2.RemoveResourceResponse), '/viam.module.v1.ModuleService/Ready': grpclib.const.Handler(self.Ready, grpclib.const.Cardinality.UNARY_UNARY, module.v1.module_pb2.ReadyRequest, module.v1.module_pb2.ReadyResponse)}
34+
return {'/viam.module.v1.ModuleService/AddResource': grpclib.const.Handler(self.AddResource, grpclib.const.Cardinality.UNARY_UNARY, module.v1.module_pb2.AddResourceRequest, module.v1.module_pb2.AddResourceResponse), '/viam.module.v1.ModuleService/ReconfigureResource': grpclib.const.Handler(self.ReconfigureResource, grpclib.const.Cardinality.UNARY_UNARY, module.v1.module_pb2.ReconfigureResourceRequest, module.v1.module_pb2.ReconfigureResourceResponse), '/viam.module.v1.ModuleService/RemoveResource': grpclib.const.Handler(self.RemoveResource, grpclib.const.Cardinality.UNARY_UNARY, module.v1.module_pb2.RemoveResourceRequest, module.v1.module_pb2.RemoveResourceResponse), '/viam.module.v1.ModuleService/Ready': grpclib.const.Handler(self.Ready, grpclib.const.Cardinality.UNARY_UNARY, module.v1.module_pb2.ReadyRequest, module.v1.module_pb2.ReadyResponse), '/viam.module.v1.ModuleService/ValidateConfig': grpclib.const.Handler(self.ValidateConfig, grpclib.const.Cardinality.UNARY_UNARY, module.v1.module_pb2.ValidateConfigRequest, module.v1.module_pb2.ValidateConfigResponse)}
3135

3236
class ModuleServiceStub:
3337

3438
def __init__(self, channel: grpclib.client.Channel) -> None:
3539
self.AddResource = grpclib.client.UnaryUnaryMethod(channel, '/viam.module.v1.ModuleService/AddResource', module.v1.module_pb2.AddResourceRequest, module.v1.module_pb2.AddResourceResponse)
3640
self.ReconfigureResource = grpclib.client.UnaryUnaryMethod(channel, '/viam.module.v1.ModuleService/ReconfigureResource', module.v1.module_pb2.ReconfigureResourceRequest, module.v1.module_pb2.ReconfigureResourceResponse)
3741
self.RemoveResource = grpclib.client.UnaryUnaryMethod(channel, '/viam.module.v1.ModuleService/RemoveResource', module.v1.module_pb2.RemoveResourceRequest, module.v1.module_pb2.RemoveResourceResponse)
38-
self.Ready = grpclib.client.UnaryUnaryMethod(channel, '/viam.module.v1.ModuleService/Ready', module.v1.module_pb2.ReadyRequest, module.v1.module_pb2.ReadyResponse)
42+
self.Ready = grpclib.client.UnaryUnaryMethod(channel, '/viam.module.v1.ModuleService/Ready', module.v1.module_pb2.ReadyRequest, module.v1.module_pb2.ReadyResponse)
43+
self.ValidateConfig = grpclib.client.UnaryUnaryMethod(channel, '/viam.module.v1.ModuleService/ValidateConfig', module.v1.module_pb2.ValidateConfigRequest, module.v1.module_pb2.ValidateConfigResponse)

src/viam/gen/module/v1/module_pb2.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
_sym_db = _symbol_database.Default()
77
from ...app.v1 import robot_pb2 as app_dot_v1_dot_robot__pb2
88
from ...robot.v1 import robot_pb2 as robot_dot_v1_dot_robot__pb2
9-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x16module/v1/module.proto\x12\x0eviam.module.v1\x1a\x12app/v1/robot.proto\x1a\x14robot/v1/robot.proto"n\n\x12AddResourceRequest\x124\n\x06config\x18\x01 \x01(\x0b2\x1c.viam.app.v1.ComponentConfigR\x06config\x12"\n\x0cdependencies\x18\x02 \x03(\tR\x0cdependencies"\x15\n\x13AddResourceResponse"v\n\x1aReconfigureResourceRequest\x124\n\x06config\x18\x01 \x01(\x0b2\x1c.viam.app.v1.ComponentConfigR\x06config\x12"\n\x0cdependencies\x18\x02 \x03(\tR\x0cdependencies"\x1d\n\x1bReconfigureResourceResponse"+\n\x15RemoveResourceRequest\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name"\x18\n\x16RemoveResourceResponse"h\n\x11HandlerDefinition\x12;\n\x07subtype\x18\x01 \x01(\x0b2!.viam.robot.v1.ResourceRPCSubtypeR\x07subtype\x12\x16\n\x06models\x18\x02 \x03(\tR\x06models"K\n\nHandlerMap\x12=\n\x08handlers\x18\x01 \x03(\x0b2!.viam.module.v1.HandlerDefinitionR\x08handlers"5\n\x0cReadyRequest\x12%\n\x0eparent_address\x18\x01 \x01(\tR\rparentAddress"a\n\rReadyResponse\x12\x14\n\x05ready\x18\x01 \x01(\x08R\x05ready\x12:\n\nhandlermap\x18\x02 \x01(\x0b2\x1a.viam.module.v1.HandlerMapR\nhandlermap2\xfe\x02\n\rModuleService\x12V\n\x0bAddResource\x12".viam.module.v1.AddResourceRequest\x1a#.viam.module.v1.AddResourceResponse\x12n\n\x13ReconfigureResource\x12*.viam.module.v1.ReconfigureResourceRequest\x1a+.viam.module.v1.ReconfigureResourceResponse\x12_\n\x0eRemoveResource\x12%.viam.module.v1.RemoveResourceRequest\x1a&.viam.module.v1.RemoveResourceResponse\x12D\n\x05Ready\x12\x1c.viam.module.v1.ReadyRequest\x1a\x1d.viam.module.v1.ReadyResponseB\x1bZ\x19go.viam.com/api/module/v1b\x06proto3')
9+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x16module/v1/module.proto\x12\x0eviam.module.v1\x1a\x12app/v1/robot.proto\x1a\x14robot/v1/robot.proto"n\n\x12AddResourceRequest\x124\n\x06config\x18\x01 \x01(\x0b2\x1c.viam.app.v1.ComponentConfigR\x06config\x12"\n\x0cdependencies\x18\x02 \x03(\tR\x0cdependencies"\x15\n\x13AddResourceResponse"v\n\x1aReconfigureResourceRequest\x124\n\x06config\x18\x01 \x01(\x0b2\x1c.viam.app.v1.ComponentConfigR\x06config\x12"\n\x0cdependencies\x18\x02 \x03(\tR\x0cdependencies"\x1d\n\x1bReconfigureResourceResponse"+\n\x15RemoveResourceRequest\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name"\x18\n\x16RemoveResourceResponse"h\n\x11HandlerDefinition\x12;\n\x07subtype\x18\x01 \x01(\x0b2!.viam.robot.v1.ResourceRPCSubtypeR\x07subtype\x12\x16\n\x06models\x18\x02 \x03(\tR\x06models"K\n\nHandlerMap\x12=\n\x08handlers\x18\x01 \x03(\x0b2!.viam.module.v1.HandlerDefinitionR\x08handlers"5\n\x0cReadyRequest\x12%\n\x0eparent_address\x18\x01 \x01(\tR\rparentAddress"a\n\rReadyResponse\x12\x14\n\x05ready\x18\x01 \x01(\x08R\x05ready\x12:\n\nhandlermap\x18\x02 \x01(\x0b2\x1a.viam.module.v1.HandlerMapR\nhandlermap"M\n\x15ValidateConfigRequest\x124\n\x06config\x18\x01 \x01(\x0b2\x1c.viam.app.v1.ComponentConfigR\x06config"<\n\x16ValidateConfigResponse\x12"\n\x0cdependencies\x18\x01 \x03(\tR\x0cdependencies2\xdf\x03\n\rModuleService\x12V\n\x0bAddResource\x12".viam.module.v1.AddResourceRequest\x1a#.viam.module.v1.AddResourceResponse\x12n\n\x13ReconfigureResource\x12*.viam.module.v1.ReconfigureResourceRequest\x1a+.viam.module.v1.ReconfigureResourceResponse\x12_\n\x0eRemoveResource\x12%.viam.module.v1.RemoveResourceRequest\x1a&.viam.module.v1.RemoveResourceResponse\x12D\n\x05Ready\x12\x1c.viam.module.v1.ReadyRequest\x1a\x1d.viam.module.v1.ReadyResponse\x12_\n\x0eValidateConfig\x12%.viam.module.v1.ValidateConfigRequest\x1a&.viam.module.v1.ValidateConfigResponseB\x1bZ\x19go.viam.com/api/module/v1b\x06proto3')
1010
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
1111
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'module.v1.module_pb2', globals())
1212
if _descriptor._USE_C_DESCRIPTORS == False:
@@ -32,5 +32,9 @@
3232
_READYREQUEST._serialized_end = 677
3333
_READYRESPONSE._serialized_start = 679
3434
_READYRESPONSE._serialized_end = 776
35-
_MODULESERVICE._serialized_start = 779
36-
_MODULESERVICE._serialized_end = 1161
35+
_VALIDATECONFIGREQUEST._serialized_start = 778
36+
_VALIDATECONFIGREQUEST._serialized_end = 855
37+
_VALIDATECONFIGRESPONSE._serialized_start = 857
38+
_VALIDATECONFIGRESPONSE._serialized_end = 917
39+
_MODULESERVICE._serialized_start = 920
40+
_MODULESERVICE._serialized_end = 1399

src/viam/gen/module/v1/module_pb2.pyi

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,4 +173,39 @@ class ReadyResponse(google.protobuf.message.Message):
173173

174174
def ClearField(self, field_name: typing_extensions.Literal['handlermap', b'handlermap', 'ready', b'ready']) -> None:
175175
...
176-
global___ReadyResponse = ReadyResponse
176+
global___ReadyResponse = ReadyResponse
177+
178+
@typing_extensions.final
179+
class ValidateConfigRequest(google.protobuf.message.Message):
180+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
181+
CONFIG_FIELD_NUMBER: builtins.int
182+
183+
@property
184+
def config(self) -> app.v1.robot_pb2.ComponentConfig:
185+
...
186+
187+
def __init__(self, *, config: app.v1.robot_pb2.ComponentConfig | None=...) -> None:
188+
...
189+
190+
def HasField(self, field_name: typing_extensions.Literal['config', b'config']) -> builtins.bool:
191+
...
192+
193+
def ClearField(self, field_name: typing_extensions.Literal['config', b'config']) -> None:
194+
...
195+
global___ValidateConfigRequest = ValidateConfigRequest
196+
197+
@typing_extensions.final
198+
class ValidateConfigResponse(google.protobuf.message.Message):
199+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
200+
DEPENDENCIES_FIELD_NUMBER: builtins.int
201+
202+
@property
203+
def dependencies(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]:
204+
...
205+
206+
def __init__(self, *, dependencies: collections.abc.Iterable[builtins.str] | None=...) -> None:
207+
...
208+
209+
def ClearField(self, field_name: typing_extensions.Literal['dependencies', b'dependencies']) -> None:
210+
...
211+
global___ValidateConfigResponse = ValidateConfigResponse

0 commit comments

Comments
 (0)