Skip to content

Commit fbca4fe

Browse files
authored
Merge pull request #833 from Barakros/Merchant-Fulfillment-DangerousGoodsDetails-IsHazmat
dangerouse goods and is hazmat in item Merchant-Fulfillment
2 parents 0a6affe + 7ccb9ae commit fbca4fe

File tree

2 files changed

+180
-0
lines changed

2 files changed

+180
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
using System;
2+
using System.Linq;
3+
using System.IO;
4+
using System.Text;
5+
using System.Text.RegularExpressions;
6+
using System.Collections;
7+
using System.Collections.Generic;
8+
using System.Collections.ObjectModel;
9+
using System.Runtime.Serialization;
10+
using Newtonsoft.Json;
11+
using Newtonsoft.Json.Converters;
12+
using System.ComponentModel.DataAnnotations;
13+
14+
namespace FikaAmazonAPI.AmazonSpApiSDK.Models.MerchantFulfillment
15+
{
16+
[DataContract]
17+
public partial class DangerousGoodsDetails : IEquatable<DangerousGoodsDetails>, IValidatableObject
18+
{
19+
[DataMember(Name = "UnitedNationsRegulatoryId", EmitDefaultValue = false)]
20+
public string UnitedNationsRegulatoryId { get; set; }
21+
[DataMember(Name = "TransportationRegulatoryClass", EmitDefaultValue = false)]
22+
public string TransportationRegulatoryClass { get; set; }
23+
24+
[DataMember(Name = "PackingGroup", EmitDefaultValue = false)]
25+
public PackingGroup? PackingGroup { get; set; }
26+
27+
[DataMember(Name = "PackingInstruction", EmitDefaultValue = false)]
28+
public PackingInstruction? PackingInstruction { get; set; }
29+
30+
[JsonConstructorAttribute]
31+
public DangerousGoodsDetails() { }
32+
33+
public override string ToString()
34+
{
35+
var sb = new StringBuilder();
36+
sb.Append("class DangerousGoodsDetails {\n");
37+
sb.Append(" UnitedNationsRegulatoryId: ").Append(UnitedNationsRegulatoryId).Append("\n");
38+
sb.Append(" TransportationRegulatoryClass: ").Append(TransportationRegulatoryClass).Append("\n");
39+
sb.Append(" PackingGroup: ").Append(PackingGroup).Append("\n");
40+
sb.Append(" PackingInstruction: ").Append(PackingInstruction).Append("\n");
41+
sb.Append("}\n");
42+
return sb.ToString();
43+
}
44+
public virtual string ToJson()
45+
{
46+
return JsonConvert.SerializeObject(this, Formatting.Indented);
47+
}
48+
49+
public override bool Equals(object input)
50+
{
51+
return this.Equals(input as DangerousGoodsDetails);
52+
}
53+
54+
public bool Equals(DangerousGoodsDetails input)
55+
{
56+
if (input == null)
57+
return false;
58+
59+
return
60+
(
61+
this.UnitedNationsRegulatoryId == input.UnitedNationsRegulatoryId ||
62+
(this.UnitedNationsRegulatoryId != null &&
63+
this.UnitedNationsRegulatoryId.Equals(input.UnitedNationsRegulatoryId))
64+
) &&
65+
(
66+
this.TransportationRegulatoryClass == input.TransportationRegulatoryClass ||
67+
(this.TransportationRegulatoryClass != null &&
68+
this.TransportationRegulatoryClass.Equals(input.TransportationRegulatoryClass))
69+
) &&
70+
(
71+
this.PackingGroup == input.PackingGroup ||
72+
(this.PackingGroup != null &&
73+
this.PackingGroup.Equals(input.PackingGroup))
74+
) &&
75+
(
76+
this.PackingInstruction == input.PackingInstruction ||
77+
(this.PackingInstruction != null &&
78+
this.PackingInstruction.Equals(input.PackingInstruction))
79+
);
80+
}
81+
public override int GetHashCode()
82+
{
83+
unchecked // Overflow is fine, just wrap
84+
{
85+
int hashCode = 41;
86+
if (this.UnitedNationsRegulatoryId != null)
87+
hashCode = hashCode * 59 + this.UnitedNationsRegulatoryId.GetHashCode();
88+
if (this.TransportationRegulatoryClass != null)
89+
hashCode = hashCode * 59 + this.TransportationRegulatoryClass.GetHashCode();
90+
if (this.PackingGroup != null)
91+
hashCode = hashCode * 59 + this.PackingGroup.GetHashCode();
92+
if (this.PackingInstruction != null)
93+
hashCode = hashCode * 59 + this.PackingInstruction.GetHashCode();
94+
return hashCode;
95+
}
96+
}
97+
98+
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
99+
{
100+
yield break;
101+
}
102+
}
103+
104+
[JsonConverter(typeof(StringEnumConverter))]
105+
public enum PackingGroup
106+
{
107+
[EnumMember(Value = "I")]
108+
I = 1,
109+
110+
[EnumMember(Value = "II")]
111+
II = 2,
112+
113+
[EnumMember(Value = "III")]
114+
III = 3
115+
}
116+
117+
[JsonConverter(typeof(StringEnumConverter))]
118+
public enum PackingInstruction
119+
{
120+
[EnumMember(Value = "PI965_SECTION_IA")]
121+
PI965_SECTION_IA = 1,
122+
123+
[EnumMember(Value = "PI965_SECTION_IB")]
124+
PI965_SECTION_IB = 2,
125+
126+
[EnumMember(Value = "PI965_SECTION_II")]
127+
PI965_SECTION_II = 3,
128+
129+
[EnumMember(Value = "PI966_SECTION_I")]
130+
PI966_SECTION_I = 4,
131+
132+
[EnumMember(Value = "PI966_SECTION_II")]
133+
PI966_SECTION_II = 5,
134+
135+
[EnumMember(Value = "PI967_SECTION_I")]
136+
PI967_SECTION_I = 6,
137+
138+
[EnumMember(Value = "PI967_SECTION_II")]
139+
PI967_SECTION_II = 7,
140+
141+
[EnumMember(Value = "PI968_SECTION_IA")]
142+
PI968_SECTION_IA = 8,
143+
144+
[EnumMember(Value = "PI968_SECTION_IB")]
145+
PI968_SECTION_IB = 9,
146+
147+
[EnumMember(Value = "PI969_SECTION_I")]
148+
PI969_SECTION_I = 10,
149+
150+
[EnumMember(Value = "PI969_SECTION_II")]
151+
PI969_SECTION_II = 11,
152+
153+
[EnumMember(Value = "PI970_SECTION_I")]
154+
PI970_SECTION_I = 12,
155+
156+
[EnumMember(Value = "PI970_SECTION_II")]
157+
PI970_SECTION_II = 13
158+
}
159+
}

