@@ -23,27 +23,23 @@ public enum IndexType
2323
2424internal static class TableEnumConverter
2525{
26- internal static FeatureFlagStatus FromProto ( this FeatureFlag . Types . Status proto )
27- {
28- return proto switch
26+ internal static FeatureFlagStatus FromProto ( this FeatureFlag . Types . Status proto ) =>
27+ proto switch
2928 {
3029 FeatureFlag . Types . Status . Unspecified => FeatureFlagStatus . Unspecified ,
3130 FeatureFlag . Types . Status . Enabled => FeatureFlagStatus . Enabled ,
3231 FeatureFlag . Types . Status . Disabled => FeatureFlagStatus . Disabled ,
3332 _ => throw new ArgumentOutOfRangeException ( )
3433 } ;
35- }
3634
37- internal static FeatureFlag . Types . Status GetProto ( this FeatureFlagStatus status )
38- {
39- return status switch
35+ internal static FeatureFlag . Types . Status GetProto ( this FeatureFlagStatus status ) =>
36+ status switch
4037 {
4138 FeatureFlagStatus . Unspecified => FeatureFlag . Types . Status . Unspecified ,
4239 FeatureFlagStatus . Enabled => FeatureFlag . Types . Status . Enabled ,
4340 FeatureFlagStatus . Disabled => FeatureFlag . Types . Status . Disabled ,
4441 _ => throw new ArgumentOutOfRangeException ( nameof ( status ) , status , null )
4542 } ;
46- }
4743}
4844
4945public class PartitionStats
@@ -157,9 +153,8 @@ public Ydb.Table.ValueSinceUnixEpochModeSettings GetProto()
157153 } ;
158154 }
159155
160- private static Ydb . Table . ValueSinceUnixEpochModeSettings . Types . Unit GetProtoUnit ( Unit unit )
161- {
162- return unit switch
156+ private static Ydb . Table . ValueSinceUnixEpochModeSettings . Types . Unit GetProtoUnit ( Unit unit ) =>
157+ unit switch
163158 {
164159 Unit . Unspecified => Ydb . Table . ValueSinceUnixEpochModeSettings . Types . Unit . Unspecified ,
165160 Unit . Seconds => Ydb . Table . ValueSinceUnixEpochModeSettings . Types . Unit . Seconds ,
@@ -168,7 +163,6 @@ private static Ydb.Table.ValueSinceUnixEpochModeSettings.Types.Unit GetProtoUnit
168163 Unit . Nanoseconds => Ydb . Table . ValueSinceUnixEpochModeSettings . Types . Unit . Nanoseconds ,
169164 _ => throw new ArgumentOutOfRangeException ( nameof ( unit ) , unit , null )
170165 } ;
171- }
172166}
173167
174168public class TtlSettingsMode
@@ -304,10 +298,7 @@ public StoragePool(Ydb.Table.StoragePool? proto)
304298 Media = proto ? . Media ;
305299 }
306300
307- public Ydb . Table . StoragePool GetProto ( )
308- {
309- return new Ydb . Table . StoragePool { Media = Media } ;
310- }
301+ public Ydb . Table . StoragePool GetProto ( ) => new ( ) { Media = Media } ;
311302}
312303
313304public class StorageSettings
@@ -376,18 +367,15 @@ public PartitioningSettings(Ydb.Table.PartitioningSettings proto)
376367 MaxPartitionsCount = proto . MaxPartitionsCount ;
377368 }
378369
379- public Ydb . Table . PartitioningSettings GetProto ( )
370+ public Ydb . Table . PartitioningSettings GetProto ( ) => new ( )
380371 {
381- return new Ydb . Table . PartitioningSettings
382- {
383- PartitionBy = { PartitionBy } ,
384- PartitioningBySize = PartitioningBySize . GetProto ( ) ,
385- PartitionSizeMb = PartitionSizeMb ,
386- PartitioningByLoad = PartitioningByLoad . GetProto ( ) ,
387- MinPartitionsCount = MinPartitionsCount ,
388- MaxPartitionsCount = MaxPartitionsCount
389- } ;
390- }
372+ PartitionBy = { PartitionBy } ,
373+ PartitioningBySize = PartitioningBySize . GetProto ( ) ,
374+ PartitionSizeMb = PartitionSizeMb ,
375+ PartitioningByLoad = PartitioningByLoad . GetProto ( ) ,
376+ MinPartitionsCount = MinPartitionsCount ,
377+ MaxPartitionsCount = MaxPartitionsCount
378+ } ;
391379}
392380
393381public class ReadReplicasSettings
@@ -402,7 +390,6 @@ public enum SettingsType
402390 public SettingsType Type { get ; }
403391 public ulong Settings { get ; }
404392
405-
406393 public ReadReplicasSettings ( SettingsType type , ulong settings )
407394 {
408395 Type = type ;
@@ -435,18 +422,15 @@ public ReadReplicasSettings(Ydb.Table.ReadReplicasSettings? proto)
435422 }
436423 }
437424
438- public Ydb . Table . ReadReplicasSettings GetProto ( )
425+ public Ydb . Table . ReadReplicasSettings GetProto ( ) => Type switch
439426 {
440- return Type switch
441- {
442- SettingsType . None => new Ydb . Table . ReadReplicasSettings ( ) ,
443- SettingsType . PerAzReadReplicasCount => new Ydb . Table . ReadReplicasSettings
444- { PerAzReadReplicasCount = Settings } ,
445- SettingsType . AnyAzReadReplicasCount => new Ydb . Table . ReadReplicasSettings
446- { AnyAzReadReplicasCount = Settings } ,
447- _ => throw new ArgumentOutOfRangeException ( )
448- } ;
449- }
427+ SettingsType . None => new Ydb . Table . ReadReplicasSettings ( ) ,
428+ SettingsType . PerAzReadReplicasCount => new Ydb . Table . ReadReplicasSettings
429+ { PerAzReadReplicasCount = Settings } ,
430+ SettingsType . AnyAzReadReplicasCount => new Ydb . Table . ReadReplicasSettings
431+ { AnyAzReadReplicasCount = Settings } ,
432+ _ => throw new ArgumentOutOfRangeException ( )
433+ } ;
450434}
451435
452436public class DescribeTableSettings : OperationSettings
@@ -518,9 +502,8 @@ public ResultData(Entry self, IReadOnlyList<ColumnMeta> columns, IReadOnlyList<s
518502 ReadReplicasSettings = readReplicasSettings ;
519503 }
520504
521- internal static ResultData FromProto ( DescribeTableResult resultProto )
522- {
523- return new ResultData (
505+ internal static ResultData FromProto ( DescribeTableResult resultProto ) =>
506+ new (
524507 self : resultProto . Self ,
525508 columns : resultProto . Columns . Select ( proto => new ColumnMeta ( proto ) ) . ToList ( ) ,
526509 primaryKey : resultProto . PrimaryKey . ToList ( ) ,
@@ -536,7 +519,6 @@ internal static ResultData FromProto(DescribeTableResult resultProto)
536519 keyBloomFilter : resultProto . KeyBloomFilter . FromProto ( ) ,
537520 readReplicasSettings : new ReadReplicasSettings ( resultProto . ReadReplicasSettings )
538521 ) ;
539- }
540522 }
541523}
542524
0 commit comments