blob: b10771b074b872fc00079c88c871bca5d7ea3e6a (
plain)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
 | using NSwag.Annotations;
using System;
namespace Timeline.Models
{
    /// <summary>
    /// Model for reading http body as bytes.
    /// </summary>
    [OpenApiFile]
    public class ByteData
    {
        /// <summary>
        /// </summary>
        /// <param name="data">The data.</param>
        /// <param name="contentType">The content type.</param>
        public ByteData(byte[] data, string contentType)
        {
            if (data is null)
                throw new ArgumentNullException(nameof(data));
            if (contentType is null)
                throw new ArgumentNullException(nameof(contentType));
            Data = data;
            ContentType = contentType;
        }
        /// <summary>
        /// Data.
        /// </summary>
#pragma warning disable CA1819 // Properties should not return arrays
        public byte[] Data { get; }
#pragma warning restore CA1819 // Properties should not return arrays
        /// <summary>
        /// Content type.
        /// </summary>
        public string ContentType { get; }
    }
}
 |