-
Notifications
You must be signed in to change notification settings - Fork 4.6k
/
FileDTO.cs
79 lines (72 loc) · 2.39 KB
/
FileDTO.cs
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// <auto-generated>
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// </auto-generated>
namespace Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.Models
{
using Microsoft.Rest;
using Newtonsoft.Json;
using System.Linq;
/// <summary>
/// DTO to hold details of uploaded files.
/// </summary>
public partial class FileDTO
{
/// <summary>
/// Initializes a new instance of the FileDTO class.
/// </summary>
public FileDTO()
{
CustomInit();
}
/// <summary>
/// Initializes a new instance of the FileDTO class.
/// </summary>
/// <param name="fileName">File name. Supported file types are ".tsv",
/// ".pdf", ".txt", ".docx", ".xlsx".</param>
/// <param name="fileUri">Public URI of the file.</param>
public FileDTO(string fileName, string fileUri)
{
FileName = fileName;
FileUri = fileUri;
CustomInit();
}
/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();
/// <summary>
/// Gets or sets file name. Supported file types are ".tsv", ".pdf",
/// ".txt", ".docx", ".xlsx".
/// </summary>
[JsonProperty(PropertyName = "fileName")]
public string FileName { get; set; }
/// <summary>
/// Gets or sets public URI of the file.
/// </summary>
[JsonProperty(PropertyName = "fileUri")]
public string FileUri { get; set; }
/// <summary>
/// Validate the object.
/// </summary>
/// <exception cref="ValidationException">
/// Thrown if validation fails
/// </exception>
public virtual void Validate()
{
if (FileName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "FileName");
}
if (FileUri == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "FileUri");
}
}
}
}