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.
231 lines
9.3 KiB
C#
231 lines
9.3 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.IO;
|
|
using System.Linq;
|
|
using System.Runtime.Serialization;
|
|
using System.Text;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace Amazon.SellingPartnerApiSDK.AmazonSpApiSDK.Models.ShippingV2
|
|
{
|
|
/// <summary>
|
|
/// The payload for the getTracking operation.
|
|
/// </summary>
|
|
[DataContract]
|
|
public partial class GetTrackingResult : IEquatable<GetTrackingResult>, IValidatableObject
|
|
{
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="GetTrackingResult" /> class.
|
|
/// </summary>
|
|
[JsonConstructor]
|
|
protected GetTrackingResult() { }
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="GetTrackingResult" /> class.
|
|
/// </summary>
|
|
/// <param name="trackingId">trackingId (required).</param>
|
|
/// <param name="alternateLegTrackingId">alternateLegTrackingId (required).</param>
|
|
/// <param name="eventHistory">A list of tracking events. (required).</param>
|
|
/// <param name="promisedDeliveryDate">The date and time by which the shipment is promised to be delivered. (required).</param>
|
|
/// <param name="summary">summary (required).</param>
|
|
public GetTrackingResult(TrackingId trackingId = default(TrackingId), AlternateLegTrackingId alternateLegTrackingId = default(AlternateLegTrackingId), List<Event> eventHistory = default(List<Event>), DateTime? promisedDeliveryDate = default(DateTime?), TrackingSummary summary = default(TrackingSummary))
|
|
{
|
|
// to ensure "trackingId" is required (not null)
|
|
if (trackingId == null)
|
|
{
|
|
throw new InvalidDataException("trackingId is a required property for GetTrackingResult and cannot be null");
|
|
}
|
|
else
|
|
{
|
|
this.TrackingId = trackingId;
|
|
}
|
|
// to ensure "alternateLegTrackingId" is required (not null)
|
|
if (alternateLegTrackingId == null)
|
|
{
|
|
throw new InvalidDataException("alternateLegTrackingId is a required property for GetTrackingResult and cannot be null");
|
|
}
|
|
else
|
|
{
|
|
this.AlternateLegTrackingId = alternateLegTrackingId;
|
|
}
|
|
// to ensure "eventHistory" is required (not null)
|
|
if (eventHistory == null)
|
|
{
|
|
throw new InvalidDataException("eventHistory is a required property for GetTrackingResult and cannot be null");
|
|
}
|
|
else
|
|
{
|
|
this.EventHistory = eventHistory;
|
|
}
|
|
// to ensure "promisedDeliveryDate" is required (not null)
|
|
if (promisedDeliveryDate == null)
|
|
{
|
|
throw new InvalidDataException("promisedDeliveryDate is a required property for GetTrackingResult and cannot be null");
|
|
}
|
|
else
|
|
{
|
|
this.PromisedDeliveryDate = promisedDeliveryDate;
|
|
}
|
|
// to ensure "summary" is required (not null)
|
|
if (summary == null)
|
|
{
|
|
throw new InvalidDataException("summary is a required property for GetTrackingResult and cannot be null");
|
|
}
|
|
else
|
|
{
|
|
this.Summary = summary;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets or Sets TrackingId
|
|
/// </summary>
|
|
[DataMember(Name="trackingId", EmitDefaultValue=false)]
|
|
public TrackingId TrackingId { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or Sets AlternateLegTrackingId
|
|
/// </summary>
|
|
[DataMember(Name="alternateLegTrackingId", EmitDefaultValue=false)]
|
|
public AlternateLegTrackingId AlternateLegTrackingId { get; set; }
|
|
|
|
/// <summary>
|
|
/// A list of tracking events.
|
|
/// </summary>
|
|
/// <value>A list of tracking events.</value>
|
|
[DataMember(Name="eventHistory", EmitDefaultValue=false)]
|
|
public List<Event> EventHistory { get; set; }
|
|
|
|
/// <summary>
|
|
/// The date and time by which the shipment is promised to be delivered.
|
|
/// </summary>
|
|
/// <value>The date and time by which the shipment is promised to be delivered.</value>
|
|
[DataMember(Name="promisedDeliveryDate", EmitDefaultValue=false)]
|
|
public DateTime? PromisedDeliveryDate { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or Sets Summary
|
|
/// </summary>
|
|
[DataMember(Name="summary", EmitDefaultValue=false)]
|
|
public TrackingSummary Summary { 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 GetTrackingResult {\n");
|
|
sb.Append(" TrackingId: ").Append(TrackingId).Append("\n");
|
|
sb.Append(" AlternateLegTrackingId: ").Append(AlternateLegTrackingId).Append("\n");
|
|
sb.Append(" EventHistory: ").Append(EventHistory).Append("\n");
|
|
sb.Append(" PromisedDeliveryDate: ").Append(PromisedDeliveryDate).Append("\n");
|
|
sb.Append(" Summary: ").Append(Summary).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 GetTrackingResult);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Returns true if GetTrackingResult instances are equal
|
|
/// </summary>
|
|
/// <param name="input">Instance of GetTrackingResult to be compared</param>
|
|
/// <returns>Boolean</returns>
|
|
public bool Equals(GetTrackingResult input)
|
|
{
|
|
if (input == null)
|
|
return false;
|
|
|
|
return
|
|
(
|
|
this.TrackingId == input.TrackingId ||
|
|
(this.TrackingId != null &&
|
|
this.TrackingId.Equals(input.TrackingId))
|
|
) &&
|
|
(
|
|
this.AlternateLegTrackingId == input.AlternateLegTrackingId ||
|
|
(this.AlternateLegTrackingId != null &&
|
|
this.AlternateLegTrackingId.Equals(input.AlternateLegTrackingId))
|
|
) &&
|
|
(
|
|
this.EventHistory == input.EventHistory ||
|
|
this.EventHistory != null &&
|
|
this.EventHistory.SequenceEqual(input.EventHistory)
|
|
) &&
|
|
(
|
|
this.PromisedDeliveryDate == input.PromisedDeliveryDate ||
|
|
(this.PromisedDeliveryDate != null &&
|
|
this.PromisedDeliveryDate.Equals(input.PromisedDeliveryDate))
|
|
) &&
|
|
(
|
|
this.Summary == input.Summary ||
|
|
(this.Summary != null &&
|
|
this.Summary.Equals(input.Summary))
|
|
);
|
|
}
|
|
|
|
/// <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.TrackingId != null)
|
|
hashCode = hashCode * 59 + this.TrackingId.GetHashCode();
|
|
if (this.AlternateLegTrackingId != null)
|
|
hashCode = hashCode * 59 + this.AlternateLegTrackingId.GetHashCode();
|
|
if (this.EventHistory != null)
|
|
hashCode = hashCode * 59 + this.EventHistory.GetHashCode();
|
|
if (this.PromisedDeliveryDate != null)
|
|
hashCode = hashCode * 59 + this.PromisedDeliveryDate.GetHashCode();
|
|
if (this.Summary != null)
|
|
hashCode = hashCode * 59 + this.Summary.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)
|
|
{
|
|
yield break;
|
|
}
|
|
}
|
|
|
|
}
|