feat: live HubClient with generated proto bindings
Proto codegen wired in. tools/generate.sh wraps protoc against ../fai_platform/proto/, including the well-known types (Empty, Struct, Timestamp) so they are generated alongside fai's own messages — protobuf 4.x doesn't ship them as importable Dart types, so we have to generate them ourselves. HubClient now exposes typed methods backed by real RPCs: - healthy() — Hub.Health probe (returns false on connect refused). - listCapabilities() — HubAdmin.ListCapabilities. - eventLog() — HubAdmin.EventLog with type filter. - listApprovals() — HubAdmin.ListApprovals (status filter). - approve() / reject() — HubAdmin.DecideApproval. Generated bindings under lib/src/generated/ are excluded from analyze (out of our style control). protoc_plugin pinned to 22.2.0 in tools/generate.sh comment because newer plugins generate code against protobuf 6.x, while grpc 4.x still constrains us to protobuf 4.x. Bumps fai_dart_sdk 0.1.0 -> 0.2.0. Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
parent
d405a6a9bd
commit
da10820959
26 changed files with 5364 additions and 28 deletions
52
lib/src/generated/google/protobuf/empty.pb.dart
Normal file
52
lib/src/generated/google/protobuf/empty.pb.dart
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: google/protobuf/empty.proto
|
||||
//
|
||||
// @dart = 3.3
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:core' as $core;
|
||||
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
|
||||
export 'package:protobuf/protobuf.dart' show GeneratedMessageGenericExtensions;
|
||||
|
||||
/// A generic empty message that you can re-use to avoid defining duplicated
|
||||
/// empty messages in your APIs. A typical example is to use it as the request
|
||||
/// or the response type of an API method. For instance:
|
||||
///
|
||||
/// service Foo {
|
||||
/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
|
||||
/// }
|
||||
class Empty extends $pb.GeneratedMessage {
|
||||
factory Empty() => create();
|
||||
Empty._() : super();
|
||||
factory Empty.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory Empty.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
|
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Empty', package: const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'), createEmptyInstance: create)
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
|
||||
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
|
||||
Empty clone() => Empty()..mergeFromMessage(this);
|
||||
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
|
||||
Empty copyWith(void Function(Empty) updates) => super.copyWith((message) => updates(message as Empty)) as Empty;
|
||||
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static Empty create() => Empty._();
|
||||
Empty createEmptyInstance() => create();
|
||||
static $pb.PbList<Empty> createRepeated() => $pb.PbList<Empty>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static Empty getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Empty>(create);
|
||||
static Empty? _defaultInstance;
|
||||
}
|
||||
|
||||
|
||||
const _omitMessageNames = $core.bool.fromEnvironment('protobuf.omit_message_names');
|
||||
11
lib/src/generated/google/protobuf/empty.pbenum.dart
Normal file
11
lib/src/generated/google/protobuf/empty.pbenum.dart
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: google/protobuf/empty.proto
|
||||
//
|
||||
// @dart = 3.3
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
24
lib/src/generated/google/protobuf/empty.pbjson.dart
Normal file
24
lib/src/generated/google/protobuf/empty.pbjson.dart
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: google/protobuf/empty.proto
|
||||
//
|
||||
// @dart = 3.3
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:convert' as $convert;
|
||||
import 'dart:core' as $core;
|
||||
import 'dart:typed_data' as $typed_data;
|
||||
|
||||
@$core.Deprecated('Use emptyDescriptor instead')
|
||||
const Empty$json = {
|
||||
'1': 'Empty',
|
||||
};
|
||||
|
||||
/// Descriptor for `Empty`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List emptyDescriptor = $convert.base64Decode(
|
||||
'CgVFbXB0eQ==');
|
||||
|
||||
267
lib/src/generated/google/protobuf/struct.pb.dart
Normal file
267
lib/src/generated/google/protobuf/struct.pb.dart
Normal file
|
|
@ -0,0 +1,267 @@
|
|||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: google/protobuf/struct.proto
|
||||
//
|
||||
// @dart = 3.3
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:core' as $core;
|
||||
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
import 'package:protobuf/src/protobuf/mixins/well_known.dart' as $mixin;
|
||||
|
||||
import 'struct.pbenum.dart';
|
||||
|
||||
export 'package:protobuf/protobuf.dart' show GeneratedMessageGenericExtensions;
|
||||
|
||||
export 'struct.pbenum.dart';
|
||||
|
||||
/// `Struct` represents a structured data value, consisting of fields
|
||||
/// which map to dynamically typed values. In some languages, `Struct`
|
||||
/// might be supported by a native representation. For example, in
|
||||
/// scripting languages like JS a struct is represented as an
|
||||
/// object. The details of that representation are described together
|
||||
/// with the proto support for the language.
|
||||
///
|
||||
/// The JSON representation for `Struct` is JSON object.
|
||||
class Struct extends $pb.GeneratedMessage with $mixin.StructMixin {
|
||||
factory Struct({
|
||||
$core.Iterable<$core.MapEntry<$core.String, Value>>? fields,
|
||||
}) {
|
||||
final $result = create();
|
||||
if (fields != null) {
|
||||
$result.fields.addEntries(fields);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
Struct._() : super();
|
||||
factory Struct.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory Struct.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
|
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Struct', package: const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'), createEmptyInstance: create, toProto3Json: $mixin.StructMixin.toProto3JsonHelper, fromProto3Json: $mixin.StructMixin.fromProto3JsonHelper)
|
||||
..m<$core.String, Value>(1, _omitFieldNames ? '' : 'fields', entryClassName: 'Struct.FieldsEntry', keyFieldType: $pb.PbFieldType.OS, valueFieldType: $pb.PbFieldType.OM, valueCreator: Value.create, valueDefaultOrMaker: Value.getDefault, packageName: const $pb.PackageName('google.protobuf'))
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
|
||||
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
|
||||
Struct clone() => Struct()..mergeFromMessage(this);
|
||||
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
|
||||
Struct copyWith(void Function(Struct) updates) => super.copyWith((message) => updates(message as Struct)) as Struct;
|
||||
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static Struct create() => Struct._();
|
||||
Struct createEmptyInstance() => create();
|
||||
static $pb.PbList<Struct> createRepeated() => $pb.PbList<Struct>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static Struct getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Struct>(create);
|
||||
static Struct? _defaultInstance;
|
||||
|
||||
/// Unordered map of dynamically typed values.
|
||||
@$pb.TagNumber(1)
|
||||
$pb.PbMap<$core.String, Value> get fields => $_getMap(0);
|
||||
}
|
||||
|
||||
enum Value_Kind {
|
||||
nullValue,
|
||||
numberValue,
|
||||
stringValue,
|
||||
boolValue,
|
||||
structValue,
|
||||
listValue,
|
||||
notSet
|
||||
}
|
||||
|
||||
/// `Value` represents a dynamically typed value which can be either
|
||||
/// null, a number, a string, a boolean, a recursive struct value, or a
|
||||
/// list of values. A producer of value is expected to set one of these
|
||||
/// variants. Absence of any variant indicates an error.
|
||||
///
|
||||
/// The JSON representation for `Value` is JSON value.
|
||||
class Value extends $pb.GeneratedMessage with $mixin.ValueMixin {
|
||||
factory Value({
|
||||
NullValue? nullValue,
|
||||
$core.double? numberValue,
|
||||
$core.String? stringValue,
|
||||
$core.bool? boolValue,
|
||||
Struct? structValue,
|
||||
ListValue? listValue,
|
||||
}) {
|
||||
final $result = create();
|
||||
if (nullValue != null) {
|
||||
$result.nullValue = nullValue;
|
||||
}
|
||||
if (numberValue != null) {
|
||||
$result.numberValue = numberValue;
|
||||
}
|
||||
if (stringValue != null) {
|
||||
$result.stringValue = stringValue;
|
||||
}
|
||||
if (boolValue != null) {
|
||||
$result.boolValue = boolValue;
|
||||
}
|
||||
if (structValue != null) {
|
||||
$result.structValue = structValue;
|
||||
}
|
||||
if (listValue != null) {
|
||||
$result.listValue = listValue;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
Value._() : super();
|
||||
factory Value.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory Value.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
|
||||
|
||||
static const $core.Map<$core.int, Value_Kind> _Value_KindByTag = {
|
||||
1 : Value_Kind.nullValue,
|
||||
2 : Value_Kind.numberValue,
|
||||
3 : Value_Kind.stringValue,
|
||||
4 : Value_Kind.boolValue,
|
||||
5 : Value_Kind.structValue,
|
||||
6 : Value_Kind.listValue,
|
||||
0 : Value_Kind.notSet
|
||||
};
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Value', package: const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'), createEmptyInstance: create, toProto3Json: $mixin.ValueMixin.toProto3JsonHelper, fromProto3Json: $mixin.ValueMixin.fromProto3JsonHelper)
|
||||
..oo(0, [1, 2, 3, 4, 5, 6])
|
||||
..e<NullValue>(1, _omitFieldNames ? '' : 'nullValue', $pb.PbFieldType.OE, defaultOrMaker: NullValue.NULL_VALUE, valueOf: NullValue.valueOf, enumValues: NullValue.values)
|
||||
..a<$core.double>(2, _omitFieldNames ? '' : 'numberValue', $pb.PbFieldType.OD)
|
||||
..aOS(3, _omitFieldNames ? '' : 'stringValue')
|
||||
..aOB(4, _omitFieldNames ? '' : 'boolValue')
|
||||
..aOM<Struct>(5, _omitFieldNames ? '' : 'structValue', subBuilder: Struct.create)
|
||||
..aOM<ListValue>(6, _omitFieldNames ? '' : 'listValue', subBuilder: ListValue.create)
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
|
||||
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
|
||||
Value clone() => Value()..mergeFromMessage(this);
|
||||
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
|
||||
Value copyWith(void Function(Value) updates) => super.copyWith((message) => updates(message as Value)) as Value;
|
||||
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static Value create() => Value._();
|
||||
Value createEmptyInstance() => create();
|
||||
static $pb.PbList<Value> createRepeated() => $pb.PbList<Value>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static Value getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Value>(create);
|
||||
static Value? _defaultInstance;
|
||||
|
||||
Value_Kind whichKind() => _Value_KindByTag[$_whichOneof(0)]!;
|
||||
void clearKind() => $_clearField($_whichOneof(0));
|
||||
|
||||
/// Represents a null value.
|
||||
@$pb.TagNumber(1)
|
||||
NullValue get nullValue => $_getN(0);
|
||||
@$pb.TagNumber(1)
|
||||
set nullValue(NullValue v) { $_setField(1, v); }
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasNullValue() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearNullValue() => $_clearField(1);
|
||||
|
||||
/// Represents a double value.
|
||||
@$pb.TagNumber(2)
|
||||
$core.double get numberValue => $_getN(1);
|
||||
@$pb.TagNumber(2)
|
||||
set numberValue($core.double v) { $_setDouble(1, v); }
|
||||
@$pb.TagNumber(2)
|
||||
$core.bool hasNumberValue() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
void clearNumberValue() => $_clearField(2);
|
||||
|
||||
/// Represents a string value.
|
||||
@$pb.TagNumber(3)
|
||||
$core.String get stringValue => $_getSZ(2);
|
||||
@$pb.TagNumber(3)
|
||||
set stringValue($core.String v) { $_setString(2, v); }
|
||||
@$pb.TagNumber(3)
|
||||
$core.bool hasStringValue() => $_has(2);
|
||||
@$pb.TagNumber(3)
|
||||
void clearStringValue() => $_clearField(3);
|
||||
|
||||
/// Represents a boolean value.
|
||||
@$pb.TagNumber(4)
|
||||
$core.bool get boolValue => $_getBF(3);
|
||||
@$pb.TagNumber(4)
|
||||
set boolValue($core.bool v) { $_setBool(3, v); }
|
||||
@$pb.TagNumber(4)
|
||||
$core.bool hasBoolValue() => $_has(3);
|
||||
@$pb.TagNumber(4)
|
||||
void clearBoolValue() => $_clearField(4);
|
||||
|
||||
/// Represents a structured value.
|
||||
@$pb.TagNumber(5)
|
||||
Struct get structValue => $_getN(4);
|
||||
@$pb.TagNumber(5)
|
||||
set structValue(Struct v) { $_setField(5, v); }
|
||||
@$pb.TagNumber(5)
|
||||
$core.bool hasStructValue() => $_has(4);
|
||||
@$pb.TagNumber(5)
|
||||
void clearStructValue() => $_clearField(5);
|
||||
@$pb.TagNumber(5)
|
||||
Struct ensureStructValue() => $_ensure(4);
|
||||
|
||||
/// Represents a repeated `Value`.
|
||||
@$pb.TagNumber(6)
|
||||
ListValue get listValue => $_getN(5);
|
||||
@$pb.TagNumber(6)
|
||||
set listValue(ListValue v) { $_setField(6, v); }
|
||||
@$pb.TagNumber(6)
|
||||
$core.bool hasListValue() => $_has(5);
|
||||
@$pb.TagNumber(6)
|
||||
void clearListValue() => $_clearField(6);
|
||||
@$pb.TagNumber(6)
|
||||
ListValue ensureListValue() => $_ensure(5);
|
||||
}
|
||||
|
||||
/// `ListValue` is a wrapper around a repeated field of values.
|
||||
///
|
||||
/// The JSON representation for `ListValue` is JSON array.
|
||||
class ListValue extends $pb.GeneratedMessage with $mixin.ListValueMixin {
|
||||
factory ListValue({
|
||||
$core.Iterable<Value>? values,
|
||||
}) {
|
||||
final $result = create();
|
||||
if (values != null) {
|
||||
$result.values.addAll(values);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
ListValue._() : super();
|
||||
factory ListValue.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory ListValue.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
|
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'ListValue', package: const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'), createEmptyInstance: create, toProto3Json: $mixin.ListValueMixin.toProto3JsonHelper, fromProto3Json: $mixin.ListValueMixin.fromProto3JsonHelper)
|
||||
..pc<Value>(1, _omitFieldNames ? '' : 'values', $pb.PbFieldType.PM, subBuilder: Value.create)
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
|
||||
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
|
||||
ListValue clone() => ListValue()..mergeFromMessage(this);
|
||||
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
|
||||
ListValue copyWith(void Function(ListValue) updates) => super.copyWith((message) => updates(message as ListValue)) as ListValue;
|
||||
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static ListValue create() => ListValue._();
|
||||
ListValue createEmptyInstance() => create();
|
||||
static $pb.PbList<ListValue> createRepeated() => $pb.PbList<ListValue>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static ListValue getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<ListValue>(create);
|
||||
static ListValue? _defaultInstance;
|
||||
|
||||
/// Repeated field of dynamically typed values.
|
||||
@$pb.TagNumber(1)
|
||||
$pb.PbList<Value> get values => $_getList(0);
|
||||
}
|
||||
|
||||
|
||||
const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names');
|
||||
const _omitMessageNames = $core.bool.fromEnvironment('protobuf.omit_message_names');
|
||||
35
lib/src/generated/google/protobuf/struct.pbenum.dart
Normal file
35
lib/src/generated/google/protobuf/struct.pbenum.dart
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: google/protobuf/struct.proto
|
||||
//
|
||||
// @dart = 3.3
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:core' as $core;
|
||||
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
|
||||
/// `NullValue` is a singleton enumeration to represent the null value for the
|
||||
/// `Value` type union.
|
||||
///
|
||||
/// The JSON representation for `NullValue` is JSON `null`.
|
||||
class NullValue extends $pb.ProtobufEnum {
|
||||
/// Null value.
|
||||
static const NullValue NULL_VALUE = NullValue._(0, _omitEnumNames ? '' : 'NULL_VALUE');
|
||||
|
||||
static const $core.List<NullValue> values = <NullValue> [
|
||||
NULL_VALUE,
|
||||
];
|
||||
|
||||
static final $core.List<NullValue?> _byValue = $pb.ProtobufEnum.$_initByValueList(values, 0);
|
||||
static NullValue? valueOf($core.int value) => value < 0 || value >= _byValue.length ? null : _byValue[value];
|
||||
|
||||
const NullValue._(super.v, super.n);
|
||||
}
|
||||
|
||||
|
||||
const _omitEnumNames = $core.bool.fromEnvironment('protobuf.omit_enum_names');
|
||||
90
lib/src/generated/google/protobuf/struct.pbjson.dart
Normal file
90
lib/src/generated/google/protobuf/struct.pbjson.dart
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: google/protobuf/struct.proto
|
||||
//
|
||||
// @dart = 3.3
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:convert' as $convert;
|
||||
import 'dart:core' as $core;
|
||||
import 'dart:typed_data' as $typed_data;
|
||||
|
||||
@$core.Deprecated('Use nullValueDescriptor instead')
|
||||
const NullValue$json = {
|
||||
'1': 'NullValue',
|
||||
'2': [
|
||||
{'1': 'NULL_VALUE', '2': 0},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `NullValue`. Decode as a `google.protobuf.EnumDescriptorProto`.
|
||||
final $typed_data.Uint8List nullValueDescriptor = $convert.base64Decode(
|
||||
'CglOdWxsVmFsdWUSDgoKTlVMTF9WQUxVRRAA');
|
||||
|
||||
@$core.Deprecated('Use structDescriptor instead')
|
||||
const Struct$json = {
|
||||
'1': 'Struct',
|
||||
'2': [
|
||||
{'1': 'fields', '3': 1, '4': 3, '5': 11, '6': '.google.protobuf.Struct.FieldsEntry', '10': 'fields'},
|
||||
],
|
||||
'3': [Struct_FieldsEntry$json],
|
||||
};
|
||||
|
||||
@$core.Deprecated('Use structDescriptor instead')
|
||||
const Struct_FieldsEntry$json = {
|
||||
'1': 'FieldsEntry',
|
||||
'2': [
|
||||
{'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'},
|
||||
{'1': 'value', '3': 2, '4': 1, '5': 11, '6': '.google.protobuf.Value', '10': 'value'},
|
||||
],
|
||||
'7': {'7': true},
|
||||
};
|
||||
|
||||
/// Descriptor for `Struct`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List structDescriptor = $convert.base64Decode(
|
||||
'CgZTdHJ1Y3QSOwoGZmllbGRzGAEgAygLMiMuZ29vZ2xlLnByb3RvYnVmLlN0cnVjdC5GaWVsZH'
|
||||
'NFbnRyeVIGZmllbGRzGlEKC0ZpZWxkc0VudHJ5EhAKA2tleRgBIAEoCVIDa2V5EiwKBXZhbHVl'
|
||||
'GAIgASgLMhYuZ29vZ2xlLnByb3RvYnVmLlZhbHVlUgV2YWx1ZToCOAE=');
|
||||
|
||||
@$core.Deprecated('Use valueDescriptor instead')
|
||||
const Value$json = {
|
||||
'1': 'Value',
|
||||
'2': [
|
||||
{'1': 'null_value', '3': 1, '4': 1, '5': 14, '6': '.google.protobuf.NullValue', '9': 0, '10': 'nullValue'},
|
||||
{'1': 'number_value', '3': 2, '4': 1, '5': 1, '9': 0, '10': 'numberValue'},
|
||||
{'1': 'string_value', '3': 3, '4': 1, '5': 9, '9': 0, '10': 'stringValue'},
|
||||
{'1': 'bool_value', '3': 4, '4': 1, '5': 8, '9': 0, '10': 'boolValue'},
|
||||
{'1': 'struct_value', '3': 5, '4': 1, '5': 11, '6': '.google.protobuf.Struct', '9': 0, '10': 'structValue'},
|
||||
{'1': 'list_value', '3': 6, '4': 1, '5': 11, '6': '.google.protobuf.ListValue', '9': 0, '10': 'listValue'},
|
||||
],
|
||||
'8': [
|
||||
{'1': 'kind'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `Value`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List valueDescriptor = $convert.base64Decode(
|
||||
'CgVWYWx1ZRI7CgpudWxsX3ZhbHVlGAEgASgOMhouZ29vZ2xlLnByb3RvYnVmLk51bGxWYWx1ZU'
|
||||
'gAUgludWxsVmFsdWUSIwoMbnVtYmVyX3ZhbHVlGAIgASgBSABSC251bWJlclZhbHVlEiMKDHN0'
|
||||
'cmluZ192YWx1ZRgDIAEoCUgAUgtzdHJpbmdWYWx1ZRIfCgpib29sX3ZhbHVlGAQgASgISABSCW'
|
||||
'Jvb2xWYWx1ZRI8CgxzdHJ1Y3RfdmFsdWUYBSABKAsyFy5nb29nbGUucHJvdG9idWYuU3RydWN0'
|
||||
'SABSC3N0cnVjdFZhbHVlEjsKCmxpc3RfdmFsdWUYBiABKAsyGi5nb29nbGUucHJvdG9idWYuTG'
|
||||
'lzdFZhbHVlSABSCWxpc3RWYWx1ZUIGCgRraW5k');
|
||||
|
||||
@$core.Deprecated('Use listValueDescriptor instead')
|
||||
const ListValue$json = {
|
||||
'1': 'ListValue',
|
||||
'2': [
|
||||
{'1': 'values', '3': 1, '4': 3, '5': 11, '6': '.google.protobuf.Value', '10': 'values'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `ListValue`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List listValueDescriptor = $convert.base64Decode(
|
||||
'CglMaXN0VmFsdWUSLgoGdmFsdWVzGAEgAygLMhYuZ29vZ2xlLnByb3RvYnVmLlZhbHVlUgZ2YW'
|
||||
'x1ZXM=');
|
||||
|
||||
185
lib/src/generated/google/protobuf/timestamp.pb.dart
Normal file
185
lib/src/generated/google/protobuf/timestamp.pb.dart
Normal file
|
|
@ -0,0 +1,185 @@
|
|||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: google/protobuf/timestamp.proto
|
||||
//
|
||||
// @dart = 3.3
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:core' as $core;
|
||||
|
||||
import 'package:fixnum/fixnum.dart' as $fixnum;
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
import 'package:protobuf/src/protobuf/mixins/well_known.dart' as $mixin;
|
||||
|
||||
export 'package:protobuf/protobuf.dart' show GeneratedMessageGenericExtensions;
|
||||
|
||||
/// A Timestamp represents a point in time independent of any time zone or local
|
||||
/// calendar, encoded as a count of seconds and fractions of seconds at
|
||||
/// nanosecond resolution. The count is relative to an epoch at UTC midnight on
|
||||
/// January 1, 1970, in the proleptic Gregorian calendar which extends the
|
||||
/// Gregorian calendar backwards to year one.
|
||||
///
|
||||
/// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
|
||||
/// second table is needed for interpretation, using a [24-hour linear
|
||||
/// smear](https://developers.google.com/time/smear).
|
||||
///
|
||||
/// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
|
||||
/// restricting to that range, we ensure that we can convert to and from [RFC
|
||||
/// 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// Example 1: Compute Timestamp from POSIX `time()`.
|
||||
///
|
||||
/// Timestamp timestamp;
|
||||
/// timestamp.set_seconds(time(NULL));
|
||||
/// timestamp.set_nanos(0);
|
||||
///
|
||||
/// Example 2: Compute Timestamp from POSIX `gettimeofday()`.
|
||||
///
|
||||
/// struct timeval tv;
|
||||
/// gettimeofday(&tv, NULL);
|
||||
///
|
||||
/// Timestamp timestamp;
|
||||
/// timestamp.set_seconds(tv.tv_sec);
|
||||
/// timestamp.set_nanos(tv.tv_usec * 1000);
|
||||
///
|
||||
/// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
|
||||
///
|
||||
/// FILETIME ft;
|
||||
/// GetSystemTimeAsFileTime(&ft);
|
||||
/// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
|
||||
///
|
||||
/// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
|
||||
/// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
|
||||
/// Timestamp timestamp;
|
||||
/// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
|
||||
/// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
|
||||
///
|
||||
/// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
|
||||
///
|
||||
/// long millis = System.currentTimeMillis();
|
||||
///
|
||||
/// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
|
||||
/// .setNanos((int) ((millis % 1000) * 1000000)).build();
|
||||
///
|
||||
/// Example 5: Compute Timestamp from Java `Instant.now()`.
|
||||
///
|
||||
/// Instant now = Instant.now();
|
||||
///
|
||||
/// Timestamp timestamp =
|
||||
/// Timestamp.newBuilder().setSeconds(now.getEpochSecond())
|
||||
/// .setNanos(now.getNano()).build();
|
||||
///
|
||||
/// Example 6: Compute Timestamp from current time in Python.
|
||||
///
|
||||
/// timestamp = Timestamp()
|
||||
/// timestamp.GetCurrentTime()
|
||||
///
|
||||
/// # JSON Mapping
|
||||
///
|
||||
/// In JSON format, the Timestamp type is encoded as a string in the
|
||||
/// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
|
||||
/// format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
|
||||
/// where {year} is always expressed using four digits while {month}, {day},
|
||||
/// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
|
||||
/// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
|
||||
/// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
|
||||
/// is required. A ProtoJSON serializer should always use UTC (as indicated by
|
||||
/// "Z") when printing the Timestamp type and a ProtoJSON parser should be
|
||||
/// able to accept both UTC and other timezones (as indicated by an offset).
|
||||
///
|
||||
/// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
|
||||
/// 01:30 UTC on January 15, 2017.
|
||||
///
|
||||
/// In JavaScript, one can convert a Date object to this format using the
|
||||
/// standard
|
||||
/// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
|
||||
/// method. In Python, a standard `datetime.datetime` object can be converted
|
||||
/// to this format using
|
||||
/// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
|
||||
/// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
|
||||
/// the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
||||
/// http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
|
||||
/// ) to obtain a formatter capable of generating timestamps in this format.
|
||||
class Timestamp extends $pb.GeneratedMessage with $mixin.TimestampMixin {
|
||||
factory Timestamp({
|
||||
$fixnum.Int64? seconds,
|
||||
$core.int? nanos,
|
||||
}) {
|
||||
final $result = create();
|
||||
if (seconds != null) {
|
||||
$result.seconds = seconds;
|
||||
}
|
||||
if (nanos != null) {
|
||||
$result.nanos = nanos;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
Timestamp._() : super();
|
||||
factory Timestamp.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory Timestamp.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
|
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Timestamp', package: const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'), createEmptyInstance: create, toProto3Json: $mixin.TimestampMixin.toProto3JsonHelper, fromProto3Json: $mixin.TimestampMixin.fromProto3JsonHelper)
|
||||
..aInt64(1, _omitFieldNames ? '' : 'seconds')
|
||||
..a<$core.int>(2, _omitFieldNames ? '' : 'nanos', $pb.PbFieldType.O3)
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
|
||||
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
|
||||
Timestamp clone() => Timestamp()..mergeFromMessage(this);
|
||||
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
|
||||
Timestamp copyWith(void Function(Timestamp) updates) => super.copyWith((message) => updates(message as Timestamp)) as Timestamp;
|
||||
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static Timestamp create() => Timestamp._();
|
||||
Timestamp createEmptyInstance() => create();
|
||||
static $pb.PbList<Timestamp> createRepeated() => $pb.PbList<Timestamp>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static Timestamp getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Timestamp>(create);
|
||||
static Timestamp? _defaultInstance;
|
||||
|
||||
/// Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must
|
||||
/// be between -62135596800 and 253402300799 inclusive (which corresponds to
|
||||
/// 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z).
|
||||
@$pb.TagNumber(1)
|
||||
$fixnum.Int64 get seconds => $_getI64(0);
|
||||
@$pb.TagNumber(1)
|
||||
set seconds($fixnum.Int64 v) { $_setInt64(0, v); }
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasSeconds() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearSeconds() => $_clearField(1);
|
||||
|
||||
/// Non-negative fractions of a second at nanosecond resolution. This field is
|
||||
/// the nanosecond portion of the duration, not an alternative to seconds.
|
||||
/// Negative second values with fractions must still have non-negative nanos
|
||||
/// values that count forward in time. Must be between 0 and 999,999,999
|
||||
/// inclusive.
|
||||
@$pb.TagNumber(2)
|
||||
$core.int get nanos => $_getIZ(1);
|
||||
@$pb.TagNumber(2)
|
||||
set nanos($core.int v) { $_setSignedInt32(1, v); }
|
||||
@$pb.TagNumber(2)
|
||||
$core.bool hasNanos() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
void clearNanos() => $_clearField(2);
|
||||
/// Creates a new instance from [dateTime].
|
||||
///
|
||||
/// Time zone information will not be preserved.
|
||||
static Timestamp fromDateTime($core.DateTime dateTime) {
|
||||
final result = create();
|
||||
$mixin.TimestampMixin.setFromDateTime(result, dateTime);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names');
|
||||
const _omitMessageNames = $core.bool.fromEnvironment('protobuf.omit_message_names');
|
||||
11
lib/src/generated/google/protobuf/timestamp.pbenum.dart
Normal file
11
lib/src/generated/google/protobuf/timestamp.pbenum.dart
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: google/protobuf/timestamp.proto
|
||||
//
|
||||
// @dart = 3.3
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
29
lib/src/generated/google/protobuf/timestamp.pbjson.dart
Normal file
29
lib/src/generated/google/protobuf/timestamp.pbjson.dart
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: google/protobuf/timestamp.proto
|
||||
//
|
||||
// @dart = 3.3
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:convert' as $convert;
|
||||
import 'dart:core' as $core;
|
||||
import 'dart:typed_data' as $typed_data;
|
||||
|
||||
@$core.Deprecated('Use timestampDescriptor instead')
|
||||
const Timestamp$json = {
|
||||
'1': 'Timestamp',
|
||||
'2': [
|
||||
{'1': 'seconds', '3': 1, '4': 1, '5': 3, '10': 'seconds'},
|
||||
{'1': 'nanos', '3': 2, '4': 1, '5': 5, '10': 'nanos'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `Timestamp`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List timestampDescriptor = $convert.base64Decode(
|
||||
'CglUaW1lc3RhbXASGAoHc2Vjb25kcxgBIAEoA1IHc2Vjb25kcxIUCgVuYW5vcxgCIAEoBVIFbm'
|
||||
'Fub3M=');
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue