Skip to content

Commit

Permalink
Automated Protos Update (#186)
Browse files Browse the repository at this point in the history
* [WORKFLOW] Updating protos from viamrobotics/api, commit: bd20b59091513f2ba7718388652e0c07e4c09d5d

* Add unimplemented board function

---------

Co-authored-by: viambot <[email protected]>
Co-authored-by: Naveed Jooma <[email protected]>
  • Loading branch information
3 people authored Mar 18, 2024
1 parent c65b3e3 commit bd710a7
Show file tree
Hide file tree
Showing 9 changed files with 402 additions and 3 deletions.
6 changes: 6 additions & 0 deletions lib/src/components/board/service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,10 @@ class BoardService extends BoardServiceBase {
await board.writeAnalog(request.pin, request.value, extra: request.extra.toMap());
return WriteAnalogResponse();
}

@override
Stream<StreamTicksResponse> streamTicks(ServiceCall call, StreamTicksRequest request) {
// TODO: implement streamTicks
throw UnimplementedError();
}
}
158 changes: 158 additions & 0 deletions lib/src/gen/component/board/v1/board.pb.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1303,6 +1303,164 @@ class GetDigitalInterruptValueResponse extends $pb.GeneratedMessage {
void clearValue() => clearField(1);
}

class StreamTicksRequest extends $pb.GeneratedMessage {
factory StreamTicksRequest({
$core.String? name,
$core.Iterable<$core.String>? pinNames,
$2.Struct? extra,
}) {
final $result = create();
if (name != null) {
$result.name = name;
}
if (pinNames != null) {
$result.pinNames.addAll(pinNames);
}
if (extra != null) {
$result.extra = extra;
}
return $result;
}
StreamTicksRequest._() : super();
factory StreamTicksRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory StreamTicksRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);

static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'StreamTicksRequest', package: const $pb.PackageName(_omitMessageNames ? '' : 'viam.component.board.v1'), createEmptyInstance: create)
..aOS(1, _omitFieldNames ? '' : 'name')
..pPS(2, _omitFieldNames ? '' : 'pinNames')
..aOM<$2.Struct>(99, _omitFieldNames ? '' : 'extra', subBuilder: $2.Struct.create)
..hasRequiredFields = false
;

@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
'Will be removed in next major version')
StreamTicksRequest clone() => StreamTicksRequest()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
StreamTicksRequest copyWith(void Function(StreamTicksRequest) updates) => super.copyWith((message) => updates(message as StreamTicksRequest)) as StreamTicksRequest;

$pb.BuilderInfo get info_ => _i;

@$core.pragma('dart2js:noInline')
static StreamTicksRequest create() => StreamTicksRequest._();
StreamTicksRequest createEmptyInstance() => create();
static $pb.PbList<StreamTicksRequest> createRepeated() => $pb.PbList<StreamTicksRequest>();
@$core.pragma('dart2js:noInline')
static StreamTicksRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<StreamTicksRequest>(create);
static StreamTicksRequest? _defaultInstance;

/// Board name
@$pb.TagNumber(1)
$core.String get name => $_getSZ(0);
@$pb.TagNumber(1)
set name($core.String v) { $_setString(0, v); }
@$pb.TagNumber(1)
$core.bool hasName() => $_has(0);
@$pb.TagNumber(1)
void clearName() => clearField(1);

/// Name of digital interrupts to recieve ticks from
@$pb.TagNumber(2)
$core.List<$core.String> get pinNames => $_getList(1);

/// Additional arguments to the method
@$pb.TagNumber(99)
$2.Struct get extra => $_getN(2);
@$pb.TagNumber(99)
set extra($2.Struct v) { setField(99, v); }
@$pb.TagNumber(99)
$core.bool hasExtra() => $_has(2);
@$pb.TagNumber(99)
void clearExtra() => clearField(99);
@$pb.TagNumber(99)
$2.Struct ensureExtra() => $_ensure(2);
}

class StreamTicksResponse extends $pb.GeneratedMessage {
factory StreamTicksResponse({
$core.String? pinName,
$fixnum.Int64? time,
$core.bool? high,
}) {
final $result = create();
if (pinName != null) {
$result.pinName = pinName;
}
if (time != null) {
$result.time = time;
}
if (high != null) {
$result.high = high;
}
return $result;
}
StreamTicksResponse._() : super();
factory StreamTicksResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory StreamTicksResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);

static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'StreamTicksResponse', package: const $pb.PackageName(_omitMessageNames ? '' : 'viam.component.board.v1'), createEmptyInstance: create)
..aOS(1, _omitFieldNames ? '' : 'pinName')
..a<$fixnum.Int64>(2, _omitFieldNames ? '' : 'time', $pb.PbFieldType.OU6, defaultOrMaker: $fixnum.Int64.ZERO)
..aOB(3, _omitFieldNames ? '' : 'high')
..hasRequiredFields = false
;

@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
'Will be removed in next major version')
StreamTicksResponse clone() => StreamTicksResponse()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
StreamTicksResponse copyWith(void Function(StreamTicksResponse) updates) => super.copyWith((message) => updates(message as StreamTicksResponse)) as StreamTicksResponse;

$pb.BuilderInfo get info_ => _i;

@$core.pragma('dart2js:noInline')
static StreamTicksResponse create() => StreamTicksResponse._();
StreamTicksResponse createEmptyInstance() => create();
static $pb.PbList<StreamTicksResponse> createRepeated() => $pb.PbList<StreamTicksResponse>();
@$core.pragma('dart2js:noInline')
static StreamTicksResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<StreamTicksResponse>(create);
static StreamTicksResponse? _defaultInstance;

/// name of interrupt
@$pb.TagNumber(1)
$core.String get pinName => $_getSZ(0);
@$pb.TagNumber(1)
set pinName($core.String v) { $_setString(0, v); }
@$pb.TagNumber(1)
$core.bool hasPinName() => $_has(0);
@$pb.TagNumber(1)
void clearPinName() => clearField(1);

/// Time in nanoseconds of a tick
@$pb.TagNumber(2)
$fixnum.Int64 get time => $_getI64(1);
@$pb.TagNumber(2)
set time($fixnum.Int64 v) { $_setInt64(1, v); }
@$pb.TagNumber(2)
$core.bool hasTime() => $_has(1);
@$pb.TagNumber(2)
void clearTime() => clearField(2);

/// Value high or low of the tick
@$pb.TagNumber(3)
$core.bool get high => $_getBF(2);
@$pb.TagNumber(3)
set high($core.bool v) { $_setBool(2, v); }
@$pb.TagNumber(3)
$core.bool hasHigh() => $_has(2);
@$pb.TagNumber(3)
void clearHigh() => clearField(3);
}

class SetPowerModeRequest extends $pb.GeneratedMessage {
factory SetPowerModeRequest({
$core.String? name,
Expand Down
20 changes: 20 additions & 0 deletions lib/src/gen/component/board/v1/board.pbgrpc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ class BoardServiceClient extends $grpc.Client {
'/viam.component.board.v1.BoardService/GetDigitalInterruptValue',
($0.GetDigitalInterruptValueRequest value) => value.writeToBuffer(),
($core.List<$core.int> value) => $0.GetDigitalInterruptValueResponse.fromBuffer(value));
static final _$streamTicks = $grpc.ClientMethod<$0.StreamTicksRequest, $0.StreamTicksResponse>(
'/viam.component.board.v1.BoardService/StreamTicks',
($0.StreamTicksRequest value) => value.writeToBuffer(),
($core.List<$core.int> value) => $0.StreamTicksResponse.fromBuffer(value));
static final _$setPowerMode = $grpc.ClientMethod<$0.SetPowerModeRequest, $0.SetPowerModeResponse>(
'/viam.component.board.v1.BoardService/SetPowerMode',
($0.SetPowerModeRequest value) => value.writeToBuffer(),
Expand Down Expand Up @@ -125,6 +129,10 @@ class BoardServiceClient extends $grpc.Client {
return $createUnaryCall(_$getDigitalInterruptValue, request, options: options);
}

$grpc.ResponseStream<$0.StreamTicksResponse> streamTicks($0.StreamTicksRequest request, {$grpc.CallOptions? options}) {
return $createStreamingCall(_$streamTicks, $async.Stream.fromIterable([request]), options: options);
}

$grpc.ResponseFuture<$0.SetPowerModeResponse> setPowerMode($0.SetPowerModeRequest request, {$grpc.CallOptions? options}) {
return $createUnaryCall(_$setPowerMode, request, options: options);
}
Expand Down Expand Up @@ -216,6 +224,13 @@ abstract class BoardServiceBase extends $grpc.Service {
false,
($core.List<$core.int> value) => $0.GetDigitalInterruptValueRequest.fromBuffer(value),
($0.GetDigitalInterruptValueResponse value) => value.writeToBuffer()));
$addMethod($grpc.ServiceMethod<$0.StreamTicksRequest, $0.StreamTicksResponse>(
'StreamTicks',
streamTicks_Pre,
false,
true,
($core.List<$core.int> value) => $0.StreamTicksRequest.fromBuffer(value),
($0.StreamTicksResponse value) => value.writeToBuffer()));
$addMethod($grpc.ServiceMethod<$0.SetPowerModeRequest, $0.SetPowerModeResponse>(
'SetPowerMode',
setPowerMode_Pre,
Expand Down Expand Up @@ -276,6 +291,10 @@ abstract class BoardServiceBase extends $grpc.Service {
return getDigitalInterruptValue(call, await request);
}

$async.Stream<$0.StreamTicksResponse> streamTicks_Pre($grpc.ServiceCall call, $async.Future<$0.StreamTicksRequest> request) async* {
yield* streamTicks(call, await request);
}

$async.Future<$0.SetPowerModeResponse> setPowerMode_Pre($grpc.ServiceCall call, $async.Future<$0.SetPowerModeRequest> request) async {
return setPowerMode(call, await request);
}
Expand All @@ -295,6 +314,7 @@ abstract class BoardServiceBase extends $grpc.Service {
$async.Future<$0.ReadAnalogReaderResponse> readAnalogReader($grpc.ServiceCall call, $0.ReadAnalogReaderRequest request);
$async.Future<$0.WriteAnalogResponse> writeAnalog($grpc.ServiceCall call, $0.WriteAnalogRequest request);
$async.Future<$0.GetDigitalInterruptValueResponse> getDigitalInterruptValue($grpc.ServiceCall call, $0.GetDigitalInterruptValueRequest request);
$async.Stream<$0.StreamTicksResponse> streamTicks($grpc.ServiceCall call, $0.StreamTicksRequest request);
$async.Future<$0.SetPowerModeResponse> setPowerMode($grpc.ServiceCall call, $0.SetPowerModeRequest request);
$async.Future<$1.GetGeometriesResponse> getGeometries($grpc.ServiceCall call, $1.GetGeometriesRequest request);
}
31 changes: 31 additions & 0 deletions lib/src/gen/component/board/v1/board.pbjson.dart
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,37 @@ final $typed_data.Uint8List getDigitalInterruptValueResponseDescriptor = $conver
'CiBHZXREaWdpdGFsSW50ZXJydXB0VmFsdWVSZXNwb25zZRIUCgV2YWx1ZRgBIAEoA1IFdmFsdW'
'U=');

@$core.Deprecated('Use streamTicksRequestDescriptor instead')
const StreamTicksRequest$json = {
'1': 'StreamTicksRequest',
'2': [
{'1': 'name', '3': 1, '4': 1, '5': 9, '10': 'name'},
{'1': 'pin_names', '3': 2, '4': 3, '5': 9, '10': 'pinNames'},
{'1': 'extra', '3': 99, '4': 1, '5': 11, '6': '.google.protobuf.Struct', '10': 'extra'},
],
};

/// Descriptor for `StreamTicksRequest`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List streamTicksRequestDescriptor = $convert.base64Decode(
'ChJTdHJlYW1UaWNrc1JlcXVlc3QSEgoEbmFtZRgBIAEoCVIEbmFtZRIbCglwaW5fbmFtZXMYAi'
'ADKAlSCHBpbk5hbWVzEi0KBWV4dHJhGGMgASgLMhcuZ29vZ2xlLnByb3RvYnVmLlN0cnVjdFIF'
'ZXh0cmE=');

@$core.Deprecated('Use streamTicksResponseDescriptor instead')
const StreamTicksResponse$json = {
'1': 'StreamTicksResponse',
'2': [
{'1': 'pin_name', '3': 1, '4': 1, '5': 9, '10': 'pinName'},
{'1': 'time', '3': 2, '4': 1, '5': 4, '10': 'time'},
{'1': 'high', '3': 3, '4': 1, '5': 8, '10': 'high'},
],
};

/// Descriptor for `StreamTicksResponse`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List streamTicksResponseDescriptor = $convert.base64Decode(
'ChNTdHJlYW1UaWNrc1Jlc3BvbnNlEhkKCHBpbl9uYW1lGAEgASgJUgdwaW5OYW1lEhIKBHRpbW'
'UYAiABKARSBHRpbWUSEgoEaGlnaBgDIAEoCFIEaGlnaA==');

@$core.Deprecated('Use setPowerModeRequestDescriptor instead')
const SetPowerModeRequest$json = {
'1': 'SetPowerModeRequest',
Expand Down
18 changes: 18 additions & 0 deletions lib/src/gen/google/api/client.pb.dart
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ class Publishing extends $pb.GeneratedMessage {
ClientLibraryOrganization? organization,
$core.Iterable<ClientLibrarySettings>? librarySettings,
$core.String? protoReferenceDocumentationUri,
$core.String? restReferenceDocumentationUri,
}) {
final $result = create();
if (methodSettings != null) {
Expand Down Expand Up @@ -355,6 +356,9 @@ class Publishing extends $pb.GeneratedMessage {
if (protoReferenceDocumentationUri != null) {
$result.protoReferenceDocumentationUri = protoReferenceDocumentationUri;
}
if (restReferenceDocumentationUri != null) {
$result.restReferenceDocumentationUri = restReferenceDocumentationUri;
}
return $result;
}
Publishing._() : super();
Expand All @@ -372,6 +376,7 @@ class Publishing extends $pb.GeneratedMessage {
..e<ClientLibraryOrganization>(107, _omitFieldNames ? '' : 'organization', $pb.PbFieldType.OE, defaultOrMaker: ClientLibraryOrganization.CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED, valueOf: ClientLibraryOrganization.valueOf, enumValues: ClientLibraryOrganization.values)
..pc<ClientLibrarySettings>(109, _omitFieldNames ? '' : 'librarySettings', $pb.PbFieldType.PM, subBuilder: ClientLibrarySettings.create)
..aOS(110, _omitFieldNames ? '' : 'protoReferenceDocumentationUri')
..aOS(111, _omitFieldNames ? '' : 'restReferenceDocumentationUri')
..hasRequiredFields = false
;

Expand Down Expand Up @@ -487,6 +492,17 @@ class Publishing extends $pb.GeneratedMessage {
$core.bool hasProtoReferenceDocumentationUri() => $_has(9);
@$pb.TagNumber(110)
void clearProtoReferenceDocumentationUri() => clearField(110);

/// Optional link to REST reference documentation. Example:
/// https://cloud.google.com/pubsub/lite/docs/reference/rest
@$pb.TagNumber(111)
$core.String get restReferenceDocumentationUri => $_getSZ(10);
@$pb.TagNumber(111)
set restReferenceDocumentationUri($core.String v) { $_setString(10, v); }
@$pb.TagNumber(111)
$core.bool hasRestReferenceDocumentationUri() => $_has(10);
@$pb.TagNumber(111)
void clearRestReferenceDocumentationUri() => clearField(111);
}

/// Settings for Java client libraries.
Expand Down Expand Up @@ -1249,10 +1265,12 @@ class Client {
static final methodSignature = $pb.Extension<$core.String>.repeated(_omitMessageNames ? '' : 'google.protobuf.MethodOptions', _omitFieldNames ? '' : 'methodSignature', 1051, $pb.PbFieldType.PS, check: $pb.getCheckFunction($pb.PbFieldType.PS));
static final defaultHost = $pb.Extension<$core.String>(_omitMessageNames ? '' : 'google.protobuf.ServiceOptions', _omitFieldNames ? '' : 'defaultHost', 1049, $pb.PbFieldType.OS);
static final oauthScopes = $pb.Extension<$core.String>(_omitMessageNames ? '' : 'google.protobuf.ServiceOptions', _omitFieldNames ? '' : 'oauthScopes', 1050, $pb.PbFieldType.OS);
static final apiVersion = $pb.Extension<$core.String>(_omitMessageNames ? '' : 'google.protobuf.ServiceOptions', _omitFieldNames ? '' : 'apiVersion', 525000001, $pb.PbFieldType.OS);
static void registerAllExtensions($pb.ExtensionRegistry registry) {
registry.add(methodSignature);
registry.add(defaultHost);
registry.add(oauthScopes);
registry.add(apiVersion);
}
}

Expand Down
5 changes: 4 additions & 1 deletion lib/src/gen/google/api/client.pbjson.dart
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ const Publishing$json = {
{'1': 'organization', '3': 107, '4': 1, '5': 14, '6': '.google.api.ClientLibraryOrganization', '10': 'organization'},
{'1': 'library_settings', '3': 109, '4': 3, '5': 11, '6': '.google.api.ClientLibrarySettings', '10': 'librarySettings'},
{'1': 'proto_reference_documentation_uri', '3': 110, '4': 1, '5': 9, '10': 'protoReferenceDocumentationUri'},
{'1': 'rest_reference_documentation_uri', '3': 111, '4': 1, '5': 9, '10': 'restReferenceDocumentationUri'},
],
};

Expand All @@ -132,7 +133,9 @@ final $typed_data.Uint8List publishingDescriptor = $convert.base64Decode(
'Z2FuaXphdGlvbhhrIAEoDjIlLmdvb2dsZS5hcGkuQ2xpZW50TGlicmFyeU9yZ2FuaXphdGlvbl'
'IMb3JnYW5pemF0aW9uEkwKEGxpYnJhcnlfc2V0dGluZ3MYbSADKAsyIS5nb29nbGUuYXBpLkNs'
'aWVudExpYnJhcnlTZXR0aW5nc1IPbGlicmFyeVNldHRpbmdzEkkKIXByb3RvX3JlZmVyZW5jZV'
'9kb2N1bWVudGF0aW9uX3VyaRhuIAEoCVIecHJvdG9SZWZlcmVuY2VEb2N1bWVudGF0aW9uVXJp');
'9kb2N1bWVudGF0aW9uX3VyaRhuIAEoCVIecHJvdG9SZWZlcmVuY2VEb2N1bWVudGF0aW9uVXJp'
'EkcKIHJlc3RfcmVmZXJlbmNlX2RvY3VtZW50YXRpb25fdXJpGG8gASgJUh1yZXN0UmVmZXJlbm'
'NlRG9jdW1lbnRhdGlvblVyaQ==');

@$core.Deprecated('Use javaSettingsDescriptor instead')
const JavaSettings$json = {
Expand Down
Loading

0 comments on commit bd710a7

Please sign in to comment.