You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
283 lines
11 KiB
C#
283 lines
11 KiB
C#
/*
|
|
* Amazon Shipping API
|
|
*
|
|
* The Amazon Shipping API is designed to support outbound shipping use cases both for orders originating on Amazon-owned marketplaces as well as external channels/marketplaces. With these APIs, you can request shipping rates, create shipments, cancel shipments, and track shipments.
|
|
*
|
|
* OpenAPI spec version: v2
|
|
*
|
|
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
*/
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.Runtime.Serialization;
|
|
using System.Text;
|
|
using System.Text.RegularExpressions;
|
|
using Newtonsoft.Json;
|
|
using Newtonsoft.Json.Converters;
|
|
|
|
namespace Amazon.SellingPartnerApiSDK.AmazonSpApiSDK.Models.ShippingV2
|
|
{
|
|
/// <summary>
|
|
/// Details related to any dangerous goods/items that are being shipped.
|
|
/// </summary>
|
|
[DataContract]
|
|
public partial class DangerousGoodsDetails : IEquatable<DangerousGoodsDetails>, IValidatableObject
|
|
{
|
|
/// <summary>
|
|
/// The specific packaging group of the item being shipped.
|
|
/// </summary>
|
|
/// <value>The specific packaging group of the item being shipped.</value>
|
|
[DataMember(Name = "packingGroup", EmitDefaultValue = false)]
|
|
public PackingGroupEnum? PackingGroup { get; set; }
|
|
|
|
/// <summary>
|
|
/// The specific packing instruction of the item being shipped.
|
|
/// </summary>
|
|
/// <value>The specific packing instruction of the item being shipped.</value>
|
|
[DataMember(Name = "packingInstruction", EmitDefaultValue = false)]
|
|
public PackingInstructionEnum? PackingInstruction { get; set; }
|
|
|
|
/// <summary>
|
|
/// The specific UNID of the item being shipped.
|
|
/// </summary>
|
|
/// <value>The specific UNID of the item being shipped.</value>
|
|
[DataMember(Name = "unitedNationsRegulatoryId", EmitDefaultValue = false)]
|
|
public string UnitedNationsRegulatoryId { get; set; }
|
|
|
|
/// <summary>
|
|
/// The specific regulatory class of the item being shipped.
|
|
/// </summary>
|
|
/// <value>The specific regulatory class of the item being shipped.</value>
|
|
[DataMember(Name = "transportationRegulatoryClass", EmitDefaultValue = false)]
|
|
public string TransportationRegulatoryClass { get; set; }
|
|
|
|
/// <summary>
|
|
/// Returns the string presentation of the object
|
|
/// </summary>
|
|
/// <returns>String presentation of the object</returns>
|
|
public override string ToString()
|
|
{
|
|
var sb = new StringBuilder();
|
|
sb.Append("class DangerousGoodsDetails {\n");
|
|
sb.Append(" UnitedNationsRegulatoryId: ").Append(UnitedNationsRegulatoryId).Append("\n");
|
|
sb.Append(" TransportationRegulatoryClass: ").Append(TransportationRegulatoryClass).Append("\n");
|
|
sb.Append(" PackingGroup: ").Append(PackingGroup).Append("\n");
|
|
sb.Append(" PackingInstruction: ").Append(PackingInstruction).Append("\n");
|
|
sb.Append("}\n");
|
|
return sb.ToString();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Returns the JSON string presentation of the object
|
|
/// </summary>
|
|
/// <returns>JSON string presentation of the object</returns>
|
|
public virtual string ToJson()
|
|
{
|
|
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Returns true if objects are equal
|
|
/// </summary>
|
|
/// <param name="input">Object to be compared</param>
|
|
/// <returns>Boolean</returns>
|
|
public override bool Equals(object input)
|
|
{
|
|
return this.Equals(input as DangerousGoodsDetails);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Returns true if DangerousGoodsDetails instances are equal
|
|
/// </summary>
|
|
/// <param name="input">Instance of DangerousGoodsDetails to be compared</param>
|
|
/// <returns>Boolean</returns>
|
|
public bool Equals(DangerousGoodsDetails input)
|
|
{
|
|
if (input == null)
|
|
return false;
|
|
|
|
return
|
|
(
|
|
this.UnitedNationsRegulatoryId == input.UnitedNationsRegulatoryId ||
|
|
(this.UnitedNationsRegulatoryId != null &&
|
|
this.UnitedNationsRegulatoryId.Equals(input.UnitedNationsRegulatoryId))
|
|
) &&
|
|
(
|
|
this.TransportationRegulatoryClass == input.TransportationRegulatoryClass ||
|
|
(this.TransportationRegulatoryClass != null &&
|
|
this.TransportationRegulatoryClass.Equals(input.TransportationRegulatoryClass))
|
|
) &&
|
|
(
|
|
this.PackingGroup == input.PackingGroup ||
|
|
(this.PackingGroup != null &&
|
|
this.PackingGroup.Equals(input.PackingGroup))
|
|
) &&
|
|
(
|
|
this.PackingInstruction == input.PackingInstruction ||
|
|
(this.PackingInstruction != null &&
|
|
this.PackingInstruction.Equals(input.PackingInstruction))
|
|
);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the hash code
|
|
/// </summary>
|
|
/// <returns>Hash code</returns>
|
|
public override int GetHashCode()
|
|
{
|
|
unchecked // Overflow is fine, just wrap
|
|
{
|
|
int hashCode = 41;
|
|
if (this.UnitedNationsRegulatoryId != null)
|
|
hashCode = hashCode * 59 + this.UnitedNationsRegulatoryId.GetHashCode();
|
|
if (this.TransportationRegulatoryClass != null)
|
|
hashCode = hashCode * 59 + this.TransportationRegulatoryClass.GetHashCode();
|
|
if (this.PackingGroup != null)
|
|
hashCode = hashCode * 59 + this.PackingGroup.GetHashCode();
|
|
if (this.PackingInstruction != null)
|
|
hashCode = hashCode * 59 + this.PackingInstruction.GetHashCode();
|
|
return hashCode;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To validate all properties of the instance
|
|
/// </summary>
|
|
/// <param name="validationContext">Validation context</param>
|
|
/// <returns>Validation Result</returns>
|
|
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(
|
|
ValidationContext validationContext)
|
|
{
|
|
// UnitedNationsRegulatoryId (string) pattern
|
|
Regex regexUnitedNationsRegulatoryId = new Regex(@"^(UN)[0-9]{4}$", RegexOptions.CultureInvariant);
|
|
if (false == regexUnitedNationsRegulatoryId.Match(this.UnitedNationsRegulatoryId).Success)
|
|
{
|
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult(
|
|
"Invalid value for UnitedNationsRegulatoryId, must match a pattern of " +
|
|
regexUnitedNationsRegulatoryId, new[] { "UnitedNationsRegulatoryId" });
|
|
}
|
|
|
|
// TransportationRegulatoryClass (string) pattern
|
|
Regex regexTransportationRegulatoryClass = new Regex(@"^[1-9](\\.[1-9])?$", RegexOptions.CultureInvariant);
|
|
if (false == regexTransportationRegulatoryClass.Match(this.TransportationRegulatoryClass).Success)
|
|
{
|
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult(
|
|
"Invalid value for TransportationRegulatoryClass, must match a pattern of " +
|
|
regexTransportationRegulatoryClass, new[] { "TransportationRegulatoryClass" });
|
|
}
|
|
|
|
yield break;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// The specific packaging group of the item being shipped.
|
|
/// </summary>
|
|
/// <value>The specific packaging group of the item being shipped.</value>
|
|
[JsonConverter(typeof(StringEnumConverter))]
|
|
public enum PackingGroupEnum
|
|
{
|
|
/// <summary>
|
|
/// Enum I for value: I
|
|
/// </summary>
|
|
[EnumMember(Value = "I")] I = 1,
|
|
|
|
/// <summary>
|
|
/// Enum II for value: II
|
|
/// </summary>
|
|
[EnumMember(Value = "II")] II = 2,
|
|
|
|
/// <summary>
|
|
/// Enum III for value: III
|
|
/// </summary>
|
|
[EnumMember(Value = "III")] III = 3
|
|
}
|
|
|
|
/// <summary>
|
|
/// The specific packing instruction of the item being shipped.
|
|
/// </summary>
|
|
/// <value>The specific packing instruction of the item being shipped.</value>
|
|
[JsonConverter(typeof(StringEnumConverter))]
|
|
public enum PackingInstructionEnum
|
|
{
|
|
/// <summary>
|
|
/// Enum PI965SECTIONIA for value: PI965_SECTION_IA
|
|
/// </summary>
|
|
[EnumMember(Value = "PI965_SECTION_IA")]
|
|
PI965SECTIONIA = 1,
|
|
|
|
/// <summary>
|
|
/// Enum PI965SECTIONIB for value: PI965_SECTION_IB
|
|
/// </summary>
|
|
[EnumMember(Value = "PI965_SECTION_IB")]
|
|
PI965SECTIONIB = 2,
|
|
|
|
/// <summary>
|
|
/// Enum PI965SECTIONII for value: PI965_SECTION_II
|
|
/// </summary>
|
|
[EnumMember(Value = "PI965_SECTION_II")]
|
|
PI965SECTIONII = 3,
|
|
|
|
/// <summary>
|
|
/// Enum PI966SECTIONI for value: PI966_SECTION_I
|
|
/// </summary>
|
|
[EnumMember(Value = "PI966_SECTION_I")]
|
|
PI966SECTIONI = 4,
|
|
|
|
/// <summary>
|
|
/// Enum PI966SECTIONII for value: PI966_SECTION_II
|
|
/// </summary>
|
|
[EnumMember(Value = "PI966_SECTION_II")]
|
|
PI966SECTIONII = 5,
|
|
|
|
/// <summary>
|
|
/// Enum PI967SECTIONI for value: PI967_SECTION_I
|
|
/// </summary>
|
|
[EnumMember(Value = "PI967_SECTION_I")]
|
|
PI967SECTIONI = 6,
|
|
|
|
/// <summary>
|
|
/// Enum PI967SECTIONII for value: PI967_SECTION_II
|
|
/// </summary>
|
|
[EnumMember(Value = "PI967_SECTION_II")]
|
|
PI967SECTIONII = 7,
|
|
|
|
/// <summary>
|
|
/// Enum PI968SECTIONIA for value: PI968_SECTION_IA
|
|
/// </summary>
|
|
[EnumMember(Value = "PI968_SECTION_IA")]
|
|
PI968SECTIONIA = 8,
|
|
|
|
/// <summary>
|
|
/// Enum PI968SECTIONIB for value: PI968_SECTION_IB
|
|
/// </summary>
|
|
[EnumMember(Value = "PI968_SECTION_IB")]
|
|
PI968SECTIONIB = 9,
|
|
|
|
/// <summary>
|
|
/// Enum PI969SECTIONI for value: PI969_SECTION_I
|
|
/// </summary>
|
|
[EnumMember(Value = "PI969_SECTION_I")]
|
|
PI969SECTIONI = 10,
|
|
|
|
/// <summary>
|
|
/// Enum PI969SECTIONII for value: PI969_SECTION_II
|
|
/// </summary>
|
|
[EnumMember(Value = "PI969_SECTION_II")]
|
|
PI969SECTIONII = 11,
|
|
|
|
/// <summary>
|
|
/// Enum PI970SECTIONI for value: PI970_SECTION_I
|
|
/// </summary>
|
|
[EnumMember(Value = "PI970_SECTION_I")]
|
|
PI970SECTIONI = 12,
|
|
|
|
/// <summary>
|
|
/// Enum PI970SECTIONII for value: PI970_SECTION_II
|
|
/// </summary>
|
|
[EnumMember(Value = "PI970_SECTION_II")]
|
|
PI970SECTIONII = 13
|
|
}
|
|
} |