Update some env related apis

This commit is contained in:
Nikolai Rodionov 2024-04-19 16:49:59 +02:00
parent eb11f022be
commit 39d57048c2
Signed by: allanger
GPG Key ID: 0AA46A90E25592AD
4 changed files with 67 additions and 82 deletions

View File

@ -20,22 +20,22 @@ export 'environments_v1.pbenum.dart';
/// *
/// Represents a environment UUID only
/// I don't think we need it
class EnvironmentId extends $pb.GeneratedMessage {
factory EnvironmentId({
$core.String? id,
class EnvironmentName extends $pb.GeneratedMessage {
factory EnvironmentName({
$core.String? name,
}) {
final $result = create();
if (id != null) {
$result.id = id;
if (name != null) {
$result.name = name;
}
return $result;
}
EnvironmentId._() : super();
factory EnvironmentId.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory EnvironmentId.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
EnvironmentName._() : super();
factory EnvironmentName.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory EnvironmentName.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'EnvironmentId', package: const $pb.PackageName(_omitMessageNames ? '' : 'environments'), createEmptyInstance: create)
..aOS(1, _omitFieldNames ? '' : 'id')
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'EnvironmentName', package: const $pb.PackageName(_omitMessageNames ? '' : 'environments'), createEmptyInstance: create)
..aOS(1, _omitFieldNames ? '' : 'name')
..hasRequiredFields = false
;
@ -43,44 +43,40 @@ class EnvironmentId extends $pb.GeneratedMessage {
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
'Will be removed in next major version')
EnvironmentId clone() => EnvironmentId()..mergeFromMessage(this);
EnvironmentName clone() => EnvironmentName()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
EnvironmentId copyWith(void Function(EnvironmentId) updates) => super.copyWith((message) => updates(message as EnvironmentId)) as EnvironmentId;
EnvironmentName copyWith(void Function(EnvironmentName) updates) => super.copyWith((message) => updates(message as EnvironmentName)) as EnvironmentName;
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static EnvironmentId create() => EnvironmentId._();
EnvironmentId createEmptyInstance() => create();
static $pb.PbList<EnvironmentId> createRepeated() => $pb.PbList<EnvironmentId>();
static EnvironmentName create() => EnvironmentName._();
EnvironmentName createEmptyInstance() => create();
static $pb.PbList<EnvironmentName> createRepeated() => $pb.PbList<EnvironmentName>();
@$core.pragma('dart2js:noInline')
static EnvironmentId getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<EnvironmentId>(create);
static EnvironmentId? _defaultInstance;
static EnvironmentName getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<EnvironmentName>(create);
static EnvironmentName? _defaultInstance;
@$pb.TagNumber(1)
$core.String get id => $_getSZ(0);
$core.String get name => $_getSZ(0);
@$pb.TagNumber(1)
set id($core.String v) { $_setString(0, v); }
set name($core.String v) { $_setString(0, v); }
@$pb.TagNumber(1)
$core.bool hasId() => $_has(0);
$core.bool hasName() => $_has(0);
@$pb.TagNumber(1)
void clearId() => clearField(1);
void clearName() => clearField(1);
}
class EnvironmentData extends $pb.GeneratedMessage {
factory EnvironmentData({
$core.String? name,
Provider? provider,
Kubernetes? kubernetes,
HetznerOptions? hetznerOptions,
}) {
final $result = create();
if (name != null) {
$result.name = name;
}
if (provider != null) {
$result.provider = provider;
}
@ -97,7 +93,6 @@ class EnvironmentData extends $pb.GeneratedMessage {
factory EnvironmentData.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'EnvironmentData', package: const $pb.PackageName(_omitMessageNames ? '' : 'environments'), createEmptyInstance: create)
..aOS(1, _omitFieldNames ? '' : 'name')
..e<Provider>(2, _omitFieldNames ? '' : 'provider', $pb.PbFieldType.OE, defaultOrMaker: Provider.PROVIDER_UNSPECIFIED, valueOf: Provider.valueOf, enumValues: Provider.values)
..e<Kubernetes>(3, _omitFieldNames ? '' : 'kubernetes', $pb.PbFieldType.OE, defaultOrMaker: Kubernetes.KUBERNETES_UNSPECIFIED, valueOf: Kubernetes.valueOf, enumValues: Kubernetes.values)
..aOM<HetznerOptions>(4, _omitFieldNames ? '' : 'hetznerOptions', subBuilder: HetznerOptions.create)
@ -125,43 +120,34 @@ class EnvironmentData extends $pb.GeneratedMessage {
static EnvironmentData getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<EnvironmentData>(create);
static EnvironmentData? _defaultInstance;
@$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);
@$pb.TagNumber(2)
Provider get provider => $_getN(1);
Provider get provider => $_getN(0);
@$pb.TagNumber(2)
set provider(Provider v) { setField(2, v); }
@$pb.TagNumber(2)
$core.bool hasProvider() => $_has(1);
$core.bool hasProvider() => $_has(0);
@$pb.TagNumber(2)
void clearProvider() => clearField(2);
@$pb.TagNumber(3)
Kubernetes get kubernetes => $_getN(2);
Kubernetes get kubernetes => $_getN(1);
@$pb.TagNumber(3)
set kubernetes(Kubernetes v) { setField(3, v); }
@$pb.TagNumber(3)
$core.bool hasKubernetes() => $_has(2);
$core.bool hasKubernetes() => $_has(1);
@$pb.TagNumber(3)
void clearKubernetes() => clearField(3);
@$pb.TagNumber(4)
HetznerOptions get hetznerOptions => $_getN(3);
HetznerOptions get hetznerOptions => $_getN(2);
@$pb.TagNumber(4)
set hetznerOptions(HetznerOptions v) { setField(4, v); }
@$pb.TagNumber(4)
$core.bool hasHetznerOptions() => $_has(3);
$core.bool hasHetznerOptions() => $_has(2);
@$pb.TagNumber(4)
void clearHetznerOptions() => clearField(4);
@$pb.TagNumber(4)
HetznerOptions ensureHetznerOptions() => $_ensure(3);
HetznerOptions ensureHetznerOptions() => $_ensure(2);
}
class HetznerOptions extends $pb.GeneratedMessage {
@ -230,12 +216,12 @@ class HetznerOptions extends $pb.GeneratedMessage {
class EnvironmentFull extends $pb.GeneratedMessage {
factory EnvironmentFull({
EnvironmentId? id,
EnvironmentName? name,
EnvironmentData? data,
}) {
final $result = create();
if (id != null) {
$result.id = id;
if (name != null) {
$result.name = name;
}
if (data != null) {
$result.data = data;
@ -247,7 +233,7 @@ class EnvironmentFull extends $pb.GeneratedMessage {
factory EnvironmentFull.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'EnvironmentFull', package: const $pb.PackageName(_omitMessageNames ? '' : 'environments'), createEmptyInstance: create)
..aOM<EnvironmentId>(1, _omitFieldNames ? '' : 'id', subBuilder: EnvironmentId.create)
..aOM<EnvironmentName>(1, _omitFieldNames ? '' : 'name', subBuilder: EnvironmentName.create)
..aOM<EnvironmentData>(2, _omitFieldNames ? '' : 'data', subBuilder: EnvironmentData.create)
..hasRequiredFields = false
;
@ -274,15 +260,15 @@ class EnvironmentFull extends $pb.GeneratedMessage {
static EnvironmentFull? _defaultInstance;
@$pb.TagNumber(1)
EnvironmentId get id => $_getN(0);
EnvironmentName get name => $_getN(0);
@$pb.TagNumber(1)
set id(EnvironmentId v) { setField(1, v); }
set name(EnvironmentName v) { setField(1, v); }
@$pb.TagNumber(1)
$core.bool hasId() => $_has(0);
$core.bool hasName() => $_has(0);
@$pb.TagNumber(1)
void clearId() => clearField(1);
void clearName() => clearField(1);
@$pb.TagNumber(1)
EnvironmentId ensureId() => $_ensure(0);
EnvironmentName ensureName() => $_ensure(0);
@$pb.TagNumber(2)
EnvironmentData get data => $_getN(1);

View File

@ -34,14 +34,14 @@ class EnvironmentsClient extends $grpc.Client {
'/environments.Environments/Delete',
($2.EnvironmentFull value) => value.writeToBuffer(),
($core.List<$core.int> value) => $1.Empty.fromBuffer(value));
static final _$get = $grpc.ClientMethod<$2.EnvironmentId, $2.EnvironmentFull>(
static final _$get = $grpc.ClientMethod<$2.EnvironmentName, $2.EnvironmentFull>(
'/environments.Environments/Get',
($2.EnvironmentId value) => value.writeToBuffer(),
($2.EnvironmentName value) => value.writeToBuffer(),
($core.List<$core.int> value) => $2.EnvironmentFull.fromBuffer(value));
static final _$list = $grpc.ClientMethod<$1.Empty, $2.EnvironmentFull>(
static final _$list = $grpc.ClientMethod<$1.Empty, $2.EnvironmentName>(
'/environments.Environments/List',
($1.Empty value) => value.writeToBuffer(),
($core.List<$core.int> value) => $2.EnvironmentFull.fromBuffer(value));
($core.List<$core.int> value) => $2.EnvironmentName.fromBuffer(value));
EnvironmentsClient($grpc.ClientChannel channel,
{$grpc.CallOptions? options,
@ -61,11 +61,11 @@ class EnvironmentsClient extends $grpc.Client {
return $createUnaryCall(_$delete, request, options: options);
}
$grpc.ResponseFuture<$2.EnvironmentFull> get($2.EnvironmentId request, {$grpc.CallOptions? options}) {
$grpc.ResponseFuture<$2.EnvironmentFull> get($2.EnvironmentName request, {$grpc.CallOptions? options}) {
return $createUnaryCall(_$get, request, options: options);
}
$grpc.ResponseStream<$2.EnvironmentFull> list($1.Empty request, {$grpc.CallOptions? options}) {
$grpc.ResponseStream<$2.EnvironmentName> list($1.Empty request, {$grpc.CallOptions? options}) {
return $createStreamingCall(_$list, $async.Stream.fromIterable([request]), options: options);
}
}
@ -96,20 +96,20 @@ abstract class EnvironmentsServiceBase extends $grpc.Service {
false,
($core.List<$core.int> value) => $2.EnvironmentFull.fromBuffer(value),
($1.Empty value) => value.writeToBuffer()));
$addMethod($grpc.ServiceMethod<$2.EnvironmentId, $2.EnvironmentFull>(
$addMethod($grpc.ServiceMethod<$2.EnvironmentName, $2.EnvironmentFull>(
'Get',
get_Pre,
false,
false,
($core.List<$core.int> value) => $2.EnvironmentId.fromBuffer(value),
($core.List<$core.int> value) => $2.EnvironmentName.fromBuffer(value),
($2.EnvironmentFull value) => value.writeToBuffer()));
$addMethod($grpc.ServiceMethod<$1.Empty, $2.EnvironmentFull>(
$addMethod($grpc.ServiceMethod<$1.Empty, $2.EnvironmentName>(
'List',
list_Pre,
false,
true,
($core.List<$core.int> value) => $1.Empty.fromBuffer(value),
($2.EnvironmentFull value) => value.writeToBuffer()));
($2.EnvironmentName value) => value.writeToBuffer()));
}
$async.Future<$2.EnvironmentFull> create_Pre($grpc.ServiceCall call, $async.Future<$2.EnvironmentData> request) async {
@ -124,17 +124,17 @@ abstract class EnvironmentsServiceBase extends $grpc.Service {
return delete(call, await request);
}
$async.Future<$2.EnvironmentFull> get_Pre($grpc.ServiceCall call, $async.Future<$2.EnvironmentId> request) async {
$async.Future<$2.EnvironmentFull> get_Pre($grpc.ServiceCall call, $async.Future<$2.EnvironmentName> request) async {
return get(call, await request);
}
$async.Stream<$2.EnvironmentFull> list_Pre($grpc.ServiceCall call, $async.Future<$1.Empty> request) async* {
$async.Stream<$2.EnvironmentName> list_Pre($grpc.ServiceCall call, $async.Future<$1.Empty> request) async* {
yield* list(call, await request);
}
$async.Future<$2.EnvironmentFull> create($grpc.ServiceCall call, $2.EnvironmentData request);
$async.Future<$2.EnvironmentFull> update($grpc.ServiceCall call, $2.EnvironmentFull request);
$async.Future<$1.Empty> delete($grpc.ServiceCall call, $2.EnvironmentFull request);
$async.Future<$2.EnvironmentFull> get($grpc.ServiceCall call, $2.EnvironmentId request);
$async.Stream<$2.EnvironmentFull> list($grpc.ServiceCall call, $1.Empty request);
$async.Future<$2.EnvironmentFull> get($grpc.ServiceCall call, $2.EnvironmentName request);
$async.Stream<$2.EnvironmentName> list($grpc.ServiceCall call, $1.Empty request);
}

View File

@ -41,23 +41,22 @@ final $typed_data.Uint8List kubernetesDescriptor = $convert.base64Decode(
'CgpLdWJlcm5ldGVzEhoKFktVQkVSTkVURVNfVU5TUEVDSUZJRUQQABISCg5LVUJFUk5FVEVTX0'
'szUxAB');
@$core.Deprecated('Use environmentIdDescriptor instead')
const EnvironmentId$json = {
'1': 'EnvironmentId',
@$core.Deprecated('Use environmentNameDescriptor instead')
const EnvironmentName$json = {
'1': 'EnvironmentName',
'2': [
{'1': 'id', '3': 1, '4': 1, '5': 9, '10': 'id'},
{'1': 'name', '3': 1, '4': 1, '5': 9, '10': 'name'},
],
};
/// Descriptor for `EnvironmentId`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List environmentIdDescriptor = $convert.base64Decode(
'Cg1FbnZpcm9ubWVudElkEg4KAmlkGAEgASgJUgJpZA==');
/// Descriptor for `EnvironmentName`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List environmentNameDescriptor = $convert.base64Decode(
'Cg9FbnZpcm9ubWVudE5hbWUSEgoEbmFtZRgBIAEoCVIEbmFtZQ==');
@$core.Deprecated('Use environmentDataDescriptor instead')
const EnvironmentData$json = {
'1': 'EnvironmentData',
'2': [
{'1': 'name', '3': 1, '4': 1, '5': 9, '10': 'name'},
{'1': 'provider', '3': 2, '4': 1, '5': 14, '6': '.environments.Provider', '10': 'provider'},
{'1': 'kubernetes', '3': 3, '4': 1, '5': 14, '6': '.environments.Kubernetes', '10': 'kubernetes'},
{'1': 'hetzner_options', '3': 4, '4': 1, '5': 11, '6': '.environments.HetznerOptions', '10': 'hetznerOptions'},
@ -66,10 +65,10 @@ const EnvironmentData$json = {
/// Descriptor for `EnvironmentData`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List environmentDataDescriptor = $convert.base64Decode(
'Cg9FbnZpcm9ubWVudERhdGESEgoEbmFtZRgBIAEoCVIEbmFtZRIyCghwcm92aWRlchgCIAEoDj'
'IWLmVudmlyb25tZW50cy5Qcm92aWRlclIIcHJvdmlkZXISOAoKa3ViZXJuZXRlcxgDIAEoDjIY'
'LmVudmlyb25tZW50cy5LdWJlcm5ldGVzUgprdWJlcm5ldGVzEkUKD2hldHpuZXJfb3B0aW9ucx'
'gEIAEoCzIcLmVudmlyb25tZW50cy5IZXR6bmVyT3B0aW9uc1IOaGV0em5lck9wdGlvbnM=');
'Cg9FbnZpcm9ubWVudERhdGESMgoIcHJvdmlkZXIYAiABKA4yFi5lbnZpcm9ubWVudHMuUHJvdm'
'lkZXJSCHByb3ZpZGVyEjgKCmt1YmVybmV0ZXMYAyABKA4yGC5lbnZpcm9ubWVudHMuS3ViZXJu'
'ZXRlc1IKa3ViZXJuZXRlcxJFCg9oZXR6bmVyX29wdGlvbnMYBCABKAsyHC5lbnZpcm9ubWVudH'
'MuSGV0em5lck9wdGlvbnNSDmhldHpuZXJPcHRpb25z');
@$core.Deprecated('Use hetznerOptionsDescriptor instead')
const HetznerOptions$json = {
@ -89,14 +88,14 @@ final $typed_data.Uint8List hetznerOptionsDescriptor = $convert.base64Decode(
const EnvironmentFull$json = {
'1': 'EnvironmentFull',
'2': [
{'1': 'id', '3': 1, '4': 1, '5': 11, '6': '.environments.EnvironmentId', '10': 'id'},
{'1': 'name', '3': 1, '4': 1, '5': 11, '6': '.environments.EnvironmentName', '10': 'name'},
{'1': 'data', '3': 2, '4': 1, '5': 11, '6': '.environments.EnvironmentData', '10': 'data'},
],
};
/// Descriptor for `EnvironmentFull`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List environmentFullDescriptor = $convert.base64Decode(
'Cg9FbnZpcm9ubWVudEZ1bGwSKwoCaWQYASABKAsyGy5lbnZpcm9ubWVudHMuRW52aXJvbm1lbn'
'RJZFICaWQSMQoEZGF0YRgCIAEoCzIdLmVudmlyb25tZW50cy5FbnZpcm9ubWVudERhdGFSBGRh'
'dGE=');
'Cg9FbnZpcm9ubWVudEZ1bGwSMQoEbmFtZRgBIAEoCzIdLmVudmlyb25tZW50cy5FbnZpcm9ubW'
'VudE5hbWVSBG5hbWUSMQoEZGF0YRgCIAEoCzIdLmVudmlyb25tZW50cy5FbnZpcm9ubWVudERh'
'dGFSBGRhdGE=');

2
proto

@ -1 +1 @@
Subproject commit c6df6964e895c11ec79a229e1aeeda684a8144fc
Subproject commit a71f2b7cb57ff0e1dfa81aee4a8732c9316a5509