Source/FikaAmazonAPI/AmazonSpApiSDK/Models/MerchantFulfillment/Item.cs

+21
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ public Item() { }
107107
[DataMember(Name="ItemLevelSellerInputsList", EmitDefaultValue=false)]
108108
public AdditionalSellerInputsList ItemLevelSellerInputsList { get; set; }
109109

110+
[DataMember(Name = "IsHazmat", EmitDefaultValue = false)]
111+
public bool? IsHazmat { get; set; }
112+
[DataMember(Name = "DangerousGoodsDetails", EmitDefaultValue = false)]
113+
public DangerousGoodsDetails DangerousGoodsDetails { get; set; }
114+
110115
/// <summary>
111116
/// Returns the string presentation of the object
112117
/// </summary>
@@ -121,6 +126,8 @@ public override string ToString()
121126
sb.Append(" ItemDescription: ").Append(ItemDescription).Append("\n");
122127
sb.Append(" TransparencyCodeList: ").Append(TransparencyCodeList).Append("\n");
123128
sb.Append(" ItemLevelSellerInputsList: ").Append(ItemLevelSellerInputsList).Append("\n");
129+
sb.Append(" IsHazmat: ").Append(IsHazmat).Append("\n");
130+
sb.Append(" DangerousGoodsDetails: ").Append(DangerousGoodsDetails).Append("\n");
124131
sb.Append("}\n");
125132
return sb.ToString();
126133
}
@@ -184,6 +191,16 @@ public bool Equals(Item input)
184191
this.ItemLevelSellerInputsList == input.ItemLevelSellerInputsList ||
185192
(this.ItemLevelSellerInputsList != null &&
186193
this.ItemLevelSellerInputsList.Equals(input.ItemLevelSellerInputsList))
194+
) &&
195+
(
196+
this.IsHazmat == input.IsHazmat ||
197+
(this.IsHazmat != null &&
198+
this.IsHazmat.Equals(input.IsHazmat))
199+
) &&
200+
(
201+
this.DangerousGoodsDetails == input.DangerousGoodsDetails ||
202+
(this.DangerousGoodsDetails != null &&
203+
this.DangerousGoodsDetails.Equals(input.IsHazmat))
187204
);
188205
}
189206

@@ -208,6 +225,10 @@ public override int GetHashCode()
208225
hashCode = hashCode * 59 + this.TransparencyCodeList.GetHashCode();
209226
if (this.ItemLevelSellerInputsList != null)
210227
hashCode = hashCode * 59 + this.ItemLevelSellerInputsList.GetHashCode();
228+
if (this.IsHazmat != null)
229+
hashCode = hashCode * 59 + this.IsHazmat.GetHashCode();
230+
if (this.DangerousGoodsDetails != null)
231+
hashCode = hashCode * 59 + this.DangerousGoodsDetails.GetHashCode();
211232
return hashCode;
212233
}
213234
}

0 commit comments

Comments
 (0)