diff --git a/Marechai.App/Services/Client/ApiClient.cs b/Marechai.App/Services/Client/ApiClient.cs index c03efe3c..d19bf5e7 100644 --- a/Marechai.App/Services/Client/ApiClient.cs +++ b/Marechai.App/Services/Client/ApiClient.cs @@ -279,7 +279,7 @@ namespace Marechai.App ApiClientBuilder.RegisterDefaultDeserializer(); if (string.IsNullOrEmpty(RequestAdapter.BaseUrl)) { - RequestAdapter.BaseUrl = "http://localhost:5023"; + RequestAdapter.BaseUrl = "https://localhost:7163"; } PathParameters.TryAdd("baseurl", RequestAdapter.BaseUrl); } diff --git a/Marechai.App/Services/Client/Models/BookScanDto.cs b/Marechai.App/Services/Client/Models/BookScanDto.cs index b3e33c34..0543dd73 100644 --- a/Marechai.App/Services/Client/Models/BookScanDto.cs +++ b/Marechai.App/Services/Client/Models/BookScanDto.cs @@ -33,13 +33,7 @@ namespace Marechai.App.Models /// The book_id property public long? BookId { get; set; } /// The colorspace property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.BookScanDto.BookScanDto_colorspace? Colorspace { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.BookScanDto.BookScanDto_colorspace Colorspace { get; set; } -#endif + public int? Colorspace { get; set; } /// The comments property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable @@ -73,13 +67,7 @@ namespace Marechai.App.Models /// The page property public int? Page { get; set; } /// The resolution_unit property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.BookScanDto.BookScanDto_resolution_unit? ResolutionUnit { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.BookScanDto.BookScanDto_resolution_unit ResolutionUnit { get; set; } -#endif + public int? ResolutionUnit { get; set; } /// The scanner_manufacturer property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable @@ -146,7 +134,7 @@ namespace Marechai.App.Models { "author", n => { Author = n.GetStringValue(); } }, { "book", n => { Book = n.GetStringValue(); } }, { "book_id", n => { BookId = n.GetLongValue(); } }, - { "colorspace", n => { Colorspace = n.GetObjectValue(global::Marechai.App.Models.BookScanDto.BookScanDto_colorspace.CreateFromDiscriminatorValue); } }, + { "colorspace", n => { Colorspace = n.GetIntValue(); } }, { "comments", n => { Comments = n.GetStringValue(); } }, { "creation_date", n => { CreationDate = n.GetDateTimeOffsetValue(); } }, { "exif_version", n => { ExifVersion = n.GetStringValue(); } }, @@ -154,7 +142,7 @@ namespace Marechai.App.Models { "id", n => { Id = n.GetGuidValue(); } }, { "original_extension", n => { OriginalExtension = n.GetStringValue(); } }, { "page", n => { Page = n.GetIntValue(); } }, - { "resolution_unit", n => { ResolutionUnit = n.GetObjectValue(global::Marechai.App.Models.BookScanDto.BookScanDto_resolution_unit.CreateFromDiscriminatorValue); } }, + { "resolution_unit", n => { ResolutionUnit = n.GetIntValue(); } }, { "scanner_manufacturer", n => { ScannerManufacturer = n.GetStringValue(); } }, { "scanner_model", n => { ScannerModel = n.GetStringValue(); } }, { "software", n => { Software = n.GetStringValue(); } }, @@ -174,7 +162,7 @@ namespace Marechai.App.Models writer.WriteStringValue("author", Author); writer.WriteStringValue("book", Book); writer.WriteLongValue("book_id", BookId); - writer.WriteObjectValue("colorspace", Colorspace); + writer.WriteIntValue("colorspace", Colorspace); writer.WriteStringValue("comments", Comments); writer.WriteDateTimeOffsetValue("creation_date", CreationDate); writer.WriteStringValue("exif_version", ExifVersion); @@ -182,7 +170,7 @@ namespace Marechai.App.Models writer.WriteGuidValue("id", Id); writer.WriteStringValue("original_extension", OriginalExtension); writer.WriteIntValue("page", Page); - writer.WriteObjectValue("resolution_unit", ResolutionUnit); + writer.WriteIntValue("resolution_unit", ResolutionUnit); writer.WriteStringValue("scanner_manufacturer", ScannerManufacturer); writer.WriteStringValue("scanner_model", ScannerModel); writer.WriteStringValue("software", Software); @@ -192,156 +180,6 @@ namespace Marechai.App.Models writer.WriteDoubleValue("vertical_resolution", VerticalResolution); writer.WriteAdditionalData(AdditionalData); } - /// - /// Composed type wrapper for classes , - /// - [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] - public partial class BookScanDto_colorspace : IComposedTypeWrapper, IParsable - { - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.BookScanDto_colorspaceMember1? BookScanDtoColorspaceMember1 { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.BookScanDto_colorspaceMember1 BookScanDtoColorspaceMember1 { get; set; } -#endif - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.ColorSpace? ColorSpace { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.ColorSpace ColorSpace { get; set; } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static global::Marechai.App.Models.BookScanDto.BookScanDto_colorspace CreateFromDiscriminatorValue(IParseNode parseNode) - { - if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode)); - var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); - var result = new global::Marechai.App.Models.BookScanDto.BookScanDto_colorspace(); - if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.BookScanDtoColorspaceMember1 = new global::Marechai.App.Models.BookScanDto_colorspaceMember1(); - } - else if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.ColorSpace = new global::Marechai.App.Models.ColorSpace(); - } - return result; - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - if(BookScanDtoColorspaceMember1 != null) - { - return BookScanDtoColorspaceMember1.GetFieldDeserializers(); - } - else if(ColorSpace != null) - { - return ColorSpace.GetFieldDeserializers(); - } - return new Dictionary>(); - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer)); - if(BookScanDtoColorspaceMember1 != null) - { - writer.WriteObjectValue(null, BookScanDtoColorspaceMember1); - } - else if(ColorSpace != null) - { - writer.WriteObjectValue(null, ColorSpace); - } - } - } - /// - /// Composed type wrapper for classes , - /// - [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] - public partial class BookScanDto_resolution_unit : IComposedTypeWrapper, IParsable - { - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.BookScanDto_resolution_unitMember1? BookScanDtoResolutionUnitMember1 { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.BookScanDto_resolution_unitMember1 BookScanDtoResolutionUnitMember1 { get; set; } -#endif - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.ResolutionUnit? ResolutionUnit { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.ResolutionUnit ResolutionUnit { get; set; } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static global::Marechai.App.Models.BookScanDto.BookScanDto_resolution_unit CreateFromDiscriminatorValue(IParseNode parseNode) - { - if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode)); - var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); - var result = new global::Marechai.App.Models.BookScanDto.BookScanDto_resolution_unit(); - if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.BookScanDtoResolutionUnitMember1 = new global::Marechai.App.Models.BookScanDto_resolution_unitMember1(); - } - else if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.ResolutionUnit = new global::Marechai.App.Models.ResolutionUnit(); - } - return result; - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - if(BookScanDtoResolutionUnitMember1 != null) - { - return BookScanDtoResolutionUnitMember1.GetFieldDeserializers(); - } - else if(ResolutionUnit != null) - { - return ResolutionUnit.GetFieldDeserializers(); - } - return new Dictionary>(); - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer)); - if(BookScanDtoResolutionUnitMember1 != null) - { - writer.WriteObjectValue(null, BookScanDtoResolutionUnitMember1); - } - else if(ResolutionUnit != null) - { - writer.WriteObjectValue(null, ResolutionUnit); - } - } - } } } #pragma warning restore CS0618 diff --git a/Marechai.App/Services/Client/Models/DocumentScanDto.cs b/Marechai.App/Services/Client/Models/DocumentScanDto.cs index 1d4a8096..f20de7c1 100644 --- a/Marechai.App/Services/Client/Models/DocumentScanDto.cs +++ b/Marechai.App/Services/Client/Models/DocumentScanDto.cs @@ -23,13 +23,7 @@ namespace Marechai.App.Models public string Author { get; set; } #endif /// The colorspace property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.DocumentScanDto.DocumentScanDto_colorspace? Colorspace { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.DocumentScanDto.DocumentScanDto_colorspace Colorspace { get; set; } -#endif + public int? Colorspace { get; set; } /// The comments property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable @@ -73,13 +67,7 @@ namespace Marechai.App.Models /// The page property public int? Page { get; set; } /// The resolution_unit property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.DocumentScanDto.DocumentScanDto_resolution_unit? ResolutionUnit { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.DocumentScanDto.DocumentScanDto_resolution_unit ResolutionUnit { get; set; } -#endif + public int? ResolutionUnit { get; set; } /// The scanner_manufacturer property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable @@ -144,7 +132,7 @@ namespace Marechai.App.Models return new Dictionary> { { "author", n => { Author = n.GetStringValue(); } }, - { "colorspace", n => { Colorspace = n.GetObjectValue(global::Marechai.App.Models.DocumentScanDto.DocumentScanDto_colorspace.CreateFromDiscriminatorValue); } }, + { "colorspace", n => { Colorspace = n.GetIntValue(); } }, { "comments", n => { Comments = n.GetStringValue(); } }, { "creation_date", n => { CreationDate = n.GetDateTimeOffsetValue(); } }, { "document", n => { Document = n.GetStringValue(); } }, @@ -154,7 +142,7 @@ namespace Marechai.App.Models { "id", n => { Id = n.GetGuidValue(); } }, { "original_extension", n => { OriginalExtension = n.GetStringValue(); } }, { "page", n => { Page = n.GetIntValue(); } }, - { "resolution_unit", n => { ResolutionUnit = n.GetObjectValue(global::Marechai.App.Models.DocumentScanDto.DocumentScanDto_resolution_unit.CreateFromDiscriminatorValue); } }, + { "resolution_unit", n => { ResolutionUnit = n.GetIntValue(); } }, { "scanner_manufacturer", n => { ScannerManufacturer = n.GetStringValue(); } }, { "scanner_model", n => { ScannerModel = n.GetStringValue(); } }, { "software", n => { Software = n.GetStringValue(); } }, @@ -172,7 +160,7 @@ namespace Marechai.App.Models { if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer)); writer.WriteStringValue("author", Author); - writer.WriteObjectValue("colorspace", Colorspace); + writer.WriteIntValue("colorspace", Colorspace); writer.WriteStringValue("comments", Comments); writer.WriteDateTimeOffsetValue("creation_date", CreationDate); writer.WriteStringValue("document", Document); @@ -182,7 +170,7 @@ namespace Marechai.App.Models writer.WriteGuidValue("id", Id); writer.WriteStringValue("original_extension", OriginalExtension); writer.WriteIntValue("page", Page); - writer.WriteObjectValue("resolution_unit", ResolutionUnit); + writer.WriteIntValue("resolution_unit", ResolutionUnit); writer.WriteStringValue("scanner_manufacturer", ScannerManufacturer); writer.WriteStringValue("scanner_model", ScannerModel); writer.WriteStringValue("software", Software); @@ -192,156 +180,6 @@ namespace Marechai.App.Models writer.WriteDoubleValue("vertical_resolution", VerticalResolution); writer.WriteAdditionalData(AdditionalData); } - /// - /// Composed type wrapper for classes , - /// - [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] - public partial class DocumentScanDto_colorspace : IComposedTypeWrapper, IParsable - { - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.ColorSpace? ColorSpace { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.ColorSpace ColorSpace { get; set; } -#endif - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.DocumentScanDto_colorspaceMember1? DocumentScanDtoColorspaceMember1 { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.DocumentScanDto_colorspaceMember1 DocumentScanDtoColorspaceMember1 { get; set; } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static global::Marechai.App.Models.DocumentScanDto.DocumentScanDto_colorspace CreateFromDiscriminatorValue(IParseNode parseNode) - { - if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode)); - var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); - var result = new global::Marechai.App.Models.DocumentScanDto.DocumentScanDto_colorspace(); - if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.ColorSpace = new global::Marechai.App.Models.ColorSpace(); - } - else if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.DocumentScanDtoColorspaceMember1 = new global::Marechai.App.Models.DocumentScanDto_colorspaceMember1(); - } - return result; - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - if(ColorSpace != null) - { - return ColorSpace.GetFieldDeserializers(); - } - else if(DocumentScanDtoColorspaceMember1 != null) - { - return DocumentScanDtoColorspaceMember1.GetFieldDeserializers(); - } - return new Dictionary>(); - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer)); - if(ColorSpace != null) - { - writer.WriteObjectValue(null, ColorSpace); - } - else if(DocumentScanDtoColorspaceMember1 != null) - { - writer.WriteObjectValue(null, DocumentScanDtoColorspaceMember1); - } - } - } - /// - /// Composed type wrapper for classes , - /// - [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] - public partial class DocumentScanDto_resolution_unit : IComposedTypeWrapper, IParsable - { - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.DocumentScanDto_resolution_unitMember1? DocumentScanDtoResolutionUnitMember1 { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.DocumentScanDto_resolution_unitMember1 DocumentScanDtoResolutionUnitMember1 { get; set; } -#endif - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.ResolutionUnit? ResolutionUnit { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.ResolutionUnit ResolutionUnit { get; set; } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static global::Marechai.App.Models.DocumentScanDto.DocumentScanDto_resolution_unit CreateFromDiscriminatorValue(IParseNode parseNode) - { - if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode)); - var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); - var result = new global::Marechai.App.Models.DocumentScanDto.DocumentScanDto_resolution_unit(); - if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.DocumentScanDtoResolutionUnitMember1 = new global::Marechai.App.Models.DocumentScanDto_resolution_unitMember1(); - } - else if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.ResolutionUnit = new global::Marechai.App.Models.ResolutionUnit(); - } - return result; - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - if(DocumentScanDtoResolutionUnitMember1 != null) - { - return DocumentScanDtoResolutionUnitMember1.GetFieldDeserializers(); - } - else if(ResolutionUnit != null) - { - return ResolutionUnit.GetFieldDeserializers(); - } - return new Dictionary>(); - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer)); - if(DocumentScanDtoResolutionUnitMember1 != null) - { - writer.WriteObjectValue(null, DocumentScanDtoResolutionUnitMember1); - } - else if(ResolutionUnit != null) - { - writer.WriteObjectValue(null, ResolutionUnit); - } - } - } } } #pragma warning restore CS0618 diff --git a/Marechai.App/Services/Client/Models/MachinePhotoDto.cs b/Marechai.App/Services/Client/Models/MachinePhotoDto.cs index 8fd17192..8dac9156 100644 --- a/Marechai.App/Services/Client/Models/MachinePhotoDto.cs +++ b/Marechai.App/Services/Client/Models/MachinePhotoDto.cs @@ -41,13 +41,7 @@ namespace Marechai.App.Models public string CameraModel { get; set; } #endif /// The colorspace property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_colorspace? Colorspace { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_colorspace Colorspace { get; set; } -#endif + public int? Colorspace { get; set; } /// The comments property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable @@ -57,13 +51,7 @@ namespace Marechai.App.Models public string Comments { get; set; } #endif /// The contrast property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_contrast? Contrast { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_contrast Contrast { get; set; } -#endif + public int? Contrast { get; set; } /// The creation_date property public DateTimeOffset? CreationDate { get; set; } /// The digital_zoom property @@ -79,29 +67,11 @@ namespace Marechai.App.Models /// The exposure property public double? Exposure { get; set; } /// The exposure_method property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_exposure_method? ExposureMethod { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_exposure_method ExposureMethod { get; set; } -#endif + public int? ExposureMethod { get; set; } /// The exposure_program property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_exposure_program? ExposureProgram { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_exposure_program ExposureProgram { get; set; } -#endif + public int? ExposureProgram { get; set; } /// The flash property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_flash? Flash { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_flash Flash { get; set; } -#endif + public int? Flash { get; set; } /// The focal property public double? Focal { get; set; } /// The focal_equivalent property @@ -133,13 +103,7 @@ namespace Marechai.App.Models public string LicenseName { get; set; } #endif /// The light_source property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_light_source? LightSource { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_light_source LightSource { get; set; } -#endif + public int? LightSource { get; set; } /// The machine_company_name property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable @@ -159,21 +123,9 @@ namespace Marechai.App.Models public string MachineName { get; set; } #endif /// The metering_mode property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_metering_mode? MeteringMode { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_metering_mode MeteringMode { get; set; } -#endif + public int? MeteringMode { get; set; } /// The orientation property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_orientation? Orientation { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_orientation Orientation { get; set; } -#endif + public int? Orientation { get; set; } /// The original_extension property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable @@ -183,45 +135,15 @@ namespace Marechai.App.Models public string OriginalExtension { get; set; } #endif /// The resolution_unit property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_resolution_unit? ResolutionUnit { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_resolution_unit ResolutionUnit { get; set; } -#endif + public int? ResolutionUnit { get; set; } /// The saturation property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_saturation? Saturation { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_saturation Saturation { get; set; } -#endif + public int? Saturation { get; set; } /// The scene_capture_type property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_scene_capture_type? SceneCaptureType { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_scene_capture_type SceneCaptureType { get; set; } -#endif + public int? SceneCaptureType { get; set; } /// The sensing_method property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_sensing_method? SensingMethod { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_sensing_method SensingMethod { get; set; } -#endif + public int? SensingMethod { get; set; } /// The sharpness property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_sharpness? Sharpness { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_sharpness Sharpness { get; set; } -#endif + public int? Sharpness { get; set; } /// The software property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable @@ -239,13 +161,7 @@ namespace Marechai.App.Models public string Source { get; set; } #endif /// The subject_distance_range property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_subject_distance_range? SubjectDistanceRange { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_subject_distance_range SubjectDistanceRange { get; set; } -#endif + public byte? SubjectDistanceRange { get; set; } /// The upload_date property public DateTimeOffset? UploadDate { get; set; } /// The user_id property @@ -259,13 +175,7 @@ namespace Marechai.App.Models /// The vertical_resolution property public double? VerticalResolution { get; set; } /// The white_balance property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_white_balance? WhiteBalance { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_white_balance WhiteBalance { get; set; } -#endif + public int? WhiteBalance { get; set; } /// /// Instantiates a new and sets the default values. /// @@ -295,16 +205,16 @@ namespace Marechai.App.Models { "author", n => { Author = n.GetStringValue(); } }, { "camera_manufacturer", n => { CameraManufacturer = n.GetStringValue(); } }, { "camera_model", n => { CameraModel = n.GetStringValue(); } }, - { "colorspace", n => { Colorspace = n.GetObjectValue(global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_colorspace.CreateFromDiscriminatorValue); } }, + { "colorspace", n => { Colorspace = n.GetIntValue(); } }, { "comments", n => { Comments = n.GetStringValue(); } }, - { "contrast", n => { Contrast = n.GetObjectValue(global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_contrast.CreateFromDiscriminatorValue); } }, + { "contrast", n => { Contrast = n.GetIntValue(); } }, { "creation_date", n => { CreationDate = n.GetDateTimeOffsetValue(); } }, { "digital_zoom", n => { DigitalZoom = n.GetDoubleValue(); } }, { "exif_version", n => { ExifVersion = n.GetStringValue(); } }, { "exposure", n => { Exposure = n.GetDoubleValue(); } }, - { "exposure_method", n => { ExposureMethod = n.GetObjectValue(global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_exposure_method.CreateFromDiscriminatorValue); } }, - { "exposure_program", n => { ExposureProgram = n.GetObjectValue(global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_exposure_program.CreateFromDiscriminatorValue); } }, - { "flash", n => { Flash = n.GetObjectValue(global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_flash.CreateFromDiscriminatorValue); } }, + { "exposure_method", n => { ExposureMethod = n.GetIntValue(); } }, + { "exposure_program", n => { ExposureProgram = n.GetIntValue(); } }, + { "flash", n => { Flash = n.GetIntValue(); } }, { "focal", n => { Focal = n.GetDoubleValue(); } }, { "focal_equivalent", n => { FocalEquivalent = n.GetDoubleValue(); } }, { "focal_length", n => { FocalLength = n.GetDoubleValue(); } }, @@ -314,25 +224,25 @@ namespace Marechai.App.Models { "lens", n => { Lens = n.GetStringValue(); } }, { "license_id", n => { LicenseId = n.GetIntValue(); } }, { "license_name", n => { LicenseName = n.GetStringValue(); } }, - { "light_source", n => { LightSource = n.GetObjectValue(global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_light_source.CreateFromDiscriminatorValue); } }, + { "light_source", n => { LightSource = n.GetIntValue(); } }, { "machine_company_name", n => { MachineCompanyName = n.GetStringValue(); } }, { "machine_id", n => { MachineId = n.GetIntValue(); } }, { "machine_name", n => { MachineName = n.GetStringValue(); } }, - { "metering_mode", n => { MeteringMode = n.GetObjectValue(global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_metering_mode.CreateFromDiscriminatorValue); } }, - { "orientation", n => { Orientation = n.GetObjectValue(global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_orientation.CreateFromDiscriminatorValue); } }, + { "metering_mode", n => { MeteringMode = n.GetIntValue(); } }, + { "orientation", n => { Orientation = n.GetIntValue(); } }, { "original_extension", n => { OriginalExtension = n.GetStringValue(); } }, - { "resolution_unit", n => { ResolutionUnit = n.GetObjectValue(global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_resolution_unit.CreateFromDiscriminatorValue); } }, - { "saturation", n => { Saturation = n.GetObjectValue(global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_saturation.CreateFromDiscriminatorValue); } }, - { "scene_capture_type", n => { SceneCaptureType = n.GetObjectValue(global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_scene_capture_type.CreateFromDiscriminatorValue); } }, - { "sensing_method", n => { SensingMethod = n.GetObjectValue(global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_sensing_method.CreateFromDiscriminatorValue); } }, - { "sharpness", n => { Sharpness = n.GetObjectValue(global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_sharpness.CreateFromDiscriminatorValue); } }, + { "resolution_unit", n => { ResolutionUnit = n.GetIntValue(); } }, + { "saturation", n => { Saturation = n.GetIntValue(); } }, + { "scene_capture_type", n => { SceneCaptureType = n.GetIntValue(); } }, + { "sensing_method", n => { SensingMethod = n.GetIntValue(); } }, + { "sharpness", n => { Sharpness = n.GetIntValue(); } }, { "software", n => { Software = n.GetStringValue(); } }, { "source", n => { Source = n.GetStringValue(); } }, - { "subject_distance_range", n => { SubjectDistanceRange = n.GetObjectValue(global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_subject_distance_range.CreateFromDiscriminatorValue); } }, + { "subject_distance_range", n => { SubjectDistanceRange = n.GetByteValue(); } }, { "upload_date", n => { UploadDate = n.GetDateTimeOffsetValue(); } }, { "user_id", n => { UserId = n.GetStringValue(); } }, { "vertical_resolution", n => { VerticalResolution = n.GetDoubleValue(); } }, - { "white_balance", n => { WhiteBalance = n.GetObjectValue(global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_white_balance.CreateFromDiscriminatorValue); } }, + { "white_balance", n => { WhiteBalance = n.GetIntValue(); } }, }; } /// @@ -346,16 +256,16 @@ namespace Marechai.App.Models writer.WriteStringValue("author", Author); writer.WriteStringValue("camera_manufacturer", CameraManufacturer); writer.WriteStringValue("camera_model", CameraModel); - writer.WriteObjectValue("colorspace", Colorspace); + writer.WriteIntValue("colorspace", Colorspace); writer.WriteStringValue("comments", Comments); - writer.WriteObjectValue("contrast", Contrast); + writer.WriteIntValue("contrast", Contrast); writer.WriteDateTimeOffsetValue("creation_date", CreationDate); writer.WriteDoubleValue("digital_zoom", DigitalZoom); writer.WriteStringValue("exif_version", ExifVersion); writer.WriteDoubleValue("exposure", Exposure); - writer.WriteObjectValue("exposure_method", ExposureMethod); - writer.WriteObjectValue("exposure_program", ExposureProgram); - writer.WriteObjectValue("flash", Flash); + writer.WriteIntValue("exposure_method", ExposureMethod); + writer.WriteIntValue("exposure_program", ExposureProgram); + writer.WriteIntValue("flash", Flash); writer.WriteDoubleValue("focal", Focal); writer.WriteDoubleValue("focal_equivalent", FocalEquivalent); writer.WriteDoubleValue("focal_length", FocalLength); @@ -365,1152 +275,27 @@ namespace Marechai.App.Models writer.WriteStringValue("lens", Lens); writer.WriteIntValue("license_id", LicenseId); writer.WriteStringValue("license_name", LicenseName); - writer.WriteObjectValue("light_source", LightSource); + writer.WriteIntValue("light_source", LightSource); writer.WriteStringValue("machine_company_name", MachineCompanyName); writer.WriteIntValue("machine_id", MachineId); writer.WriteStringValue("machine_name", MachineName); - writer.WriteObjectValue("metering_mode", MeteringMode); - writer.WriteObjectValue("orientation", Orientation); + writer.WriteIntValue("metering_mode", MeteringMode); + writer.WriteIntValue("orientation", Orientation); writer.WriteStringValue("original_extension", OriginalExtension); - writer.WriteObjectValue("resolution_unit", ResolutionUnit); - writer.WriteObjectValue("saturation", Saturation); - writer.WriteObjectValue("scene_capture_type", SceneCaptureType); - writer.WriteObjectValue("sensing_method", SensingMethod); - writer.WriteObjectValue("sharpness", Sharpness); + writer.WriteIntValue("resolution_unit", ResolutionUnit); + writer.WriteIntValue("saturation", Saturation); + writer.WriteIntValue("scene_capture_type", SceneCaptureType); + writer.WriteIntValue("sensing_method", SensingMethod); + writer.WriteIntValue("sharpness", Sharpness); writer.WriteStringValue("software", Software); writer.WriteStringValue("source", Source); - writer.WriteObjectValue("subject_distance_range", SubjectDistanceRange); + writer.WriteByteValue("subject_distance_range", SubjectDistanceRange); writer.WriteDateTimeOffsetValue("upload_date", UploadDate); writer.WriteStringValue("user_id", UserId); writer.WriteDoubleValue("vertical_resolution", VerticalResolution); - writer.WriteObjectValue("white_balance", WhiteBalance); + writer.WriteIntValue("white_balance", WhiteBalance); writer.WriteAdditionalData(AdditionalData); } - /// - /// Composed type wrapper for classes , - /// - [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] - public partial class MachinePhotoDto_colorspace : IComposedTypeWrapper, IParsable - { - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.ColorSpace? ColorSpace { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.ColorSpace ColorSpace { get; set; } -#endif - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.MachinePhotoDto_colorspaceMember1? MachinePhotoDtoColorspaceMember1 { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.MachinePhotoDto_colorspaceMember1 MachinePhotoDtoColorspaceMember1 { get; set; } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_colorspace CreateFromDiscriminatorValue(IParseNode parseNode) - { - if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode)); - var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); - var result = new global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_colorspace(); - if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.ColorSpace = new global::Marechai.App.Models.ColorSpace(); - } - else if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.MachinePhotoDtoColorspaceMember1 = new global::Marechai.App.Models.MachinePhotoDto_colorspaceMember1(); - } - return result; - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - if(ColorSpace != null) - { - return ColorSpace.GetFieldDeserializers(); - } - else if(MachinePhotoDtoColorspaceMember1 != null) - { - return MachinePhotoDtoColorspaceMember1.GetFieldDeserializers(); - } - return new Dictionary>(); - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer)); - if(ColorSpace != null) - { - writer.WriteObjectValue(null, ColorSpace); - } - else if(MachinePhotoDtoColorspaceMember1 != null) - { - writer.WriteObjectValue(null, MachinePhotoDtoColorspaceMember1); - } - } - } - /// - /// Composed type wrapper for classes , - /// - [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] - public partial class MachinePhotoDto_contrast : IComposedTypeWrapper, IParsable - { - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.Contrast? Contrast { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.Contrast Contrast { get; set; } -#endif - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.MachinePhotoDto_contrastMember1? MachinePhotoDtoContrastMember1 { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.MachinePhotoDto_contrastMember1 MachinePhotoDtoContrastMember1 { get; set; } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_contrast CreateFromDiscriminatorValue(IParseNode parseNode) - { - if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode)); - var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); - var result = new global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_contrast(); - if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.Contrast = new global::Marechai.App.Models.Contrast(); - } - else if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.MachinePhotoDtoContrastMember1 = new global::Marechai.App.Models.MachinePhotoDto_contrastMember1(); - } - return result; - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - if(Contrast != null) - { - return Contrast.GetFieldDeserializers(); - } - else if(MachinePhotoDtoContrastMember1 != null) - { - return MachinePhotoDtoContrastMember1.GetFieldDeserializers(); - } - return new Dictionary>(); - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer)); - if(Contrast != null) - { - writer.WriteObjectValue(null, Contrast); - } - else if(MachinePhotoDtoContrastMember1 != null) - { - writer.WriteObjectValue(null, MachinePhotoDtoContrastMember1); - } - } - } - /// - /// Composed type wrapper for classes , - /// - [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] - public partial class MachinePhotoDto_exposure_method : IComposedTypeWrapper, IParsable - { - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.ExposureMode? ExposureMode { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.ExposureMode ExposureMode { get; set; } -#endif - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.MachinePhotoDto_exposure_methodMember1? MachinePhotoDtoExposureMethodMember1 { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.MachinePhotoDto_exposure_methodMember1 MachinePhotoDtoExposureMethodMember1 { get; set; } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_exposure_method CreateFromDiscriminatorValue(IParseNode parseNode) - { - if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode)); - var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); - var result = new global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_exposure_method(); - if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.ExposureMode = new global::Marechai.App.Models.ExposureMode(); - } - else if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.MachinePhotoDtoExposureMethodMember1 = new global::Marechai.App.Models.MachinePhotoDto_exposure_methodMember1(); - } - return result; - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - if(ExposureMode != null) - { - return ExposureMode.GetFieldDeserializers(); - } - else if(MachinePhotoDtoExposureMethodMember1 != null) - { - return MachinePhotoDtoExposureMethodMember1.GetFieldDeserializers(); - } - return new Dictionary>(); - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer)); - if(ExposureMode != null) - { - writer.WriteObjectValue(null, ExposureMode); - } - else if(MachinePhotoDtoExposureMethodMember1 != null) - { - writer.WriteObjectValue(null, MachinePhotoDtoExposureMethodMember1); - } - } - } - /// - /// Composed type wrapper for classes , - /// - [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] - public partial class MachinePhotoDto_exposure_program : IComposedTypeWrapper, IParsable - { - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.ExposureProgram? ExposureProgram { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.ExposureProgram ExposureProgram { get; set; } -#endif - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.MachinePhotoDto_exposure_programMember1? MachinePhotoDtoExposureProgramMember1 { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.MachinePhotoDto_exposure_programMember1 MachinePhotoDtoExposureProgramMember1 { get; set; } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_exposure_program CreateFromDiscriminatorValue(IParseNode parseNode) - { - if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode)); - var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); - var result = new global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_exposure_program(); - if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.ExposureProgram = new global::Marechai.App.Models.ExposureProgram(); - } - else if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.MachinePhotoDtoExposureProgramMember1 = new global::Marechai.App.Models.MachinePhotoDto_exposure_programMember1(); - } - return result; - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - if(ExposureProgram != null) - { - return ExposureProgram.GetFieldDeserializers(); - } - else if(MachinePhotoDtoExposureProgramMember1 != null) - { - return MachinePhotoDtoExposureProgramMember1.GetFieldDeserializers(); - } - return new Dictionary>(); - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer)); - if(ExposureProgram != null) - { - writer.WriteObjectValue(null, ExposureProgram); - } - else if(MachinePhotoDtoExposureProgramMember1 != null) - { - writer.WriteObjectValue(null, MachinePhotoDtoExposureProgramMember1); - } - } - } - /// - /// Composed type wrapper for classes , - /// - [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] - public partial class MachinePhotoDto_flash : IComposedTypeWrapper, IParsable - { - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.Flash? Flash { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.Flash Flash { get; set; } -#endif - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.MachinePhotoDto_flashMember1? MachinePhotoDtoFlashMember1 { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.MachinePhotoDto_flashMember1 MachinePhotoDtoFlashMember1 { get; set; } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_flash CreateFromDiscriminatorValue(IParseNode parseNode) - { - if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode)); - var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); - var result = new global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_flash(); - if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.Flash = new global::Marechai.App.Models.Flash(); - } - else if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.MachinePhotoDtoFlashMember1 = new global::Marechai.App.Models.MachinePhotoDto_flashMember1(); - } - return result; - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - if(Flash != null) - { - return Flash.GetFieldDeserializers(); - } - else if(MachinePhotoDtoFlashMember1 != null) - { - return MachinePhotoDtoFlashMember1.GetFieldDeserializers(); - } - return new Dictionary>(); - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer)); - if(Flash != null) - { - writer.WriteObjectValue(null, Flash); - } - else if(MachinePhotoDtoFlashMember1 != null) - { - writer.WriteObjectValue(null, MachinePhotoDtoFlashMember1); - } - } - } - /// - /// Composed type wrapper for classes , - /// - [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] - public partial class MachinePhotoDto_light_source : IComposedTypeWrapper, IParsable - { - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.LightSource? LightSource { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.LightSource LightSource { get; set; } -#endif - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.MachinePhotoDto_light_sourceMember1? MachinePhotoDtoLightSourceMember1 { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.MachinePhotoDto_light_sourceMember1 MachinePhotoDtoLightSourceMember1 { get; set; } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_light_source CreateFromDiscriminatorValue(IParseNode parseNode) - { - if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode)); - var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); - var result = new global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_light_source(); - if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.LightSource = new global::Marechai.App.Models.LightSource(); - } - else if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.MachinePhotoDtoLightSourceMember1 = new global::Marechai.App.Models.MachinePhotoDto_light_sourceMember1(); - } - return result; - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - if(LightSource != null) - { - return LightSource.GetFieldDeserializers(); - } - else if(MachinePhotoDtoLightSourceMember1 != null) - { - return MachinePhotoDtoLightSourceMember1.GetFieldDeserializers(); - } - return new Dictionary>(); - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer)); - if(LightSource != null) - { - writer.WriteObjectValue(null, LightSource); - } - else if(MachinePhotoDtoLightSourceMember1 != null) - { - writer.WriteObjectValue(null, MachinePhotoDtoLightSourceMember1); - } - } - } - /// - /// Composed type wrapper for classes , - /// - [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] - public partial class MachinePhotoDto_metering_mode : IComposedTypeWrapper, IParsable - { - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.MachinePhotoDto_metering_modeMember1? MachinePhotoDtoMeteringModeMember1 { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.MachinePhotoDto_metering_modeMember1 MachinePhotoDtoMeteringModeMember1 { get; set; } -#endif - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.MeteringMode? MeteringMode { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.MeteringMode MeteringMode { get; set; } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_metering_mode CreateFromDiscriminatorValue(IParseNode parseNode) - { - if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode)); - var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); - var result = new global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_metering_mode(); - if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.MachinePhotoDtoMeteringModeMember1 = new global::Marechai.App.Models.MachinePhotoDto_metering_modeMember1(); - } - else if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.MeteringMode = new global::Marechai.App.Models.MeteringMode(); - } - return result; - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - if(MachinePhotoDtoMeteringModeMember1 != null) - { - return MachinePhotoDtoMeteringModeMember1.GetFieldDeserializers(); - } - else if(MeteringMode != null) - { - return MeteringMode.GetFieldDeserializers(); - } - return new Dictionary>(); - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer)); - if(MachinePhotoDtoMeteringModeMember1 != null) - { - writer.WriteObjectValue(null, MachinePhotoDtoMeteringModeMember1); - } - else if(MeteringMode != null) - { - writer.WriteObjectValue(null, MeteringMode); - } - } - } - /// - /// Composed type wrapper for classes , - /// - [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] - public partial class MachinePhotoDto_orientation : IComposedTypeWrapper, IParsable - { - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.MachinePhotoDto_orientationMember1? MachinePhotoDtoOrientationMember1 { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.MachinePhotoDto_orientationMember1 MachinePhotoDtoOrientationMember1 { get; set; } -#endif - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.Orientation? Orientation { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.Orientation Orientation { get; set; } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_orientation CreateFromDiscriminatorValue(IParseNode parseNode) - { - if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode)); - var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); - var result = new global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_orientation(); - if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.MachinePhotoDtoOrientationMember1 = new global::Marechai.App.Models.MachinePhotoDto_orientationMember1(); - } - else if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.Orientation = new global::Marechai.App.Models.Orientation(); - } - return result; - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - if(MachinePhotoDtoOrientationMember1 != null) - { - return MachinePhotoDtoOrientationMember1.GetFieldDeserializers(); - } - else if(Orientation != null) - { - return Orientation.GetFieldDeserializers(); - } - return new Dictionary>(); - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer)); - if(MachinePhotoDtoOrientationMember1 != null) - { - writer.WriteObjectValue(null, MachinePhotoDtoOrientationMember1); - } - else if(Orientation != null) - { - writer.WriteObjectValue(null, Orientation); - } - } - } - /// - /// Composed type wrapper for classes , - /// - [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] - public partial class MachinePhotoDto_resolution_unit : IComposedTypeWrapper, IParsable - { - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.MachinePhotoDto_resolution_unitMember1? MachinePhotoDtoResolutionUnitMember1 { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.MachinePhotoDto_resolution_unitMember1 MachinePhotoDtoResolutionUnitMember1 { get; set; } -#endif - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.ResolutionUnit? ResolutionUnit { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.ResolutionUnit ResolutionUnit { get; set; } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_resolution_unit CreateFromDiscriminatorValue(IParseNode parseNode) - { - if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode)); - var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); - var result = new global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_resolution_unit(); - if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.MachinePhotoDtoResolutionUnitMember1 = new global::Marechai.App.Models.MachinePhotoDto_resolution_unitMember1(); - } - else if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.ResolutionUnit = new global::Marechai.App.Models.ResolutionUnit(); - } - return result; - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - if(MachinePhotoDtoResolutionUnitMember1 != null) - { - return MachinePhotoDtoResolutionUnitMember1.GetFieldDeserializers(); - } - else if(ResolutionUnit != null) - { - return ResolutionUnit.GetFieldDeserializers(); - } - return new Dictionary>(); - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer)); - if(MachinePhotoDtoResolutionUnitMember1 != null) - { - writer.WriteObjectValue(null, MachinePhotoDtoResolutionUnitMember1); - } - else if(ResolutionUnit != null) - { - writer.WriteObjectValue(null, ResolutionUnit); - } - } - } - /// - /// Composed type wrapper for classes , - /// - [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] - public partial class MachinePhotoDto_saturation : IComposedTypeWrapper, IParsable - { - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.MachinePhotoDto_saturationMember1? MachinePhotoDtoSaturationMember1 { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.MachinePhotoDto_saturationMember1 MachinePhotoDtoSaturationMember1 { get; set; } -#endif - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.Saturation? Saturation { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.Saturation Saturation { get; set; } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_saturation CreateFromDiscriminatorValue(IParseNode parseNode) - { - if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode)); - var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); - var result = new global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_saturation(); - if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.MachinePhotoDtoSaturationMember1 = new global::Marechai.App.Models.MachinePhotoDto_saturationMember1(); - } - else if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.Saturation = new global::Marechai.App.Models.Saturation(); - } - return result; - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - if(MachinePhotoDtoSaturationMember1 != null) - { - return MachinePhotoDtoSaturationMember1.GetFieldDeserializers(); - } - else if(Saturation != null) - { - return Saturation.GetFieldDeserializers(); - } - return new Dictionary>(); - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer)); - if(MachinePhotoDtoSaturationMember1 != null) - { - writer.WriteObjectValue(null, MachinePhotoDtoSaturationMember1); - } - else if(Saturation != null) - { - writer.WriteObjectValue(null, Saturation); - } - } - } - /// - /// Composed type wrapper for classes , - /// - [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] - public partial class MachinePhotoDto_scene_capture_type : IComposedTypeWrapper, IParsable - { - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.MachinePhotoDto_scene_capture_typeMember1? MachinePhotoDtoSceneCaptureTypeMember1 { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.MachinePhotoDto_scene_capture_typeMember1 MachinePhotoDtoSceneCaptureTypeMember1 { get; set; } -#endif - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.SceneCaptureType? SceneCaptureType { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.SceneCaptureType SceneCaptureType { get; set; } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_scene_capture_type CreateFromDiscriminatorValue(IParseNode parseNode) - { - if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode)); - var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); - var result = new global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_scene_capture_type(); - if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.MachinePhotoDtoSceneCaptureTypeMember1 = new global::Marechai.App.Models.MachinePhotoDto_scene_capture_typeMember1(); - } - else if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.SceneCaptureType = new global::Marechai.App.Models.SceneCaptureType(); - } - return result; - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - if(MachinePhotoDtoSceneCaptureTypeMember1 != null) - { - return MachinePhotoDtoSceneCaptureTypeMember1.GetFieldDeserializers(); - } - else if(SceneCaptureType != null) - { - return SceneCaptureType.GetFieldDeserializers(); - } - return new Dictionary>(); - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer)); - if(MachinePhotoDtoSceneCaptureTypeMember1 != null) - { - writer.WriteObjectValue(null, MachinePhotoDtoSceneCaptureTypeMember1); - } - else if(SceneCaptureType != null) - { - writer.WriteObjectValue(null, SceneCaptureType); - } - } - } - /// - /// Composed type wrapper for classes , - /// - [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] - public partial class MachinePhotoDto_sensing_method : IComposedTypeWrapper, IParsable - { - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.MachinePhotoDto_sensing_methodMember1? MachinePhotoDtoSensingMethodMember1 { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.MachinePhotoDto_sensing_methodMember1 MachinePhotoDtoSensingMethodMember1 { get; set; } -#endif - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.SensingMethod? SensingMethod { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.SensingMethod SensingMethod { get; set; } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_sensing_method CreateFromDiscriminatorValue(IParseNode parseNode) - { - if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode)); - var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); - var result = new global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_sensing_method(); - if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.MachinePhotoDtoSensingMethodMember1 = new global::Marechai.App.Models.MachinePhotoDto_sensing_methodMember1(); - } - else if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.SensingMethod = new global::Marechai.App.Models.SensingMethod(); - } - return result; - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - if(MachinePhotoDtoSensingMethodMember1 != null) - { - return MachinePhotoDtoSensingMethodMember1.GetFieldDeserializers(); - } - else if(SensingMethod != null) - { - return SensingMethod.GetFieldDeserializers(); - } - return new Dictionary>(); - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer)); - if(MachinePhotoDtoSensingMethodMember1 != null) - { - writer.WriteObjectValue(null, MachinePhotoDtoSensingMethodMember1); - } - else if(SensingMethod != null) - { - writer.WriteObjectValue(null, SensingMethod); - } - } - } - /// - /// Composed type wrapper for classes , - /// - [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] - public partial class MachinePhotoDto_sharpness : IComposedTypeWrapper, IParsable - { - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.MachinePhotoDto_sharpnessMember1? MachinePhotoDtoSharpnessMember1 { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.MachinePhotoDto_sharpnessMember1 MachinePhotoDtoSharpnessMember1 { get; set; } -#endif - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.Sharpness? Sharpness { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.Sharpness Sharpness { get; set; } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_sharpness CreateFromDiscriminatorValue(IParseNode parseNode) - { - if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode)); - var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); - var result = new global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_sharpness(); - if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.MachinePhotoDtoSharpnessMember1 = new global::Marechai.App.Models.MachinePhotoDto_sharpnessMember1(); - } - else if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.Sharpness = new global::Marechai.App.Models.Sharpness(); - } - return result; - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - if(MachinePhotoDtoSharpnessMember1 != null) - { - return MachinePhotoDtoSharpnessMember1.GetFieldDeserializers(); - } - else if(Sharpness != null) - { - return Sharpness.GetFieldDeserializers(); - } - return new Dictionary>(); - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer)); - if(MachinePhotoDtoSharpnessMember1 != null) - { - writer.WriteObjectValue(null, MachinePhotoDtoSharpnessMember1); - } - else if(Sharpness != null) - { - writer.WriteObjectValue(null, Sharpness); - } - } - } - /// - /// Composed type wrapper for classes , - /// - [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] - public partial class MachinePhotoDto_subject_distance_range : IComposedTypeWrapper, IParsable - { - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.MachinePhotoDto_subject_distance_rangeMember1? MachinePhotoDtoSubjectDistanceRangeMember1 { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.MachinePhotoDto_subject_distance_rangeMember1 MachinePhotoDtoSubjectDistanceRangeMember1 { get; set; } -#endif - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.SubjectDistanceRange? SubjectDistanceRange { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.SubjectDistanceRange SubjectDistanceRange { get; set; } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_subject_distance_range CreateFromDiscriminatorValue(IParseNode parseNode) - { - if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode)); - var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); - var result = new global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_subject_distance_range(); - if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.MachinePhotoDtoSubjectDistanceRangeMember1 = new global::Marechai.App.Models.MachinePhotoDto_subject_distance_rangeMember1(); - } - else if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.SubjectDistanceRange = new global::Marechai.App.Models.SubjectDistanceRange(); - } - return result; - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - if(MachinePhotoDtoSubjectDistanceRangeMember1 != null) - { - return MachinePhotoDtoSubjectDistanceRangeMember1.GetFieldDeserializers(); - } - else if(SubjectDistanceRange != null) - { - return SubjectDistanceRange.GetFieldDeserializers(); - } - return new Dictionary>(); - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer)); - if(MachinePhotoDtoSubjectDistanceRangeMember1 != null) - { - writer.WriteObjectValue(null, MachinePhotoDtoSubjectDistanceRangeMember1); - } - else if(SubjectDistanceRange != null) - { - writer.WriteObjectValue(null, SubjectDistanceRange); - } - } - } - /// - /// Composed type wrapper for classes , - /// - [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] - public partial class MachinePhotoDto_white_balance : IComposedTypeWrapper, IParsable - { - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.MachinePhotoDto_white_balanceMember1? MachinePhotoDtoWhiteBalanceMember1 { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.MachinePhotoDto_white_balanceMember1 MachinePhotoDtoWhiteBalanceMember1 { get; set; } -#endif - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.WhiteBalance? WhiteBalance { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.WhiteBalance WhiteBalance { get; set; } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_white_balance CreateFromDiscriminatorValue(IParseNode parseNode) - { - if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode)); - var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); - var result = new global::Marechai.App.Models.MachinePhotoDto.MachinePhotoDto_white_balance(); - if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.MachinePhotoDtoWhiteBalanceMember1 = new global::Marechai.App.Models.MachinePhotoDto_white_balanceMember1(); - } - else if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.WhiteBalance = new global::Marechai.App.Models.WhiteBalance(); - } - return result; - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - if(MachinePhotoDtoWhiteBalanceMember1 != null) - { - return MachinePhotoDtoWhiteBalanceMember1.GetFieldDeserializers(); - } - else if(WhiteBalance != null) - { - return WhiteBalance.GetFieldDeserializers(); - } - return new Dictionary>(); - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer)); - if(MachinePhotoDtoWhiteBalanceMember1 != null) - { - writer.WriteObjectValue(null, MachinePhotoDtoWhiteBalanceMember1); - } - else if(WhiteBalance != null) - { - writer.WriteObjectValue(null, WhiteBalance); - } - } - } } } #pragma warning restore CS0618 diff --git a/Marechai.App/Services/Client/Models/MagazineScanDto.cs b/Marechai.App/Services/Client/Models/MagazineScanDto.cs index 20ba6fb4..90985943 100644 --- a/Marechai.App/Services/Client/Models/MagazineScanDto.cs +++ b/Marechai.App/Services/Client/Models/MagazineScanDto.cs @@ -23,13 +23,7 @@ namespace Marechai.App.Models public string Author { get; set; } #endif /// The colorspace property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.MagazineScanDto.MagazineScanDto_colorspace? Colorspace { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.MagazineScanDto.MagazineScanDto_colorspace Colorspace { get; set; } -#endif + public int? Colorspace { get; set; } /// The comments property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable @@ -73,13 +67,7 @@ namespace Marechai.App.Models /// The page property public int? Page { get; set; } /// The resolution_unit property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.MagazineScanDto.MagazineScanDto_resolution_unit? ResolutionUnit { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.MagazineScanDto.MagazineScanDto_resolution_unit ResolutionUnit { get; set; } -#endif + public int? ResolutionUnit { get; set; } /// The scanner_manufacturer property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable @@ -144,7 +132,7 @@ namespace Marechai.App.Models return new Dictionary> { { "author", n => { Author = n.GetStringValue(); } }, - { "colorspace", n => { Colorspace = n.GetObjectValue(global::Marechai.App.Models.MagazineScanDto.MagazineScanDto_colorspace.CreateFromDiscriminatorValue); } }, + { "colorspace", n => { Colorspace = n.GetIntValue(); } }, { "comments", n => { Comments = n.GetStringValue(); } }, { "creation_date", n => { CreationDate = n.GetDateTimeOffsetValue(); } }, { "exif_version", n => { ExifVersion = n.GetStringValue(); } }, @@ -154,7 +142,7 @@ namespace Marechai.App.Models { "magazine_id", n => { MagazineId = n.GetLongValue(); } }, { "original_extension", n => { OriginalExtension = n.GetStringValue(); } }, { "page", n => { Page = n.GetIntValue(); } }, - { "resolution_unit", n => { ResolutionUnit = n.GetObjectValue(global::Marechai.App.Models.MagazineScanDto.MagazineScanDto_resolution_unit.CreateFromDiscriminatorValue); } }, + { "resolution_unit", n => { ResolutionUnit = n.GetIntValue(); } }, { "scanner_manufacturer", n => { ScannerManufacturer = n.GetStringValue(); } }, { "scanner_model", n => { ScannerModel = n.GetStringValue(); } }, { "software", n => { Software = n.GetStringValue(); } }, @@ -172,7 +160,7 @@ namespace Marechai.App.Models { if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer)); writer.WriteStringValue("author", Author); - writer.WriteObjectValue("colorspace", Colorspace); + writer.WriteIntValue("colorspace", Colorspace); writer.WriteStringValue("comments", Comments); writer.WriteDateTimeOffsetValue("creation_date", CreationDate); writer.WriteStringValue("exif_version", ExifVersion); @@ -182,7 +170,7 @@ namespace Marechai.App.Models writer.WriteLongValue("magazine_id", MagazineId); writer.WriteStringValue("original_extension", OriginalExtension); writer.WriteIntValue("page", Page); - writer.WriteObjectValue("resolution_unit", ResolutionUnit); + writer.WriteIntValue("resolution_unit", ResolutionUnit); writer.WriteStringValue("scanner_manufacturer", ScannerManufacturer); writer.WriteStringValue("scanner_model", ScannerModel); writer.WriteStringValue("software", Software); @@ -192,156 +180,6 @@ namespace Marechai.App.Models writer.WriteDoubleValue("vertical_resolution", VerticalResolution); writer.WriteAdditionalData(AdditionalData); } - /// - /// Composed type wrapper for classes , - /// - [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] - public partial class MagazineScanDto_colorspace : IComposedTypeWrapper, IParsable - { - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.ColorSpace? ColorSpace { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.ColorSpace ColorSpace { get; set; } -#endif - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.MagazineScanDto_colorspaceMember1? MagazineScanDtoColorspaceMember1 { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.MagazineScanDto_colorspaceMember1 MagazineScanDtoColorspaceMember1 { get; set; } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static global::Marechai.App.Models.MagazineScanDto.MagazineScanDto_colorspace CreateFromDiscriminatorValue(IParseNode parseNode) - { - if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode)); - var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); - var result = new global::Marechai.App.Models.MagazineScanDto.MagazineScanDto_colorspace(); - if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.ColorSpace = new global::Marechai.App.Models.ColorSpace(); - } - else if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.MagazineScanDtoColorspaceMember1 = new global::Marechai.App.Models.MagazineScanDto_colorspaceMember1(); - } - return result; - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - if(ColorSpace != null) - { - return ColorSpace.GetFieldDeserializers(); - } - else if(MagazineScanDtoColorspaceMember1 != null) - { - return MagazineScanDtoColorspaceMember1.GetFieldDeserializers(); - } - return new Dictionary>(); - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer)); - if(ColorSpace != null) - { - writer.WriteObjectValue(null, ColorSpace); - } - else if(MagazineScanDtoColorspaceMember1 != null) - { - writer.WriteObjectValue(null, MagazineScanDtoColorspaceMember1); - } - } - } - /// - /// Composed type wrapper for classes , - /// - [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] - public partial class MagazineScanDto_resolution_unit : IComposedTypeWrapper, IParsable - { - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.MagazineScanDto_resolution_unitMember1? MagazineScanDtoResolutionUnitMember1 { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.MagazineScanDto_resolution_unitMember1 MagazineScanDtoResolutionUnitMember1 { get; set; } -#endif - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.ResolutionUnit? ResolutionUnit { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.ResolutionUnit ResolutionUnit { get; set; } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static global::Marechai.App.Models.MagazineScanDto.MagazineScanDto_resolution_unit CreateFromDiscriminatorValue(IParseNode parseNode) - { - if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode)); - var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); - var result = new global::Marechai.App.Models.MagazineScanDto.MagazineScanDto_resolution_unit(); - if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.MagazineScanDtoResolutionUnitMember1 = new global::Marechai.App.Models.MagazineScanDto_resolution_unitMember1(); - } - else if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.ResolutionUnit = new global::Marechai.App.Models.ResolutionUnit(); - } - return result; - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - if(MagazineScanDtoResolutionUnitMember1 != null) - { - return MagazineScanDtoResolutionUnitMember1.GetFieldDeserializers(); - } - else if(ResolutionUnit != null) - { - return ResolutionUnit.GetFieldDeserializers(); - } - return new Dictionary>(); - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer)); - if(MagazineScanDtoResolutionUnitMember1 != null) - { - writer.WriteObjectValue(null, MagazineScanDtoResolutionUnitMember1); - } - else if(ResolutionUnit != null) - { - writer.WriteObjectValue(null, ResolutionUnit); - } - } - } } } #pragma warning restore CS0618 diff --git a/Marechai.App/Services/Client/Models/MediaDto.cs b/Marechai.App/Services/Client/Models/MediaDto.cs index 71bf3ee3..15726c9f 100644 --- a/Marechai.App/Services/Client/Models/MediaDto.cs +++ b/Marechai.App/Services/Client/Models/MediaDto.cs @@ -115,13 +115,7 @@ namespace Marechai.App.Models /// The size property public int? Size { get; set; } /// The storage_interface property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.MediaDto.MediaDto_storage_interface? StorageInterface { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.MediaDto.MediaDto_storage_interface StorageInterface { get; set; } -#endif + public int? StorageInterface { get; set; } /// The table_of_contents property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable @@ -189,7 +183,7 @@ namespace Marechai.App.Models { "sessions", n => { Sessions = n.GetIntValue(); } }, { "sides", n => { Sides = n.GetIntValue(); } }, { "size", n => { Size = n.GetIntValue(); } }, - { "storage_interface", n => { StorageInterface = n.GetObjectValue(global::Marechai.App.Models.MediaDto.MediaDto_storage_interface.CreateFromDiscriminatorValue); } }, + { "storage_interface", n => { StorageInterface = n.GetIntValue(); } }, { "table_of_contents", n => { TableOfContents = n.GetCollectionOfObjectValues(global::Marechai.App.Models.OpticalDiscTrack.CreateFromDiscriminatorValue)?.AsList(); } }, { "title", n => { Title = n.GetStringValue(); } }, { "tracks", n => { Tracks = n.GetIntValue(); } }, @@ -224,7 +218,7 @@ namespace Marechai.App.Models writer.WriteIntValue("sessions", Sessions); writer.WriteIntValue("sides", Sides); writer.WriteIntValue("size", Size); - writer.WriteObjectValue("storage_interface", StorageInterface); + writer.WriteIntValue("storage_interface", StorageInterface); writer.WriteCollectionOfObjectValues("table_of_contents", TableOfContents); writer.WriteStringValue("title", Title); writer.WriteIntValue("tracks", Tracks); @@ -232,81 +226,6 @@ namespace Marechai.App.Models writer.WriteIntValue("write_offset", WriteOffset); writer.WriteAdditionalData(AdditionalData); } - /// - /// Composed type wrapper for classes , - /// - [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] - public partial class MediaDto_storage_interface : IComposedTypeWrapper, IParsable - { - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.MediaDto_storage_interfaceMember1? MediaDtoStorageInterfaceMember1 { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.MediaDto_storage_interfaceMember1 MediaDtoStorageInterfaceMember1 { get; set; } -#endif - /// Composed type representation for type -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public global::Marechai.App.Models.StorageInterface? StorageInterface { get; set; } -#nullable restore -#else - public global::Marechai.App.Models.StorageInterface StorageInterface { get; set; } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static global::Marechai.App.Models.MediaDto.MediaDto_storage_interface CreateFromDiscriminatorValue(IParseNode parseNode) - { - if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode)); - var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); - var result = new global::Marechai.App.Models.MediaDto.MediaDto_storage_interface(); - if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.MediaDtoStorageInterfaceMember1 = new global::Marechai.App.Models.MediaDto_storage_interfaceMember1(); - } - else if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) - { - result.StorageInterface = new global::Marechai.App.Models.StorageInterface(); - } - return result; - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - if(MediaDtoStorageInterfaceMember1 != null) - { - return MediaDtoStorageInterfaceMember1.GetFieldDeserializers(); - } - else if(StorageInterface != null) - { - return StorageInterface.GetFieldDeserializers(); - } - return new Dictionary>(); - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer)); - if(MediaDtoStorageInterfaceMember1 != null) - { - writer.WriteObjectValue(null, MediaDtoStorageInterfaceMember1); - } - else if(StorageInterface != null) - { - writer.WriteObjectValue(null, StorageInterface); - } - } - } } } #pragma warning restore CS0618 diff --git a/Marechai.App/Services/Client/kiota-lock.json b/Marechai.App/Services/Client/kiota-lock.json index 0e94fcfa..747c445a 100644 --- a/Marechai.App/Services/Client/kiota-lock.json +++ b/Marechai.App/Services/Client/kiota-lock.json @@ -1,5 +1,5 @@ { - "descriptionHash": "39D2BFA791223984F51F46A2A8EE34B01E19F393B14843E7AFDBAC674AA8AC7F97802ADCF8FFD9B23B0659CDE3B5B690F22FA1E2FC91DABFF4F240B60E17A574", + "descriptionHash": "ABDC74AB94257D5ED6BFBA4E57134BD2B3A4A2C3EC8EC2A514A70334900294CA4391DB5F7404A6055B8B63D0392BB28073F071E07F310F4E650779D5805ACBFF", "descriptionLocation": "http://localhost:5023/openapi/v1.json", "lockFileVersion": "1.0.0", "kiotaVersion": "1.29.0", diff --git a/Marechai.Data/Dtos/BasePhotoDto.cs b/Marechai.Data/Dtos/BasePhotoDto.cs index cf93c3e7..e714eb6e 100644 --- a/Marechai.Data/Dtos/BasePhotoDto.cs +++ b/Marechai.Data/Dtos/BasePhotoDto.cs @@ -38,11 +38,11 @@ public class BasePhotoDto : BaseDto [JsonPropertyName("camera_model")] public string? CameraModel { get; set; } [JsonPropertyName("colorspace")] - public ColorSpace? ColorSpace { get; set; } + public ushort? ColorSpace { get; set; } [JsonPropertyName("comments")] public string? Comments { get; set; } [JsonPropertyName("contrast")] - public Contrast? Contrast { get; set; } + public ushort? Contrast { get; set; } [JsonPropertyName("creation_date")] public DateTime? CreationDate { get; set; } [JsonPropertyName("digital_zoom")] @@ -52,11 +52,11 @@ public class BasePhotoDto : BaseDto [JsonPropertyName("exposure")] public double? ExposureTime { get; set; } [JsonPropertyName("exposure_method")] - public ExposureMode? ExposureMethod { get; set; } + public ushort? ExposureMethod { get; set; } [JsonPropertyName("exposure_program")] - public ExposureProgram? ExposureProgram { get; set; } + public ushort? ExposureProgram { get; set; } [JsonPropertyName("flash")] - public Flash? Flash { get; set; } + public ushort? Flash { get; set; } [JsonPropertyName("focal")] public double? Focal { get; set; } [JsonPropertyName("focal_length")] @@ -70,31 +70,31 @@ public class BasePhotoDto : BaseDto [JsonPropertyName("lens")] public string? Lens { get; set; } [JsonPropertyName("light_source")] - public LightSource? LightSource { get; set; } + public ushort? LightSource { get; set; } [JsonPropertyName("metering_mode")] - public MeteringMode? MeteringMode { get; set; } + public ushort? MeteringMode { get; set; } [JsonPropertyName("resolution_unit")] - public ResolutionUnit? ResolutionUnit { get; set; } + public ushort? ResolutionUnit { get; set; } [JsonPropertyName("orientation")] - public Orientation? Orientation { get; set; } + public ushort? Orientation { get; set; } [JsonPropertyName("saturation")] - public Saturation? Saturation { get; set; } + public ushort? Saturation { get; set; } [JsonPropertyName("scene_capture_type")] - public SceneCaptureType? SceneCaptureType { get; set; } + public ushort? SceneCaptureType { get; set; } [JsonPropertyName("sensing_method")] - public SensingMethod? SensingMethod { get; set; } + public ushort? SensingMethod { get; set; } [JsonPropertyName("sharpness")] - public Sharpness? Sharpness { get; set; } + public ushort? Sharpness { get; set; } [JsonPropertyName("software")] public string? SoftwareUsed { get; set; } [JsonPropertyName("subject_distance_range")] - public SubjectDistanceRange? SubjectDistanceRange { get; set; } + public byte? SubjectDistanceRange { get; set; } [JsonPropertyName("upload_date")] public DateTime UploadDate { get; set; } [JsonPropertyName("vertical_resolution")] public double? VerticalResolution { get; set; } [JsonPropertyName("white_balance")] - public WhiteBalance? WhiteBalance { get; set; } + public ushort? WhiteBalance { get; set; } [JsonPropertyName("user_id")] public string? UserId { get; set; } [JsonPropertyName("license_name")] diff --git a/Marechai.Data/Dtos/BaseScanDto.cs b/Marechai.Data/Dtos/BaseScanDto.cs index 08138761..0734a93d 100644 --- a/Marechai.Data/Dtos/BaseScanDto.cs +++ b/Marechai.Data/Dtos/BaseScanDto.cs @@ -32,7 +32,7 @@ public class BaseScanDto : BaseDto [JsonPropertyName("author")] public string? Author { get; set; } [JsonPropertyName("colorspace")] - public ColorSpace? ColorSpace { get; set; } + public ushort? ColorSpace { get; set; } [JsonPropertyName("comments")] public string? Comments { get; set; } [JsonPropertyName("creation_date")] @@ -42,7 +42,7 @@ public class BaseScanDto : BaseDto [JsonPropertyName("horizontal_resolution")] public double? HorizontalResolution { get; set; } [JsonPropertyName("resolution_unit")] - public ResolutionUnit? ResolutionUnit { get; set; } + public ushort? ResolutionUnit { get; set; } [JsonPropertyName("scanner_manufacturer")] public string? ScannerManufacturer { get; set; } [JsonPropertyName("scanner_model")] diff --git a/Marechai.Data/Dtos/MediaDto.cs b/Marechai.Data/Dtos/MediaDto.cs index bc4f1af9..6a362ebb 100644 --- a/Marechai.Data/Dtos/MediaDto.cs +++ b/Marechai.Data/Dtos/MediaDto.cs @@ -80,7 +80,7 @@ public class MediaDto : BaseDto [JsonPropertyName("block_sizes")] public VariableBlockSize[]? BlockSizes { get; set; } [JsonPropertyName("storage_interface")] - public StorageInterface? StorageInterface { get; set; } + public ushort? StorageInterface { get; set; } [JsonPropertyName("table_of_contents")] public OpticalDiscTrack[]? TableOfContents { get; set; } } \ No newline at end of file diff --git a/Marechai.Server/Controllers/BookScansController.cs b/Marechai.Server/Controllers/BookScansController.cs index 96b5e708..8539dc96 100644 --- a/Marechai.Server/Controllers/BookScansController.cs +++ b/Marechai.Server/Controllers/BookScansController.cs @@ -28,6 +28,7 @@ using System.Collections.Generic; using System.Linq; using System.Security.Claims; using System.Threading.Tasks; +using Marechai.Data; using Marechai.Data.Dtos; using Marechai.Database.Models; using Microsoft.AspNetCore.Authorization; @@ -57,13 +58,13 @@ public class BookScansController(MarechaiContext context) : ControllerBase { Author = p.Author, BookId = p.Book.Id, - ColorSpace = p.ColorSpace, + ColorSpace = (ushort?)p.ColorSpace, Comments = p.Comments, CreationDate = p.CreationDate, ExifVersion = p.ExifVersion, HorizontalResolution = p.HorizontalResolution, Id = p.Id, - ResolutionUnit = p.ResolutionUnit, + ResolutionUnit = (ushort?)p.ResolutionUnit, Page = p.Page, ScannerManufacturer = p.ScannerManufacturer, ScannerModel = p.ScannerModel, @@ -93,12 +94,12 @@ public class BookScansController(MarechaiContext context) : ControllerBase if(model is null) return NotFound(); model.Author = dto.Author; - model.ColorSpace = dto.ColorSpace; + model.ColorSpace = dto.ColorSpace.HasValue ? (ColorSpace)dto.ColorSpace.Value : null; model.Comments = dto.Comments; model.CreationDate = dto.CreationDate; model.ExifVersion = dto.ExifVersion; model.HorizontalResolution = dto.HorizontalResolution; - model.ResolutionUnit = dto.ResolutionUnit; + model.ResolutionUnit = dto.ResolutionUnit.HasValue ? (ResolutionUnit)dto.ResolutionUnit.Value : null; model.Page = dto.Page; model.ScannerManufacturer = dto.ScannerManufacturer; model.ScannerModel = dto.ScannerModel; @@ -126,13 +127,13 @@ public class BookScansController(MarechaiContext context) : ControllerBase { Author = dto.Author, BookId = dto.BookId, - ColorSpace = dto.ColorSpace, + ColorSpace = dto.ColorSpace.HasValue ? (ColorSpace)dto.ColorSpace.Value : null, Comments = dto.Comments, CreationDate = dto.CreationDate, ExifVersion = dto.ExifVersion, HorizontalResolution = dto.HorizontalResolution, Id = dto.Id, - ResolutionUnit = dto.ResolutionUnit, + ResolutionUnit = dto.ResolutionUnit.HasValue ? (ResolutionUnit)dto.ResolutionUnit.Value : null, Page = dto.Page, ScannerManufacturer = dto.ScannerManufacturer, ScannerModel = dto.ScannerModel, diff --git a/Marechai.Server/Controllers/DocumentScansController.cs b/Marechai.Server/Controllers/DocumentScansController.cs index fb8d3551..e6129fdc 100644 --- a/Marechai.Server/Controllers/DocumentScansController.cs +++ b/Marechai.Server/Controllers/DocumentScansController.cs @@ -28,6 +28,7 @@ using System.Collections.Generic; using System.Linq; using System.Security.Claims; using System.Threading.Tasks; +using Marechai.Data; using Marechai.Data.Dtos; using Marechai.Database.Models; using Microsoft.AspNetCore.Authorization; @@ -59,13 +60,13 @@ public class DocumentScansController(MarechaiContext context) : ControllerBase { Author = p.Author, DocumentId = p.Document.Id, - ColorSpace = p.ColorSpace, + ColorSpace = (ushort?)p.ColorSpace, Comments = p.Comments, CreationDate = p.CreationDate, ExifVersion = p.ExifVersion, HorizontalResolution = p.HorizontalResolution, Id = p.Id, - ResolutionUnit = p.ResolutionUnit, + ResolutionUnit = (ushort?)p.ResolutionUnit, Page = p.Page, ScannerManufacturer = p.ScannerManufacturer, ScannerModel = p.ScannerModel, @@ -94,12 +95,12 @@ public class DocumentScansController(MarechaiContext context) : ControllerBase if(model is null) return NotFound(); model.Author = dto.Author; - model.ColorSpace = dto.ColorSpace; + model.ColorSpace = dto.ColorSpace.HasValue ? (ColorSpace)dto.ColorSpace.Value : null; model.Comments = dto.Comments; model.CreationDate = dto.CreationDate; model.ExifVersion = dto.ExifVersion; model.HorizontalResolution = dto.HorizontalResolution; - model.ResolutionUnit = dto.ResolutionUnit; + model.ResolutionUnit = dto.ResolutionUnit.HasValue ? (ResolutionUnit)dto.ResolutionUnit.Value : null; model.Page = dto.Page; model.ScannerManufacturer = dto.ScannerManufacturer; model.ScannerModel = dto.ScannerModel; @@ -127,13 +128,13 @@ public class DocumentScansController(MarechaiContext context) : ControllerBase { Author = dto.Author, DocumentId = dto.DocumentId, - ColorSpace = dto.ColorSpace, + ColorSpace = dto.ColorSpace.HasValue ? (ColorSpace)dto.ColorSpace.Value : null, Comments = dto.Comments, CreationDate = dto.CreationDate, ExifVersion = dto.ExifVersion, HorizontalResolution = dto.HorizontalResolution, Id = dto.Id, - ResolutionUnit = dto.ResolutionUnit, + ResolutionUnit = dto.ResolutionUnit.HasValue ? (ResolutionUnit)dto.ResolutionUnit.Value : null, Page = dto.Page, ScannerManufacturer = dto.ScannerManufacturer, ScannerModel = dto.ScannerModel, diff --git a/Marechai.Server/Controllers/MachinePhotosController.cs b/Marechai.Server/Controllers/MachinePhotosController.cs index 5e0fb660..6a517adc 100644 --- a/Marechai.Server/Controllers/MachinePhotosController.cs +++ b/Marechai.Server/Controllers/MachinePhotosController.cs @@ -28,6 +28,7 @@ using System.Collections.Generic; using System.Linq; using System.Security.Claims; using System.Threading.Tasks; +using Marechai.Data; using Marechai.Data.Dtos; using Marechai.Database.Models; using Microsoft.AspNetCore.Authorization; @@ -61,16 +62,16 @@ public class MachinePhotosController(MarechaiContext context) : ControllerBase Author = p.Author, CameraManufacturer = p.CameraManufacturer, CameraModel = p.CameraModel, - ColorSpace = p.ColorSpace, + ColorSpace = (ushort?)p.ColorSpace, Comments = p.Comments, - Contrast = p.Contrast, + Contrast = (ushort?)p.Contrast, CreationDate = p.CreationDate, DigitalZoomRatio = p.DigitalZoomRatio, ExifVersion = p.ExifVersion, ExposureTime = p.ExposureTime, - ExposureMethod = p.ExposureMethod, - ExposureProgram = p.ExposureProgram, - Flash = p.Flash, + ExposureMethod = (ushort?)p.ExposureMethod, + ExposureProgram = (ushort?)p.ExposureProgram, + Flash = (ushort?)p.Flash, Focal = p.Focal, FocalLength = p.FocalLength, FocalLengthEquivalent = p.FocalLengthEquivalent, @@ -80,25 +81,27 @@ public class MachinePhotosController(MarechaiContext context) : ControllerBase Lens = p.Lens, LicenseId = p.LicenseId, LicenseName = p.License.Name, - LightSource = p.LightSource, - MachineCompanyName = p.Machine.Company.Name, - MachineId = p.MachineId, - MachineName = p.Machine.Name, - MeteringMode = p.MeteringMode, - ResolutionUnit = p.ResolutionUnit, - Orientation = p.Orientation, - Saturation = p.Saturation, - SceneCaptureType = p.SceneCaptureType, - SensingMethod = p.SensingMethod, - Sharpness = p.Sharpness, - SoftwareUsed = p.SoftwareUsed, - Source = p.Source, - SubjectDistanceRange = p.SubjectDistanceRange, - UploadDate = p.UploadDate, - UserId = p.UserId, - VerticalResolution = p.VerticalResolution, - WhiteBalance = p.WhiteBalance, - OriginalExtension = p.OriginalExtension + LightSource = p.LightSource.HasValue + ? (ushort?)p.LightSource + : null, + MachineCompanyName = p.Machine.Company.Name, + MachineId = p.MachineId, + MachineName = p.Machine.Name, + MeteringMode = (ushort?)p.MeteringMode, + ResolutionUnit = (ushort?)p.ResolutionUnit, + Orientation = (ushort?)p.Orientation, + Saturation = (ushort?)p.Saturation, + SceneCaptureType = (ushort?)p.SceneCaptureType, + SensingMethod = (ushort?)p.SensingMethod, + Sharpness = (ushort?)p.Sharpness, + SoftwareUsed = p.SoftwareUsed, + Source = p.Source, + SubjectDistanceRange = (byte?)p.SubjectDistanceRange, + UploadDate = p.UploadDate, + UserId = p.UserId, + VerticalResolution = p.VerticalResolution, + WhiteBalance = (ushort?)p.WhiteBalance, + OriginalExtension = p.OriginalExtension }) .FirstOrDefaultAsync(); @@ -117,40 +120,44 @@ public class MachinePhotosController(MarechaiContext context) : ControllerBase if(model is null) return NotFound(); - model.Aperture = dto.Aperture; - model.Author = dto.Author; - model.CameraManufacturer = dto.CameraManufacturer; - model.CameraModel = dto.CameraModel; - model.ColorSpace = dto.ColorSpace; - model.Comments = dto.Comments; - model.Contrast = dto.Contrast; - model.CreationDate = dto.CreationDate; - model.DigitalZoomRatio = dto.DigitalZoomRatio; - model.ExifVersion = dto.ExifVersion; - model.ExposureTime = dto.ExposureTime; - model.ExposureMethod = dto.ExposureMethod; - model.ExposureProgram = dto.ExposureProgram; - model.Flash = dto.Flash; - model.Focal = dto.Focal; - model.FocalLength = dto.FocalLength; + model.Aperture = dto.Aperture; + model.Author = dto.Author; + model.CameraManufacturer = dto.CameraManufacturer; + model.CameraModel = dto.CameraModel; + model.ColorSpace = dto.ColorSpace.HasValue ? (ColorSpace)dto.ColorSpace.Value : null; + model.Comments = dto.Comments; + model.Contrast = dto.Contrast.HasValue ? (Contrast)dto.Contrast.Value : null; + model.CreationDate = dto.CreationDate; + model.DigitalZoomRatio = dto.DigitalZoomRatio; + model.ExifVersion = dto.ExifVersion; + model.ExposureTime = dto.ExposureTime; + model.ExposureMethod = dto.ExposureMethod.HasValue ? (ExposureMode)dto.ExposureMethod.Value : null; + model.ExposureProgram = dto.ExposureProgram.HasValue ? (ExposureProgram)dto.ExposureProgram.Value : null; + model.Flash = dto.Flash.HasValue ? (Flash)dto.Flash.Value : null; + model.Focal = dto.Focal; + model.FocalLength = dto.FocalLength; model.FocalLengthEquivalent = dto.FocalLengthEquivalent; - model.HorizontalResolution = dto.HorizontalResolution; - model.IsoRating = dto.IsoRating; - model.Lens = dto.Lens; - model.LicenseId = dto.LicenseId; - model.LightSource = dto.LightSource; - model.MeteringMode = dto.MeteringMode; - model.ResolutionUnit = dto.ResolutionUnit; - model.Orientation = dto.Orientation; - model.Saturation = dto.Saturation; - model.SceneCaptureType = dto.SceneCaptureType; - model.SensingMethod = dto.SensingMethod; - model.Sharpness = dto.Sharpness; - model.SoftwareUsed = dto.SoftwareUsed; - model.Source = dto.Source; - model.SubjectDistanceRange = dto.SubjectDistanceRange; - model.VerticalResolution = dto.VerticalResolution; - model.WhiteBalance = dto.WhiteBalance; + model.HorizontalResolution = dto.HorizontalResolution; + model.IsoRating = dto.IsoRating; + model.Lens = dto.Lens; + model.LicenseId = dto.LicenseId; + model.LightSource = dto.LightSource.HasValue ? (LightSource?)dto.LightSource : null; + model.MeteringMode = dto.MeteringMode.HasValue ? (MeteringMode)dto.MeteringMode.Value : null; + model.ResolutionUnit = dto.ResolutionUnit.HasValue ? (ResolutionUnit)dto.ResolutionUnit.Value : null; + model.Orientation = dto.Orientation.HasValue ? (Orientation)dto.Orientation.Value : null; + model.Saturation = dto.Saturation.HasValue ? (Saturation)dto.Saturation.Value : null; + model.SceneCaptureType = dto.SceneCaptureType.HasValue ? (SceneCaptureType)dto.SceneCaptureType.Value : null; + model.SensingMethod = dto.SensingMethod.HasValue ? (SensingMethod)dto.SensingMethod.Value : null; + model.Sharpness = dto.Sharpness.HasValue ? (Sharpness)dto.Sharpness.Value : null; + model.SoftwareUsed = dto.SoftwareUsed; + model.Source = dto.Source; + + model.SubjectDistanceRange = dto.SubjectDistanceRange.HasValue + ? (SubjectDistanceRange)dto.SubjectDistanceRange.Value + : null; + + model.VerticalResolution = dto.VerticalResolution; + model.WhiteBalance = dto.WhiteBalance.HasValue ? (WhiteBalance)dto.WhiteBalance.Value : null; await context.SaveChangesWithUserAsync(userId); @@ -174,16 +181,16 @@ public class MachinePhotosController(MarechaiContext context) : ControllerBase Author = dto.Author, CameraManufacturer = dto.CameraManufacturer, CameraModel = dto.CameraModel, - ColorSpace = dto.ColorSpace, + ColorSpace = dto.ColorSpace.HasValue ? (ColorSpace)dto.ColorSpace.Value : null, Comments = dto.Comments, - Contrast = dto.Contrast, + Contrast = dto.Contrast.HasValue ? (Contrast)dto.Contrast.Value : null, CreationDate = dto.CreationDate, DigitalZoomRatio = dto.DigitalZoomRatio, ExifVersion = dto.ExifVersion, ExposureTime = dto.ExposureTime, - ExposureMethod = dto.ExposureMethod, - ExposureProgram = dto.ExposureProgram, - Flash = dto.Flash, + ExposureMethod = dto.ExposureMethod.HasValue ? (ExposureMode)dto.ExposureMethod.Value : null, + ExposureProgram = dto.ExposureProgram.HasValue ? (ExposureProgram)dto.ExposureProgram.Value : null, + Flash = dto.Flash.HasValue ? (Flash)dto.Flash.Value : null, Focal = dto.Focal, FocalLength = dto.FocalLength, FocalLengthEquivalent = dto.FocalLengthEquivalent, @@ -192,23 +199,24 @@ public class MachinePhotosController(MarechaiContext context) : ControllerBase IsoRating = dto.IsoRating, Lens = dto.Lens, LicenseId = dto.LicenseId, - LightSource = dto.LightSource, + LightSource = dto.LightSource.HasValue ? (LightSource?)dto.LightSource : null, MachineId = dto.MachineId, - MeteringMode = dto.MeteringMode, - ResolutionUnit = dto.ResolutionUnit, - Orientation = dto.Orientation, - Saturation = dto.Saturation, - SceneCaptureType = dto.SceneCaptureType, - SensingMethod = dto.SensingMethod, - Sharpness = dto.Sharpness, + MeteringMode = dto.MeteringMode.HasValue ? (MeteringMode)dto.MeteringMode.Value : null, + ResolutionUnit = dto.ResolutionUnit.HasValue ? (ResolutionUnit)dto.ResolutionUnit.Value : null, + Orientation = dto.Orientation.HasValue ? (Orientation)dto.Orientation.Value : null, + Saturation = dto.Saturation.HasValue ? (Saturation)dto.Saturation.Value : null, + SceneCaptureType = dto.SceneCaptureType.HasValue ? (SceneCaptureType)dto.SceneCaptureType.Value : null, + SensingMethod = dto.SensingMethod.HasValue ? (SensingMethod)dto.SensingMethod.Value : null, + Sharpness = dto.Sharpness.HasValue ? (Sharpness)dto.Sharpness.Value : null, SoftwareUsed = dto.SoftwareUsed, Source = dto.Source, - SubjectDistanceRange = dto.SubjectDistanceRange, - UploadDate = dto.UploadDate, - UserId = dto.UserId, - VerticalResolution = dto.VerticalResolution, - WhiteBalance = dto.WhiteBalance, - OriginalExtension = dto.OriginalExtension + SubjectDistanceRange = + dto.SubjectDistanceRange.HasValue ? (SubjectDistanceRange)dto.SubjectDistanceRange.Value : null, + UploadDate = dto.UploadDate, + UserId = dto.UserId, + VerticalResolution = dto.VerticalResolution, + WhiteBalance = dto.WhiteBalance.HasValue ? (WhiteBalance)dto.WhiteBalance.Value : null, + OriginalExtension = dto.OriginalExtension }; await context.MachinePhotos.AddAsync(model); diff --git a/Marechai.Server/Controllers/MagazineScansController.cs b/Marechai.Server/Controllers/MagazineScansController.cs index 7618a242..cf3d40dc 100644 --- a/Marechai.Server/Controllers/MagazineScansController.cs +++ b/Marechai.Server/Controllers/MagazineScansController.cs @@ -28,6 +28,7 @@ using System.Collections.Generic; using System.Linq; using System.Security.Claims; using System.Threading.Tasks; +using Marechai.Data; using Marechai.Data.Dtos; using Marechai.Database.Models; using Microsoft.AspNetCore.Authorization; @@ -59,13 +60,13 @@ public class MagazineScansController(MarechaiContext context) : ControllerBase { Author = p.Author, MagazineId = p.Magazine.Id, - ColorSpace = p.ColorSpace, + ColorSpace = (ushort?)p.ColorSpace, Comments = p.Comments, CreationDate = p.CreationDate, ExifVersion = p.ExifVersion, HorizontalResolution = p.HorizontalResolution, Id = p.Id, - ResolutionUnit = p.ResolutionUnit, + ResolutionUnit = (ushort?)p.ResolutionUnit, Page = p.Page, ScannerManufacturer = p.ScannerManufacturer, ScannerModel = p.ScannerModel, @@ -94,12 +95,12 @@ public class MagazineScansController(MarechaiContext context) : ControllerBase if(model is null) return NotFound(); model.Author = dto.Author; - model.ColorSpace = dto.ColorSpace; + model.ColorSpace = dto.ColorSpace.HasValue ? (ColorSpace)dto.ColorSpace.Value : null; model.Comments = dto.Comments; model.CreationDate = dto.CreationDate; model.ExifVersion = dto.ExifVersion; model.HorizontalResolution = dto.HorizontalResolution; - model.ResolutionUnit = dto.ResolutionUnit; + model.ResolutionUnit = dto.ResolutionUnit.HasValue ? (ResolutionUnit)dto.ResolutionUnit.Value : null; model.Page = dto.Page; model.ScannerManufacturer = dto.ScannerManufacturer; model.ScannerModel = dto.ScannerModel; @@ -127,13 +128,13 @@ public class MagazineScansController(MarechaiContext context) : ControllerBase { Author = dto.Author, MagazineId = dto.MagazineId, - ColorSpace = dto.ColorSpace, + ColorSpace = dto.ColorSpace.HasValue ? (ColorSpace)dto.ColorSpace.Value : null, Comments = dto.Comments, CreationDate = dto.CreationDate, ExifVersion = dto.ExifVersion, HorizontalResolution = dto.HorizontalResolution, Id = dto.Id, - ResolutionUnit = dto.ResolutionUnit, + ResolutionUnit = dto.ResolutionUnit.HasValue ? (ResolutionUnit)dto.ResolutionUnit.Value : null, Page = dto.Page, ScannerManufacturer = dto.ScannerManufacturer, ScannerModel = dto.ScannerModel, diff --git a/Marechai.Server/Controllers/MediaController.cs b/Marechai.Server/Controllers/MediaController.cs index 78c8e2e3..59464927 100644 --- a/Marechai.Server/Controllers/MediaController.cs +++ b/Marechai.Server/Controllers/MediaController.cs @@ -27,6 +27,7 @@ using System.Collections.Generic; using System.Linq; using System.Security.Claims; using System.Threading.Tasks; +using Marechai.Data; using Marechai.Data.Dtos; using Marechai.Database.Models; using Microsoft.AspNetCore.Authorization; @@ -71,7 +72,7 @@ public class MediaController(MarechaiContext context) : ControllerBase PhysicalBlockSize = d.PhysicalBlockSize, LogicalBlockSize = d.LogicalBlockSize, BlockSizes = d.BlockSizes, - StorageInterface = d.StorageInterface, + StorageInterface = (ushort?)d.StorageInterface, TableOfContents = d.TableOfContents }) .ToListAsync(); @@ -119,7 +120,7 @@ public class MediaController(MarechaiContext context) : ControllerBase PhysicalBlockSize = d.PhysicalBlockSize, LogicalBlockSize = d.LogicalBlockSize, BlockSizes = d.BlockSizes, - StorageInterface = d.StorageInterface, + StorageInterface = (ushort?)d.StorageInterface, TableOfContents = d.TableOfContents }) .FirstOrDefaultAsync(); @@ -162,7 +163,7 @@ public class MediaController(MarechaiContext context) : ControllerBase model.PhysicalBlockSize = dto.PhysicalBlockSize; model.LogicalBlockSize = dto.LogicalBlockSize; model.BlockSizes = dto.BlockSizes; - model.StorageInterface = dto.StorageInterface; + model.StorageInterface = dto.StorageInterface.HasValue ? (StorageInterface)dto.StorageInterface.Value : null; model.TableOfContents = dto.TableOfContents; await context.SaveChangesWithUserAsync(userId); @@ -205,7 +206,7 @@ public class MediaController(MarechaiContext context) : ControllerBase PhysicalBlockSize = dto.PhysicalBlockSize, LogicalBlockSize = dto.LogicalBlockSize, BlockSizes = dto.BlockSizes, - StorageInterface = dto.StorageInterface, + StorageInterface = dto.StorageInterface.HasValue ? (StorageInterface)dto.StorageInterface.Value : null, TableOfContents = dto.TableOfContents }; diff --git a/Marechai/Helpers/Exif.cs b/Marechai/Helpers/Exif.cs index 691a24cf..5434c49d 100644 --- a/Marechai/Helpers/Exif.cs +++ b/Marechai/Helpers/Exif.cs @@ -90,23 +90,23 @@ public class Exif model.SoftwareUsed = Software; model.VerticalResolution = YResolution; model.Aperture = ApertureValue; - model.ColorSpace = ColorSpace; - model.Contrast = Contrast; - model.ExposureMethod = ExposureMode; - model.ExposureProgram = ExposureProgram; - model.Flash = Flash; + model.ColorSpace = (ushort?)ColorSpace; + model.Contrast = (ushort?)Contrast; + model.ExposureMethod = (ushort?)ExposureMode; + model.ExposureProgram = (ushort?)ExposureProgram; + model.Flash = (ushort?)Flash; model.FocalLength = FocalLength; model.FocalLengthEquivalent = FocalLengthIn35mmFormat; - model.LightSource = LightSource; - model.MeteringMode = MeteringMode; - model.ResolutionUnit = ResolutionUnit; - model.Orientation = Orientation; - model.Saturation = Saturation; - model.SceneCaptureType = SceneCaptureType; - model.SensingMethod = SensingMethod; - model.Sharpness = Sharpness; - model.SubjectDistanceRange = SubjectDistanceRange; - model.WhiteBalance = WhiteBalance; + model.LightSource = (ushort?)LightSource; + model.MeteringMode = (ushort?)MeteringMode; + model.ResolutionUnit = (ushort?)ResolutionUnit; + model.Orientation = (ushort?)Orientation; + model.Saturation = (ushort?)Saturation; + model.SceneCaptureType = (ushort?)SceneCaptureType; + model.SensingMethod = (ushort?)SensingMethod; + model.Sharpness = (ushort?)Sharpness; + model.SubjectDistanceRange = (byte?)SubjectDistanceRange; + model.WhiteBalance = (ushort?)WhiteBalance; model.Comments = Description; } @@ -120,8 +120,8 @@ public class Exif model.HorizontalResolution = XResolution; model.SoftwareUsed = Software; model.VerticalResolution = YResolution; - model.ColorSpace = ColorSpace; - model.ResolutionUnit = ResolutionUnit; + model.ColorSpace = (ushort?)ColorSpace; + model.ResolutionUnit = (ushort?)ResolutionUnit; model.Comments = Description; } } diff --git a/Marechai/Pages/Admin/Details/Book.razor.cs b/Marechai/Pages/Admin/Details/Book.razor.cs index 1c003b65..e9182737 100644 --- a/Marechai/Pages/Admin/Details/Book.razor.cs +++ b/Marechai/Pages/Admin/Details/Book.razor.cs @@ -166,7 +166,7 @@ public partial class Book return (ushort)_selectedScan.ColorSpace; } - set => _selectedScan.ColorSpace = (ColorSpace)value; + set => _selectedScan.ColorSpace = value; } ushort ScanResolutionUnit @@ -177,7 +177,7 @@ public partial class Book return (ushort)_selectedScan.ResolutionUnit; } - set => _selectedScan.ResolutionUnit = (ResolutionUnit)value; + set => _selectedScan.ResolutionUnit = value; } uint ScanType diff --git a/Marechai/Pages/Admin/Details/Document.razor.cs b/Marechai/Pages/Admin/Details/Document.razor.cs index 17d22855..165d7e36 100644 --- a/Marechai/Pages/Admin/Details/Document.razor.cs +++ b/Marechai/Pages/Admin/Details/Document.razor.cs @@ -163,7 +163,7 @@ public partial class Document return (ushort)_selectedScan.ColorSpace; } - set => _selectedScan.ColorSpace = (ColorSpace)value; + set => _selectedScan.ColorSpace = value; } ushort ScanResolutionUnit @@ -174,7 +174,7 @@ public partial class Document return (ushort)_selectedScan.ResolutionUnit; } - set => _selectedScan.ResolutionUnit = (ResolutionUnit)value; + set => _selectedScan.ResolutionUnit = value; } uint ScanType diff --git a/Marechai/Pages/Admin/Details/MachinePhoto.razor.cs b/Marechai/Pages/Admin/Details/MachinePhoto.razor.cs index 581cf940..eaae9534 100644 --- a/Marechai/Pages/Admin/Details/MachinePhoto.razor.cs +++ b/Marechai/Pages/Admin/Details/MachinePhoto.razor.cs @@ -27,13 +27,11 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; using Blazorise; -using Marechai.Data; using Marechai.Data.Dtos; using Marechai.Database.Models; using Marechai.Shared; using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Authorization; -using Orientation = Marechai.Data.Orientation; namespace Marechai.Pages.Admin.Details; @@ -92,7 +90,7 @@ public partial class MachinePhoto return (ushort)_model.ColorSpace; } - set => _model.ColorSpace = (ColorSpace)value; + set => _model.ColorSpace = value; } ushort Contrast @@ -103,7 +101,7 @@ public partial class MachinePhoto return (ushort)_model.Contrast; } - set => _model.Contrast = (Contrast)value; + set => _model.Contrast = value; } ushort ExposureMode @@ -114,7 +112,7 @@ public partial class MachinePhoto return (ushort)_model.ExposureMethod; } - set => _model.ExposureMethod = (ExposureMode)value; + set => _model.ExposureMethod = value; } ushort ExposureProgram @@ -125,7 +123,7 @@ public partial class MachinePhoto return (ushort)_model.ExposureProgram; } - set => _model.ExposureProgram = (ExposureProgram)value; + set => _model.ExposureProgram = value; } ushort Flash @@ -136,7 +134,7 @@ public partial class MachinePhoto return (ushort)_model.Flash; } - set => _model.Flash = (Flash)value; + set => _model.Flash = value; } ushort LightSource @@ -147,7 +145,7 @@ public partial class MachinePhoto return (ushort)_model.LightSource; } - set => _model.LightSource = (LightSource)value; + set => _model.LightSource = value; } ushort MeteringMode @@ -158,7 +156,7 @@ public partial class MachinePhoto return (ushort)_model.MeteringMode; } - set => _model.MeteringMode = (MeteringMode)value; + set => _model.MeteringMode = value; } ushort ResolutionUnit @@ -169,7 +167,7 @@ public partial class MachinePhoto return (ushort)_model.ResolutionUnit; } - set => _model.ResolutionUnit = (ResolutionUnit)value; + set => _model.ResolutionUnit = value; } ushort Orientation @@ -180,7 +178,7 @@ public partial class MachinePhoto return (ushort)_model.Orientation; } - set => _model.Orientation = (Orientation)value; + set => _model.Orientation = value; } ushort Saturation @@ -191,7 +189,7 @@ public partial class MachinePhoto return (ushort)_model.Saturation; } - set => _model.Saturation = (Saturation)value; + set => _model.Saturation = value; } ushort SceneCaptureType @@ -202,7 +200,7 @@ public partial class MachinePhoto return (ushort)_model.SceneCaptureType; } - set => _model.SceneCaptureType = (SceneCaptureType)value; + set => _model.SceneCaptureType = value; } ushort SensingMethod @@ -213,7 +211,7 @@ public partial class MachinePhoto return (ushort)_model.SensingMethod; } - set => _model.SensingMethod = (SensingMethod)value; + set => _model.SensingMethod = value; } ushort Sharpness @@ -224,7 +222,7 @@ public partial class MachinePhoto return (ushort)_model.Sharpness; } - set => _model.Sharpness = (Sharpness)value; + set => _model.Sharpness = value; } ushort SubjectDistanceRange @@ -235,7 +233,7 @@ public partial class MachinePhoto return (ushort)_model.SubjectDistanceRange; } - set => _model.SubjectDistanceRange = (SubjectDistanceRange)value; + set => _model.SubjectDistanceRange = (byte?)value; } ushort WhiteBalance @@ -246,7 +244,7 @@ public partial class MachinePhoto return (ushort)_model.WhiteBalance; } - set => _model.WhiteBalance = (WhiteBalance)value; + set => _model.WhiteBalance = value; } protected override async Task OnAfterRenderAsync(bool firstRender) diff --git a/Marechai/Services/BookScansService.cs b/Marechai/Services/BookScansService.cs index 4339a81c..248bb0e4 100644 --- a/Marechai/Services/BookScansService.cs +++ b/Marechai/Services/BookScansService.cs @@ -27,6 +27,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using Marechai.Data; using Marechai.Data.Dtos; using Marechai.Database.Models; using Microsoft.EntityFrameworkCore; @@ -39,33 +40,29 @@ public class BookScansService(MarechaiContext context) await context.BookScans.Where(p => p.BookId == bookId).Select(p => p.Id).ToListAsync(); public async Task GetAsync(Guid id) => await context.BookScans.Where(p => p.Id == id) - .Select(p => new BookScanDto - { - Author = p.Author, - BookId = p.Book.Id, - ColorSpace = p.ColorSpace, - Comments = p.Comments, - CreationDate = p.CreationDate, - ExifVersion = p.ExifVersion, - HorizontalResolution = - p.HorizontalResolution, - Id = p.Id, - ResolutionUnit = - p.ResolutionUnit, - Page = p.Page, - ScannerManufacturer = - p.ScannerManufacturer, - ScannerModel = p.ScannerModel, - SoftwareUsed = p.SoftwareUsed, - Type = p.Type, - UploadDate = p.UploadDate, - UserId = p.UserId, - VerticalResolution = - p.VerticalResolution, - OriginalExtension = - p.OriginalExtension - }) - .FirstOrDefaultAsync(); + .Select(p => new BookScanDto + { + Author = p.Author, + BookId = p.Book.Id, + ColorSpace = (ushort?)p.ColorSpace, + Comments = p.Comments, + CreationDate = p.CreationDate, + ExifVersion = p.ExifVersion, + HorizontalResolution = p.HorizontalResolution, + Id = p.Id, + ResolutionUnit = + (ushort?)p.ResolutionUnit, + Page = p.Page, + ScannerManufacturer = p.ScannerManufacturer, + ScannerModel = p.ScannerModel, + SoftwareUsed = p.SoftwareUsed, + Type = p.Type, + UploadDate = p.UploadDate, + UserId = p.UserId, + VerticalResolution = p.VerticalResolution, + OriginalExtension = p.OriginalExtension + }) + .FirstOrDefaultAsync(); public async Task UpdateAsync(BookScanDto dto, string userId) { @@ -74,12 +71,12 @@ public class BookScansService(MarechaiContext context) if(model is null) return; model.Author = dto.Author; - model.ColorSpace = dto.ColorSpace; + model.ColorSpace = dto.ColorSpace.HasValue ? (ColorSpace)dto.ColorSpace.Value : null; model.Comments = dto.Comments; model.CreationDate = dto.CreationDate; model.ExifVersion = dto.ExifVersion; model.HorizontalResolution = dto.HorizontalResolution; - model.ResolutionUnit = dto.ResolutionUnit; + model.ResolutionUnit = dto.ResolutionUnit.HasValue ? (ResolutionUnit)dto.ResolutionUnit.Value : null; model.Page = dto.Page; model.ScannerManufacturer = dto.ScannerManufacturer; model.ScannerModel = dto.ScannerModel; @@ -96,13 +93,13 @@ public class BookScansService(MarechaiContext context) { Author = dto.Author, BookId = dto.BookId, - ColorSpace = dto.ColorSpace, + ColorSpace = dto.ColorSpace.HasValue ? (ColorSpace)dto.ColorSpace.Value : null, Comments = dto.Comments, CreationDate = dto.CreationDate, ExifVersion = dto.ExifVersion, HorizontalResolution = dto.HorizontalResolution, Id = dto.Id, - ResolutionUnit = dto.ResolutionUnit, + ResolutionUnit = dto.ResolutionUnit.HasValue ? (ResolutionUnit)dto.ResolutionUnit.Value : null, Page = dto.Page, ScannerManufacturer = dto.ScannerManufacturer, ScannerModel = dto.ScannerModel, diff --git a/Marechai/Services/DocumentScansService.cs b/Marechai/Services/DocumentScansService.cs index 29b624cf..150d6333 100644 --- a/Marechai/Services/DocumentScansService.cs +++ b/Marechai/Services/DocumentScansService.cs @@ -27,6 +27,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using Marechai.Data; using Marechai.Data.Dtos; using Marechai.Database.Models; using Microsoft.EntityFrameworkCore; @@ -39,28 +40,33 @@ public class DocumentScansService(MarechaiContext context) await context.DocumentScans.Where(p => p.DocumentId == bookId).Select(p => p.Id).ToListAsync(); public async Task GetAsync(Guid id) => await context.DocumentScans.Where(p => p.Id == id) - .Select(p => new DocumentScanDto - { - Author = p.Author, - DocumentId = p.Document.Id, - ColorSpace = p.ColorSpace, - Comments = p.Comments, - CreationDate = p.CreationDate, - ExifVersion = p.ExifVersion, - HorizontalResolution = p.HorizontalResolution, - Id = p.Id, - ResolutionUnit = p.ResolutionUnit, - Page = p.Page, - ScannerManufacturer = p.ScannerManufacturer, - ScannerModel = p.ScannerModel, - SoftwareUsed = p.SoftwareUsed, - Type = p.Type, - UploadDate = p.UploadDate, - UserId = p.UserId, - VerticalResolution = p.VerticalResolution, - OriginalExtension = p.OriginalExtension - }) - .FirstOrDefaultAsync(); + .Select(p => new DocumentScanDto + { + Author = p.Author, + DocumentId = p.Document.Id, + ColorSpace = + (ushort?)p.ColorSpace, + Comments = p.Comments, + CreationDate = p.CreationDate, + ExifVersion = p.ExifVersion, + HorizontalResolution = + p.HorizontalResolution, + Id = p.Id, + ResolutionUnit = + (ushort?)p.ResolutionUnit, + Page = p.Page, + ScannerManufacturer = + p.ScannerManufacturer, + ScannerModel = p.ScannerModel, + SoftwareUsed = p.SoftwareUsed, + Type = p.Type, + UploadDate = p.UploadDate, + UserId = p.UserId, + VerticalResolution = + p.VerticalResolution, + OriginalExtension = p.OriginalExtension + }) + .FirstOrDefaultAsync(); public async Task UpdateAsync(DocumentScanDto dto, string userId) { @@ -69,12 +75,12 @@ public class DocumentScansService(MarechaiContext context) if(model is null) return; model.Author = dto.Author; - model.ColorSpace = dto.ColorSpace; + model.ColorSpace = dto.ColorSpace.HasValue ? (ColorSpace)dto.ColorSpace.Value : null; model.Comments = dto.Comments; model.CreationDate = dto.CreationDate; model.ExifVersion = dto.ExifVersion; model.HorizontalResolution = dto.HorizontalResolution; - model.ResolutionUnit = dto.ResolutionUnit; + model.ResolutionUnit = dto.ResolutionUnit.HasValue ? (ResolutionUnit)dto.ResolutionUnit.Value : null; model.Page = dto.Page; model.ScannerManufacturer = dto.ScannerManufacturer; model.ScannerModel = dto.ScannerModel; @@ -91,13 +97,13 @@ public class DocumentScansService(MarechaiContext context) { Author = dto.Author, DocumentId = dto.DocumentId, - ColorSpace = dto.ColorSpace, + ColorSpace = dto.ColorSpace.HasValue ? (ColorSpace)dto.ColorSpace.Value : null, Comments = dto.Comments, CreationDate = dto.CreationDate, ExifVersion = dto.ExifVersion, HorizontalResolution = dto.HorizontalResolution, Id = dto.Id, - ResolutionUnit = dto.ResolutionUnit, + ResolutionUnit = dto.ResolutionUnit.HasValue ? (ResolutionUnit)dto.ResolutionUnit.Value : null, Page = dto.Page, ScannerManufacturer = dto.ScannerManufacturer, ScannerModel = dto.ScannerModel, diff --git a/Marechai/Services/MachinePhotosService.cs b/Marechai/Services/MachinePhotosService.cs index d0da9b2d..abef66a6 100644 --- a/Marechai/Services/MachinePhotosService.cs +++ b/Marechai/Services/MachinePhotosService.cs @@ -27,6 +27,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using Marechai.Data; using Marechai.Data.Dtos; using Marechai.Database.Models; using Microsoft.EntityFrameworkCore; @@ -40,56 +41,73 @@ public class MachinePhotosService(MarechaiContext context) // TODO: Get only the needed parts of ApplicationUser public async Task GetAsync(Guid id) => await context.MachinePhotos.Where(p => p.Id == id) - .Select(p => new MachinePhotoDto - { - Aperture = p.Aperture, - Author = p.Author, - CameraManufacturer = p.CameraManufacturer, - CameraModel = p.CameraModel, - ColorSpace = p.ColorSpace, - Comments = p.Comments, - Contrast = p.Contrast, - CreationDate = p.CreationDate, - DigitalZoomRatio = p.DigitalZoomRatio, - ExifVersion = p.ExifVersion, - ExposureTime = p.ExposureTime, - ExposureMethod = p.ExposureMethod, - ExposureProgram = p.ExposureProgram, - Flash = p.Flash, - Focal = p.Focal, - FocalLength = p.FocalLength, - FocalLengthEquivalent = - p.FocalLengthEquivalent, - HorizontalResolution = - p.HorizontalResolution, - Id = p.Id, - IsoRating = p.IsoRating, - Lens = p.Lens, - LicenseId = p.LicenseId, - LicenseName = p.License.Name, - LightSource = p.LightSource, - MachineCompanyName = - p.Machine.Company.Name, - MachineId = p.MachineId, - MachineName = p.Machine.Name, - MeteringMode = p.MeteringMode, - ResolutionUnit = p.ResolutionUnit, - Orientation = p.Orientation, - Saturation = p.Saturation, - SceneCaptureType = p.SceneCaptureType, - SensingMethod = p.SensingMethod, - Sharpness = p.Sharpness, - SoftwareUsed = p.SoftwareUsed, - Source = p.Source, - SubjectDistanceRange = - p.SubjectDistanceRange, - UploadDate = p.UploadDate, - UserId = p.UserId, - VerticalResolution = p.VerticalResolution, - WhiteBalance = p.WhiteBalance, - OriginalExtension = p.OriginalExtension - }) - .FirstOrDefaultAsync(); + .Select(p => new MachinePhotoDto + { + Aperture = p.Aperture, + Author = p.Author, + CameraManufacturer = + p.CameraManufacturer, + CameraModel = p.CameraModel, + ColorSpace = + (ushort?)p.ColorSpace, + Comments = p.Comments, + Contrast = + (ushort?)p.Contrast, + CreationDate = p.CreationDate, + DigitalZoomRatio = + p.DigitalZoomRatio, + ExifVersion = p.ExifVersion, + ExposureTime = p.ExposureTime, + ExposureMethod = + (ushort?)p.ExposureMethod, + ExposureProgram = + (ushort?)p.ExposureProgram, + Flash = (ushort?)p.Flash, + Focal = p.Focal, + FocalLength = p.FocalLength, + FocalLengthEquivalent = + p.FocalLengthEquivalent, + HorizontalResolution = + p.HorizontalResolution, + Id = p.Id, + IsoRating = p.IsoRating, + Lens = p.Lens, + LicenseId = p.LicenseId, + LicenseName = p.License.Name, + LightSource = + (ushort?)p.LightSource, + MachineCompanyName = + p.Machine.Company.Name, + MachineId = p.MachineId, + MachineName = p.Machine.Name, + MeteringMode = + (ushort?)p.MeteringMode, + ResolutionUnit = + (ushort?)p.ResolutionUnit, + Orientation = + (ushort?)p.Orientation, + Saturation = + (ushort?)p.Saturation, + SceneCaptureType = + (ushort?)p.SceneCaptureType, + SensingMethod = + (ushort?)p.SensingMethod, + Sharpness = + (ushort?)p.Sharpness, + SoftwareUsed = p.SoftwareUsed, + Source = p.Source, + SubjectDistanceRange = + (byte?)p.SubjectDistanceRange, + UploadDate = p.UploadDate, + UserId = p.UserId, + VerticalResolution = + p.VerticalResolution, + WhiteBalance = + (ushort?)p.WhiteBalance, + OriginalExtension = + p.OriginalExtension + }) + .FirstOrDefaultAsync(); public async Task UpdateAsync(MachinePhotoDto dto, string userId) { @@ -97,40 +115,44 @@ public class MachinePhotosService(MarechaiContext context) if(model is null) return; - model.Aperture = dto.Aperture; - model.Author = dto.Author; - model.CameraManufacturer = dto.CameraManufacturer; - model.CameraModel = dto.CameraModel; - model.ColorSpace = dto.ColorSpace; - model.Comments = dto.Comments; - model.Contrast = dto.Contrast; - model.CreationDate = dto.CreationDate; - model.DigitalZoomRatio = dto.DigitalZoomRatio; - model.ExifVersion = dto.ExifVersion; - model.ExposureTime = dto.ExposureTime; - model.ExposureMethod = dto.ExposureMethod; - model.ExposureProgram = dto.ExposureProgram; - model.Flash = dto.Flash; - model.Focal = dto.Focal; - model.FocalLength = dto.FocalLength; + model.Aperture = dto.Aperture; + model.Author = dto.Author; + model.CameraManufacturer = dto.CameraManufacturer; + model.CameraModel = dto.CameraModel; + model.ColorSpace = dto.ColorSpace.HasValue ? (ColorSpace)dto.ColorSpace.Value : null; + model.Comments = dto.Comments; + model.Contrast = dto.Contrast.HasValue ? (Contrast)dto.Contrast.Value : null; + model.CreationDate = dto.CreationDate; + model.DigitalZoomRatio = dto.DigitalZoomRatio; + model.ExifVersion = dto.ExifVersion; + model.ExposureTime = dto.ExposureTime; + model.ExposureMethod = dto.ExposureMethod.HasValue ? (ExposureMode)dto.ExposureMethod.Value : null; + model.ExposureProgram = dto.ExposureProgram.HasValue ? (ExposureProgram)dto.ExposureProgram.Value : null; + model.Flash = dto.Flash.HasValue ? (Flash)dto.Flash.Value : null; + model.Focal = dto.Focal; + model.FocalLength = dto.FocalLength; model.FocalLengthEquivalent = dto.FocalLengthEquivalent; - model.HorizontalResolution = dto.HorizontalResolution; - model.IsoRating = dto.IsoRating; - model.Lens = dto.Lens; - model.LicenseId = dto.LicenseId; - model.LightSource = dto.LightSource; - model.MeteringMode = dto.MeteringMode; - model.ResolutionUnit = dto.ResolutionUnit; - model.Orientation = dto.Orientation; - model.Saturation = dto.Saturation; - model.SceneCaptureType = dto.SceneCaptureType; - model.SensingMethod = dto.SensingMethod; - model.Sharpness = dto.Sharpness; - model.SoftwareUsed = dto.SoftwareUsed; - model.Source = dto.Source; - model.SubjectDistanceRange = dto.SubjectDistanceRange; - model.VerticalResolution = dto.VerticalResolution; - model.WhiteBalance = dto.WhiteBalance; + model.HorizontalResolution = dto.HorizontalResolution; + model.IsoRating = dto.IsoRating; + model.Lens = dto.Lens; + model.LicenseId = dto.LicenseId; + model.LightSource = dto.LightSource.HasValue ? (LightSource)dto.LightSource.Value : null; + model.MeteringMode = dto.MeteringMode.HasValue ? (MeteringMode)dto.MeteringMode.Value : null; + model.ResolutionUnit = dto.ResolutionUnit.HasValue ? (ResolutionUnit)dto.ResolutionUnit.Value : null; + model.Orientation = dto.Orientation.HasValue ? (Orientation)dto.Orientation.Value : null; + model.Saturation = dto.Saturation.HasValue ? (Saturation)dto.Saturation.Value : null; + model.SceneCaptureType = dto.SceneCaptureType.HasValue ? (SceneCaptureType)dto.SceneCaptureType.Value : null; + model.SensingMethod = dto.SensingMethod.HasValue ? (SensingMethod)dto.SensingMethod.Value : null; + model.Sharpness = dto.Sharpness.HasValue ? (Sharpness)dto.Sharpness.Value : null; + model.SoftwareUsed = dto.SoftwareUsed; + model.Source = dto.Source; + + model.SubjectDistanceRange = dto.SubjectDistanceRange.HasValue + ? (SubjectDistanceRange)dto.SubjectDistanceRange.Value + : null; + + model.VerticalResolution = dto.VerticalResolution; + model.WhiteBalance = dto.WhiteBalance.HasValue ? (WhiteBalance)dto.WhiteBalance.Value : null; await context.SaveChangesWithUserAsync(userId); } @@ -143,16 +165,16 @@ public class MachinePhotosService(MarechaiContext context) Author = dto.Author, CameraManufacturer = dto.CameraManufacturer, CameraModel = dto.CameraModel, - ColorSpace = dto.ColorSpace, + ColorSpace = dto.ColorSpace.HasValue ? (ColorSpace)dto.ColorSpace.Value : null, Comments = dto.Comments, - Contrast = dto.Contrast, + Contrast = dto.Contrast.HasValue ? (Contrast)dto.Contrast.Value : null, CreationDate = dto.CreationDate, DigitalZoomRatio = dto.DigitalZoomRatio, ExifVersion = dto.ExifVersion, ExposureTime = dto.ExposureTime, - ExposureMethod = dto.ExposureMethod, - ExposureProgram = dto.ExposureProgram, - Flash = dto.Flash, + ExposureMethod = dto.ExposureMethod.HasValue ? (ExposureMode)dto.ExposureMethod.Value : null, + ExposureProgram = dto.ExposureProgram.HasValue ? (ExposureProgram)dto.ExposureProgram.Value : null, + Flash = dto.Flash.HasValue ? (Flash)dto.Flash.Value : null, Focal = dto.Focal, FocalLength = dto.FocalLength, FocalLengthEquivalent = dto.FocalLengthEquivalent, @@ -161,23 +183,24 @@ public class MachinePhotosService(MarechaiContext context) IsoRating = dto.IsoRating, Lens = dto.Lens, LicenseId = dto.LicenseId, - LightSource = dto.LightSource, + LightSource = dto.LightSource.HasValue ? (LightSource)dto.LightSource.Value : null, MachineId = dto.MachineId, - MeteringMode = dto.MeteringMode, - ResolutionUnit = dto.ResolutionUnit, - Orientation = dto.Orientation, - Saturation = dto.Saturation, - SceneCaptureType = dto.SceneCaptureType, - SensingMethod = dto.SensingMethod, - Sharpness = dto.Sharpness, + MeteringMode = dto.MeteringMode.HasValue ? (MeteringMode)dto.MeteringMode.Value : null, + ResolutionUnit = dto.ResolutionUnit.HasValue ? (ResolutionUnit)dto.ResolutionUnit.Value : null, + Orientation = dto.Orientation.HasValue ? (Orientation)dto.Orientation.Value : null, + Saturation = dto.Saturation.HasValue ? (Saturation)dto.Saturation.Value : null, + SceneCaptureType = dto.SceneCaptureType.HasValue ? (SceneCaptureType)dto.SceneCaptureType.Value : null, + SensingMethod = dto.SensingMethod.HasValue ? (SensingMethod)dto.SensingMethod.Value : null, + Sharpness = dto.Sharpness.HasValue ? (Sharpness)dto.Sharpness.Value : null, SoftwareUsed = dto.SoftwareUsed, Source = dto.Source, - SubjectDistanceRange = dto.SubjectDistanceRange, - UploadDate = dto.UploadDate, - UserId = dto.UserId, - VerticalResolution = dto.VerticalResolution, - WhiteBalance = dto.WhiteBalance, - OriginalExtension = dto.OriginalExtension + SubjectDistanceRange = + dto.SubjectDistanceRange.HasValue ? (SubjectDistanceRange)dto.SubjectDistanceRange.Value : null, + UploadDate = dto.UploadDate, + UserId = dto.UserId, + VerticalResolution = dto.VerticalResolution, + WhiteBalance = dto.WhiteBalance.HasValue ? (WhiteBalance)dto.WhiteBalance.Value : null, + OriginalExtension = dto.OriginalExtension }; await context.MachinePhotos.AddAsync(model); diff --git a/Marechai/Services/MagazineScansService.cs b/Marechai/Services/MagazineScansService.cs index 7d28316e..5bcd2e74 100644 --- a/Marechai/Services/MagazineScansService.cs +++ b/Marechai/Services/MagazineScansService.cs @@ -27,6 +27,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using Marechai.Data; using Marechai.Data.Dtos; using Marechai.Database.Models; using Microsoft.EntityFrameworkCore; @@ -39,28 +40,33 @@ public class MagazineScansService(MarechaiContext context) await context.MagazineScans.Where(p => p.MagazineId == bookId).Select(p => p.Id).ToListAsync(); public async Task GetAsync(Guid id) => await context.MagazineScans.Where(p => p.Id == id) - .Select(p => new MagazineScanDto - { - Author = p.Author, - MagazineId = p.Magazine.Id, - ColorSpace = p.ColorSpace, - Comments = p.Comments, - CreationDate = p.CreationDate, - ExifVersion = p.ExifVersion, - HorizontalResolution = p.HorizontalResolution, - Id = p.Id, - ResolutionUnit = p.ResolutionUnit, - Page = p.Page, - ScannerManufacturer = p.ScannerManufacturer, - ScannerModel = p.ScannerModel, - SoftwareUsed = p.SoftwareUsed, - Type = p.Type, - UploadDate = p.UploadDate, - UserId = p.UserId, - VerticalResolution = p.VerticalResolution, - OriginalExtension = p.OriginalExtension - }) - .FirstOrDefaultAsync(); + .Select(p => new MagazineScanDto + { + Author = p.Author, + MagazineId = p.Magazine.Id, + ColorSpace = + (ushort?)p.ColorSpace, + Comments = p.Comments, + CreationDate = p.CreationDate, + ExifVersion = p.ExifVersion, + HorizontalResolution = + p.HorizontalResolution, + Id = p.Id, + ResolutionUnit = + (ushort?)p.ResolutionUnit, + Page = p.Page, + ScannerManufacturer = + p.ScannerManufacturer, + ScannerModel = p.ScannerModel, + SoftwareUsed = p.SoftwareUsed, + Type = p.Type, + UploadDate = p.UploadDate, + UserId = p.UserId, + VerticalResolution = + p.VerticalResolution, + OriginalExtension = p.OriginalExtension + }) + .FirstOrDefaultAsync(); public async Task UpdateAsync(MagazineScanDto dto, string userId) { @@ -69,12 +75,12 @@ public class MagazineScansService(MarechaiContext context) if(model is null) return; model.Author = dto.Author; - model.ColorSpace = dto.ColorSpace; + model.ColorSpace = dto.ColorSpace.HasValue ? (ColorSpace)dto.ColorSpace.Value : null; model.Comments = dto.Comments; model.CreationDate = dto.CreationDate; model.ExifVersion = dto.ExifVersion; model.HorizontalResolution = dto.HorizontalResolution; - model.ResolutionUnit = dto.ResolutionUnit; + model.ResolutionUnit = dto.ResolutionUnit.HasValue ? (ResolutionUnit)dto.ResolutionUnit.Value : null; model.Page = dto.Page; model.ScannerManufacturer = dto.ScannerManufacturer; model.ScannerModel = dto.ScannerModel; @@ -91,13 +97,13 @@ public class MagazineScansService(MarechaiContext context) { Author = dto.Author, MagazineId = dto.MagazineId, - ColorSpace = dto.ColorSpace, + ColorSpace = dto.ColorSpace.HasValue ? (ColorSpace)dto.ColorSpace.Value : null, Comments = dto.Comments, CreationDate = dto.CreationDate, ExifVersion = dto.ExifVersion, HorizontalResolution = dto.HorizontalResolution, Id = dto.Id, - ResolutionUnit = dto.ResolutionUnit, + ResolutionUnit = dto.ResolutionUnit.HasValue ? (ResolutionUnit)dto.ResolutionUnit.Value : null, Page = dto.Page, ScannerManufacturer = dto.ScannerManufacturer, ScannerModel = dto.ScannerModel, diff --git a/Marechai/Services/MediaService.cs b/Marechai/Services/MediaService.cs index cd153077..50086167 100644 --- a/Marechai/Services/MediaService.cs +++ b/Marechai/Services/MediaService.cs @@ -26,6 +26,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using Marechai.Data; using Marechai.Data.Dtos; using Marechai.Database.Models; using Microsoft.EntityFrameworkCore; @@ -35,76 +36,76 @@ namespace Marechai.Services; public class MediaService(MarechaiContext context) { public async Task> GetAsync() => await context.Media.OrderBy(d => d.Title) + .Select(d => new MediaDto + { + Id = d.Id, + Title = d.Title, + Sequence = d.Sequence, + LastSequence = d.LastSequence, + Type = d.Type, + WriteOffset = d.WriteOffset, + Sides = d.Sides, + Layers = d.Layers, + Sessions = d.Sessions, + Tracks = d.Tracks, + Sectors = d.Sectors, + Size = d.Size, + CopyProtection = d.CopyProtection, + PartNumber = d.PartNumber, + SerialNumber = d.SerialNumber, + Barcode = d.Barcode, + CatalogueNumber = d.CatalogueNumber, + Manufacturer = d.Manufacturer, + Model = d.Model, + Revision = d.Revision, + Firmware = d.Firmware, + PhysicalBlockSize = d.PhysicalBlockSize, + LogicalBlockSize = d.LogicalBlockSize, + BlockSizes = d.BlockSizes, + StorageInterface = (ushort?)d.StorageInterface, + TableOfContents = d.TableOfContents + }) + .ToListAsync(); + + public async Task> GetTitlesAsync() => await context.Media.OrderBy(d => d.Title) .Select(d => new MediaDto { - Id = d.Id, - Title = d.Title, - Sequence = d.Sequence, - LastSequence = d.LastSequence, - Type = d.Type, - WriteOffset = d.WriteOffset, - Sides = d.Sides, - Layers = d.Layers, - Sessions = d.Sessions, - Tracks = d.Tracks, - Sectors = d.Sectors, - Size = d.Size, - CopyProtection = d.CopyProtection, - PartNumber = d.PartNumber, - SerialNumber = d.SerialNumber, - Barcode = d.Barcode, - CatalogueNumber = d.CatalogueNumber, - Manufacturer = d.Manufacturer, - Model = d.Model, - Revision = d.Revision, - Firmware = d.Firmware, - PhysicalBlockSize = d.PhysicalBlockSize, - LogicalBlockSize = d.LogicalBlockSize, - BlockSizes = d.BlockSizes, - StorageInterface = d.StorageInterface, - TableOfContents = d.TableOfContents + Id = d.Id, + Title = d.Title }) .ToListAsync(); - public async Task> GetTitlesAsync() => await context.Media.OrderBy(d => d.Title) - .Select(d => new MediaDto - { - Id = d.Id, - Title = d.Title - }) - .ToListAsync(); - public async Task GetAsync(ulong id) => await context.Media.Where(d => d.Id == id) - .Select(d => new MediaDto - { - Id = d.Id, - Title = d.Title, - Sequence = d.Sequence, - LastSequence = d.LastSequence, - Type = d.Type, - WriteOffset = d.WriteOffset, - Sides = d.Sides, - Layers = d.Layers, - Sessions = d.Sessions, - Tracks = d.Tracks, - Sectors = d.Sectors, - Size = d.Size, - CopyProtection = d.CopyProtection, - PartNumber = d.PartNumber, - SerialNumber = d.SerialNumber, - Barcode = d.Barcode, - CatalogueNumber = d.CatalogueNumber, - Manufacturer = d.Manufacturer, - Model = d.Model, - Revision = d.Revision, - Firmware = d.Firmware, - PhysicalBlockSize = d.PhysicalBlockSize, - LogicalBlockSize = d.LogicalBlockSize, - BlockSizes = d.BlockSizes, - StorageInterface = d.StorageInterface, - TableOfContents = d.TableOfContents - }) - .FirstOrDefaultAsync(); + .Select(d => new MediaDto + { + Id = d.Id, + Title = d.Title, + Sequence = d.Sequence, + LastSequence = d.LastSequence, + Type = d.Type, + WriteOffset = d.WriteOffset, + Sides = d.Sides, + Layers = d.Layers, + Sessions = d.Sessions, + Tracks = d.Tracks, + Sectors = d.Sectors, + Size = d.Size, + CopyProtection = d.CopyProtection, + PartNumber = d.PartNumber, + SerialNumber = d.SerialNumber, + Barcode = d.Barcode, + CatalogueNumber = d.CatalogueNumber, + Manufacturer = d.Manufacturer, + Model = d.Model, + Revision = d.Revision, + Firmware = d.Firmware, + PhysicalBlockSize = d.PhysicalBlockSize, + LogicalBlockSize = d.LogicalBlockSize, + BlockSizes = d.BlockSizes, + StorageInterface = (ushort?)d.StorageInterface, + TableOfContents = d.TableOfContents + }) + .FirstOrDefaultAsync(); public async Task UpdateAsync(MediaDto dto, string userId) { @@ -135,7 +136,7 @@ public class MediaService(MarechaiContext context) model.PhysicalBlockSize = dto.PhysicalBlockSize; model.LogicalBlockSize = dto.LogicalBlockSize; model.BlockSizes = dto.BlockSizes; - model.StorageInterface = dto.StorageInterface; + model.StorageInterface = dto.StorageInterface.HasValue ? (StorageInterface)dto.StorageInterface.Value : null; model.TableOfContents = dto.TableOfContents; await context.SaveChangesWithUserAsync(userId); } @@ -167,7 +168,7 @@ public class MediaService(MarechaiContext context) PhysicalBlockSize = dto.PhysicalBlockSize, LogicalBlockSize = dto.LogicalBlockSize, BlockSizes = dto.BlockSizes, - StorageInterface = dto.StorageInterface, + StorageInterface = dto.StorageInterface.HasValue ? (StorageInterface)dto.StorageInterface.Value : null, TableOfContents = dto.TableOfContents };