Skip to content

Commit cb0fe5c

Browse files
authored
Merge pull request #368 from mitnick2012/main
update DocumentFormat & DocumentType Enums
2 parents b5afff9 + d1b25c5 commit cb0fe5c

File tree

2 files changed

+23
-45
lines changed

2 files changed

+23
-45
lines changed

Source/FikaAmazonAPI/AmazonSpApiSDK/Models/ShippingV2/DocumentFormat.cs

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,21 @@
44
using System.Collections.Generic;
55
using System.Runtime.Serialization;
66
using Newtonsoft.Json;
7+
using Newtonsoft.Json.Converters;
78

89
namespace FikaAmazonAPI.AmazonSpApiSDK.Models.ShippingV2 {
910

10-
/// <summary>
11-
/// The file format of the document.
12-
/// </summary>
13-
[DataContract]
14-
public class DocumentFormat {
15-
1611
/// <summary>
17-
/// Get the string presentation of the object
12+
/// The file format of the document.
1813
/// </summary>
19-
/// <returns>String presentation of the object</returns>
20-
public override string ToString() {
21-
var sb = new StringBuilder();
22-
sb.Append("class DocumentFormat {\n");
23-
sb.Append("}\n");
24-
return sb.ToString();
25-
}
14+
[JsonConverter(typeof(StringEnumConverter))]
15+
public enum DocumentFormat {
2616

27-
/// <summary>
28-
/// Get the JSON string presentation of the object
29-
/// </summary>
30-
/// <returns>JSON string presentation of the object</returns>
31-
public string ToJson() {
32-
return JsonConvert.SerializeObject(this, Formatting.Indented);
17+
[EnumMember(Value = "PDF")]
18+
PDF ,
19+
[EnumMember(Value = "PNG")]
20+
PNG ,
21+
[EnumMember(Value = "ZPL")]
22+
ZPL
3323
}
34-
35-
}
3624
}

Source/FikaAmazonAPI/AmazonSpApiSDK/Models/ShippingV2/DocumentType.cs

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,23 @@
44
using System.Collections.Generic;
55
using System.Runtime.Serialization;
66
using Newtonsoft.Json;
7+
using Newtonsoft.Json.Converters;
78

89
namespace FikaAmazonAPI.AmazonSpApiSDK.Models.ShippingV2 {
910

10-
/// <summary>
11-
/// The type of shipping document.
12-
/// </summary>
13-
[DataContract]
14-
public class DocumentType {
15-
1611
/// <summary>
17-
/// Get the string presentation of the object
12+
/// The type of shipping document.
1813
/// </summary>
19-
/// <returns>String presentation of the object</returns>
20-
public override string ToString() {
21-
var sb = new StringBuilder();
22-
sb.Append("class DocumentType {\n");
23-
sb.Append("}\n");
24-
return sb.ToString();
14+
[JsonConverter(typeof(StringEnumConverter))]
15+
public enum DocumentType
16+
{
17+
[EnumMember(Value = "PACKSLIP")]
18+
PACKSLIP,
19+
[EnumMember(Value = "LABEL")]
20+
LABEL,
21+
[EnumMember(Value = "RECEIPT")]
22+
RECEIPT,
23+
[EnumMember(Value = "CUSTOM_FORM")]
24+
CUSTOM_FORM
2525
}
26-
27-
/// <summary>
28-
/// Get the JSON string presentation of the object
29-
/// </summary>
30-
/// <returns>JSON string presentation of the object</returns>
31-
public string ToJson() {
32-
return JsonConvert.SerializeObject(this, Formatting.Indented);
33-
}
34-
35-
}
3626
}

0 commit comments

Comments
 (0)