-
Notifications
You must be signed in to change notification settings - Fork 584
/
Copy pathAttachment.cs
74 lines (68 loc) · 2.66 KB
/
Attachment.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
// <copyright file="Attachment.cs" company="Twilio SendGrid">
// Copyright (c) Twilio SendGrid. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
// </copyright>
#if NETSTANDARD2_0
using System.Text.Json.Serialization;
#else
using Newtonsoft.Json;
#endif
namespace SendGrid.Helpers.Mail
{
/// <summary>
/// Gets or sets an array of objects in which you can specify any attachments you want to include.
/// </summary>
#if NETSTANDARD2_0
// Globally defined by setting ReferenceHandler on the JsonSerializerOptions object
#else
[JsonObject(IsReference = false)]
#endif
public class Attachment
{
/// <summary>
/// Gets or sets the Base64 encoded content of the attachment.
/// </summary>
#if NETSTANDARD2_0
[JsonPropertyName("content")]
#else
[JsonProperty(PropertyName = "content")]
#endif
public string Content { get; set; }
/// <summary>
/// Gets or sets the mime type of the content you are attaching. For example, application/pdf or image/jpeg.
/// </summary>
#if NETSTANDARD2_0
[JsonPropertyName("type")]
#else
[JsonProperty(PropertyName = "type")]
#endif
public string Type { get; set; }
/// <summary>
/// Gets or sets the filename of the attachment.
/// </summary>
#if NETSTANDARD2_0
[JsonPropertyName("filename")]
#else
[JsonProperty(PropertyName = "filename")]
#endif
public string Filename { get; set; }
/// <summary>
/// Gets or sets the content-disposition of the attachment specifying how you would like the attachment to be displayed. For example, "inline" results in the attached file being displayed automatically within the message while "attachment" results in the attached file requiring some action to be taken before it is displayed (e.g. opening or downloading the file). Defaults to "attachment". Can be either "attachment" or "inline".
/// </summary>
#if NETSTANDARD2_0
[JsonPropertyName("disposition")]
#else
[JsonProperty(PropertyName = "disposition")]
#endif
public string Disposition { get; set; }
/// <summary>
/// Gets or sets a unique id that you specify for the attachment. This is used when the disposition is set to "inline" and the attachment is an image, allowing the file to be displayed within the body of your email. Ex: <img src="cid:ii_139db99fdb5c3704"></img>.
/// </summary>
#if NETSTANDARD2_0
[JsonPropertyName("content_id")]
#else
[JsonProperty(PropertyName = "content_id")]
#endif
public string ContentId { get; set; }
}
}