From fb89bde62f0eeff45c286a320e9f6c56b6964e8e Mon Sep 17 00:00:00 2001 From: iqra-ui <78844260+iqra-ui@users.noreply.github.com> Date: Fri, 1 Oct 2021 17:23:22 +0530 Subject: [PATCH] Update CustomsItem.cs Added Field. --- src/shippingapi/Model/CustomsItem.cs | 257 +++++++++++++++++++++++---- 1 file changed, 219 insertions(+), 38 deletions(-) diff --git a/src/shippingapi/Model/CustomsItem.cs b/src/shippingapi/Model/CustomsItem.cs index 33ffd5e..6da33f7 100644 --- a/src/shippingapi/Model/CustomsItem.cs +++ b/src/shippingapi/Model/CustomsItem.cs @@ -28,7 +28,7 @@ namespace shippingapi.Model /// CustomsItem /// [DataContract] - public partial class CustomsItem : IEquatable, IValidatableObject + public partial class CustomsItem : IEquatable, IValidatableObject { /// /// Defines NetCostMethod @@ -53,7 +53,7 @@ public enum NetCostMethodEnum /// /// Gets or Sets NetCostMethod /// - [DataMember(Name="netCostMethod", EmitDefaultValue=false)] + [DataMember(Name = "netCostMethod", EmitDefaultValue = false)] public NetCostMethodEnum? NetCostMethod { get; set; } /// /// Defines PreferenceCriterion @@ -102,7 +102,7 @@ public enum PreferenceCriterionEnum /// /// Gets or Sets PreferenceCriterion /// - [DataMember(Name="preferenceCriterion", EmitDefaultValue=false)] + [DataMember(Name = "preferenceCriterion", EmitDefaultValue = false)] public PreferenceCriterionEnum? PreferenceCriterion { get; set; } /// /// Defines ProducerDetermination @@ -139,7 +139,7 @@ public enum ProducerDeterminationEnum /// /// Gets or Sets ProducerDetermination /// - [DataMember(Name="producerDetermination", EmitDefaultValue=false)] + [DataMember(Name = "producerDetermination", EmitDefaultValue = false)] public ProducerDeterminationEnum? ProducerDetermination { get; set; } /// /// Initializes a new instance of the class. @@ -149,8 +149,18 @@ protected CustomsItem() { } /// /// Initializes a new instance of the class. /// + /// brand. + /// condition. /// description (required). + /// eccn. + /// hazmats. /// hSTariffCode. + /// hSTariffCodeCountry. + /// identifiers. + /// imageURL. + /// itemDimension. + /// itemId (required). + /// manufacturer. /// netCostMethod. /// originCountryCode (required). /// originStateProvince. @@ -162,7 +172,8 @@ protected CustomsItem() { } /// quantityUOM. /// unitPrice (required). /// unitWeight (required). - public CustomsItem(string description = default(string), string hSTariffCode = default(string), NetCostMethodEnum? netCostMethod = default(NetCostMethodEnum?), string originCountryCode = default(string), string originStateProvince = default(string), PreferenceCriterionEnum? preferenceCriterion = default(PreferenceCriterionEnum?), Address producerAddress = default(Address), ProducerDeterminationEnum? producerDetermination = default(ProducerDeterminationEnum?), string producerId = default(string), int quantity = default(int), string quantityUOM = default(string), decimal unitPrice = default(decimal), ParcelWeight unitWeight = default(ParcelWeight)) + /// url. + public CustomsItem(string brand = default(string), string condition = default(string), string description = default(string), string eccn = default(string), List hazmats = default(List),string hSTariffCode = default(string), HSTariffCodeCountryEnum? hSTariffCodeCountry = default(HSTariffCodeCountryEnum?), List identifiers = default(List), List imageURL = default(List), Dimension itemDimension = default(Dimension), string itemId = default(itemId), string manufacturer = default(manufacturer), NetCostMethodEnum? netCostMethod = default(NetCostMethodEnum?), string originCountryCode = default(string), string originStateProvince = default(string), PreferenceCriterionEnum? preferenceCriterion = default(PreferenceCriterionEnum?), Address producerAddress = default(Address), ProducerDeterminationEnum? producerDetermination = default(ProducerDeterminationEnum?), string producerId = default(string), int quantity = default(int), string quantityUOM = default(string), decimal unitPrice = default(decimal), ParcelWeight unitWeight = default(ParcelWeight)), string url = default(url) { // to ensure "description" is required (not null) if (description == null) @@ -173,7 +184,17 @@ protected CustomsItem() { } { this.Description = description; } - + + // to ensure "itemId" is required (not null) + if (itemId == null) + { + throw new InvalidDataException("itemId is a required property for CustomsItem and cannot be null"); + } + else + { + this.ItemId = itemId; + } + // to ensure "originCountryCode" is required (not null) if (originCountryCode == null) { @@ -183,7 +204,7 @@ protected CustomsItem() { } { this.OriginCountryCode = originCountryCode; } - + // to ensure "quantity" is required (not null) if (quantity == null) { @@ -193,7 +214,7 @@ protected CustomsItem() { } { this.Quantity = quantity; } - + // to ensure "unitPrice" is required (not null) if (unitPrice == null) { @@ -203,7 +224,7 @@ protected CustomsItem() { } { this.UnitPrice = unitPrice; } - + // to ensure "unitWeight" is required (not null) if (unitWeight == null) { @@ -213,8 +234,18 @@ protected CustomsItem() { } { this.UnitWeight = unitWeight; } - + + this.Brand = brand; + this.Condition = condition; + this.Eccn = eccn; + this.Hazmats = hazmats; this.HSTariffCode = hSTariffCode; + this.HSTariffCodeCountry = hSTariffCodeCountry; + this.Identifiers = identifiers; + this.ImageURL = imageURl; + this.ItemDimension = itemDimension; + this.ItemId = itemId; + this.Manufacturer = manufacturer; this.NetCostMethod = netCostMethod; this.OriginStateProvince = originStateProvince; this.PreferenceCriterion = preferenceCriterion; @@ -222,81 +253,153 @@ protected CustomsItem() { } this.ProducerDetermination = producerDetermination; this.ProducerId = producerId; this.QuantityUOM = quantityUOM; + this.Url = url; } - + + /// + /// Gets or Sets Brand + /// + [DataMember(Name = "brand", EmitDefaultValue = false)] + public string Brand { get; set; } + + /// + /// Gets or Sets Condition + /// + [DataMember(Name = "condition", EmitDefaultValue = false)] + public string Condition { get; set; } + + /// /// Gets or Sets Description /// - [DataMember(Name="description", EmitDefaultValue=true)] + [DataMember(Name = "description", EmitDefaultValue = true)] public string Description { get; set; } + /// + /// Gets or Sets Eccn + /// + [DataMember(Name = "eccn", EmitDefaultValue = false)] + public string Eccn { get; set; } + /// /// Gets or Sets HSTariffCode /// - [DataMember(Name="hSTariffCode", EmitDefaultValue=false)] + [DataMember(Name = "hSTariffCode", EmitDefaultValue = false)] public string HSTariffCode { get; set; } + /// + /// Gets or Sets HSTariffCodeCountry + /// + [DataMember(Name = "hSTariffCodeCountry", EmitDefaultValue = false)] + public string HSTariffCodeCountry { get; set; } + + /// + /// Gets or Sets Identifiers + /// + [DataMember(Name = "identifiers", EmitDefaultValue = false)] + public string Identifiers { get; set; } + + /// + /// Gets or Sets ImageURL + /// + [DataMember(Name = "imageURL", EmitDefaultValue = false)] + public string ImageURL { get; set; } + + /// + /// Gets or Sets ItemDimension + /// + [DataMember(Name = "itemDimension", EmitDefaultValue = false)] + public string ItemDimension { get; set; } + + /// + /// Gets or Sets ItemId + /// + [DataMember(Name = "itemId", EmitDefaultValue = true)] + public string ItemId { get; set; } + + /// + /// Gets or Sets Manufacturer + /// + [DataMember(Name = "manufacturer", EmitDefaultValue = false)] + public string Manufacturer { get; set; } + /// /// Gets or Sets OriginCountryCode /// - [DataMember(Name="originCountryCode", EmitDefaultValue=true)] + [DataMember(Name = "originCountryCode", EmitDefaultValue = true)] public string OriginCountryCode { get; set; } /// /// Gets or Sets OriginStateProvince /// - [DataMember(Name="originStateProvince", EmitDefaultValue=false)] + [DataMember(Name = "originStateProvince", EmitDefaultValue = false)] public string OriginStateProvince { get; set; } /// /// Gets or Sets ProducerAddress /// - [DataMember(Name="producerAddress", EmitDefaultValue=false)] + [DataMember(Name = "producerAddress", EmitDefaultValue = false)] public Address ProducerAddress { get; set; } /// /// Gets or Sets ProducerId /// - [DataMember(Name="producerId", EmitDefaultValue=false)] + [DataMember(Name = "producerId", EmitDefaultValue = false)] public string ProducerId { get; set; } /// /// Gets or Sets Quantity /// - [DataMember(Name="quantity", EmitDefaultValue=true)] + [DataMember(Name = "quantity", EmitDefaultValue = true)] public int Quantity { get; set; } /// /// Gets or Sets QuantityUOM /// - [DataMember(Name="quantityUOM", EmitDefaultValue=false)] + [DataMember(Name = "quantityUOM", EmitDefaultValue = false)] public string QuantityUOM { get; set; } /// /// Gets or Sets UnitPrice /// - [DataMember(Name="unitPrice", EmitDefaultValue=true)] + [DataMember(Name = "unitPrice", EmitDefaultValue = true)] public decimal UnitPrice { get; set; } /// /// Gets or Sets UnitWeight /// - [DataMember(Name="unitWeight", EmitDefaultValue=true)] + [DataMember(Name = "unitWeight", EmitDefaultValue = true)] public ParcelWeight UnitWeight { get; set; } + /// - /// Returns the string presentation of the object + /// Gets or Sets Url /// - /// String presentation of the object - public override string ToString() + [DataMember(Name = "url", EmitDefaultValue = true)] + public ParcelWeight Url { get; set; } + + /// + /// Returns the string presentation of the object + /// +/// String presentation of the object +public override string ToString() { var sb = new StringBuilder(); sb.Append("class CustomsItem {\n"); + sb.Append(" Brand: ").Append(Brand).Append("\n"); + sb.Append(" Condition: ").Append(Condition).Append("\n"); sb.Append(" Description: ").Append(Description).Append("\n"); + sb.Append(" Eccn: ").Append(Eccn).Append("\n"); + sb.Append(" Hazmats: ").Append(Hazmats).Append("\n"); sb.Append(" HSTariffCode: ").Append(HSTariffCode).Append("\n"); + sb.Append(" Identifiers: ").Append(Identifiers).Append("\n"); + sb.Append(" ImageURL: ").Append(ImageURL).Append("\n"); + sb.Append(" ItemDimension: ").Append(ItemDimension).Append("\n"); + sb.Append(" ItemId: ").Append(ItemId).Append("\n"); + sb.Append(" Manufacturer: ").Append(Manufacturer).Append("\n"); sb.Append(" NetCostMethod: ").Append(NetCostMethod).Append("\n"); sb.Append(" OriginCountryCode: ").Append(OriginCountryCode).Append("\n"); sb.Append(" OriginStateProvince: ").Append(OriginStateProvince).Append("\n"); @@ -308,10 +411,11 @@ public override string ToString() sb.Append(" QuantityUOM: ").Append(QuantityUOM).Append("\n"); sb.Append(" UnitPrice: ").Append(UnitPrice).Append("\n"); sb.Append(" UnitWeight: ").Append(UnitWeight).Append("\n"); + sb.Append(" Url: ").Append(Url).Append("\n"); sb.Append("}\n"); return sb.ToString(); } - + /// /// Returns the JSON string presentation of the object /// @@ -341,71 +445,126 @@ public bool Equals(CustomsItem input) if (input == null) return false; - return + return + ( + this.Brand == input.Brand || + (this.Brand != null && + this.Brand.Equals(input.Brand)) + ) && + ( + this.Condition == input.Condition || + (this.Condition != null && + this.Condition.Equals(input.Condition)) + ) && ( this.Description == input.Description || (this.Description != null && this.Description.Equals(input.Description)) - ) && + ) && + ( + this.Description == input.Description || + (this.Description != null && + this.Description.Equals(input.Description)) + ) && + ( + this.Eccn == input.Eccn || + (this.Eccn != null && + this.Eccn.Equals(input.Eccn)) + ) && ( this.HSTariffCode == input.HSTariffCode || (this.HSTariffCode != null && this.HSTariffCode.Equals(input.HSTariffCode)) - ) && + ) && + ( + this.HSTariffCodeCountry == input.HSTariffCodeCountry || + (this.HSTariffCodeCountry != null && + this.HSTariffCodeCountry.Equals(input.HSTariffCodeCountry)) + ) && + ( + this.Identifiers == input.Identifiers || + (this.Identifiers != null && + this.Identifiers.Equals(input.Identifiers)) + ) && + ( + this.ImageURL == input.ImageURL || + (this.ImageURL != null && + this.ImageURL.Equals(input.ImageURL)) + ) && + ( + this.ItemDimension == input.ItemDimension || + (this.ItemDimension != null && + this.ItemDimension.Equals(input.ItemDimension)) + ) && + ( + this.ItemId == input.ItemId || + (this.ItemId != null && + this.ItemId.Equals(input.ItemId)) + ) && + ( + this.Manufacturer == input.Manufacturer || + (this.Manufacturer != null && + this.Manufacturer.Equals(input.Manufacturer)) + ) && ( this.NetCostMethod == input.NetCostMethod || (this.NetCostMethod != null && this.NetCostMethod.Equals(input.NetCostMethod)) - ) && + ) && ( this.OriginCountryCode == input.OriginCountryCode || (this.OriginCountryCode != null && this.OriginCountryCode.Equals(input.OriginCountryCode)) - ) && + ) && ( this.OriginStateProvince == input.OriginStateProvince || (this.OriginStateProvince != null && this.OriginStateProvince.Equals(input.OriginStateProvince)) - ) && + ) && ( this.PreferenceCriterion == input.PreferenceCriterion || (this.PreferenceCriterion != null && this.PreferenceCriterion.Equals(input.PreferenceCriterion)) - ) && + ) && ( this.ProducerAddress == input.ProducerAddress || (this.ProducerAddress != null && this.ProducerAddress.Equals(input.ProducerAddress)) - ) && + ) && ( this.ProducerDetermination == input.ProducerDetermination || (this.ProducerDetermination != null && this.ProducerDetermination.Equals(input.ProducerDetermination)) - ) && + ) && ( this.ProducerId == input.ProducerId || (this.ProducerId != null && this.ProducerId.Equals(input.ProducerId)) - ) && + ) && ( this.Quantity == input.Quantity || (this.Quantity != null && this.Quantity.Equals(input.Quantity)) - ) && + ) && ( this.QuantityUOM == input.QuantityUOM || (this.QuantityUOM != null && this.QuantityUOM.Equals(input.QuantityUOM)) - ) && + ) && ( this.UnitPrice == input.UnitPrice || (this.UnitPrice != null && this.UnitPrice.Equals(input.UnitPrice)) - ) && + ) && ( this.UnitWeight == input.UnitWeight || (this.UnitWeight != null && this.UnitWeight.Equals(input.UnitWeight)) + ) && + ( + this.Url == input.Url || + (this.Url != null && + this.Url.Equals(input.Url)) ); } @@ -418,10 +577,30 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; + if (this.Brand != null) + hashCode = hashCode * 59 + this.Brand.GetHashCode(); + if (this.Condition != null) + hashCode = hashCode * 59 + this.Condition.GetHashCode(); if (this.Description != null) hashCode = hashCode * 59 + this.Description.GetHashCode(); + if (this.Eccn != null) + hashCode = hashCode * 59 + this.Eccn.GetHashCode(); + if (this.Hazmats != null) + hashCode = hashCode * 59 + this.Hazmats.GetHashCode(); if (this.HSTariffCode != null) hashCode = hashCode * 59 + this.HSTariffCode.GetHashCode(); + if (this.HSTariffCodeCountry != null) + hashCode = hashCode * 59 + this.HSTariffCodeCountry.GetHashCode(); + if (this.Identifiers != null) + hashCode = hashCode * 59 + this.Identifiers.GetHashCode(); + if (this.ImageURL != null) + hashCode = hashCode * 59 + this.ImageURL.GetHashCode(); + if (this.ItemDimension != null) + hashCode = hashCode * 59 + this.ItemDimension.GetHashCode(); + if (this.ItemId != null) + hashCode = hashCode * 59 + this.ItemId.GetHashCode(); + if (this.Manufacturer != null) + hashCode = hashCode * 59 + this.Manufacturer.GetHashCode(); if (this.NetCostMethod != null) hashCode = hashCode * 59 + this.NetCostMethod.GetHashCode(); if (this.OriginCountryCode != null) @@ -444,6 +623,8 @@ public override int GetHashCode() hashCode = hashCode * 59 + this.UnitPrice.GetHashCode(); if (this.UnitWeight != null) hashCode = hashCode * 59 + this.UnitWeight.GetHashCode(); + if (this.Url != null) + hashCode = hashCode * 59 + this.Url.GetHashCode(); return hashCode; } }