Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,17 @@ public enum IncludedDataEnum
[EnumMember(Value = "PACKAGES")]
PACKAGES = 8,

/// <summary>
/// Information about tax
/// </summary>
[EnumMember(Value = "TAX")]
TAX = 9,

/// <summary>
/// Information about payment
/// </summary>
[EnumMember(Value = "PAYMENT")]
PAYMENT = 10,
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ protected OrderItem() { }
/// <param name="promotion">Details about any discounts, coupons, or promotional offers applied to this item.</param>
/// <param name="cancellation">The cancellation information of the order item.</param>
/// <param name="fulfillment">Information about how the order item should be processed, packed, and shipped to the customer.</param>
/// <param name="tax">Tax information associated with this specific order item.</param>
public OrderItem(string orderItemId,
int quantityOrdered,
Measurement measurement,
Expand All @@ -44,7 +45,8 @@ public OrderItem(string orderItemId,
Expense expense,
Promotion promotion,
Cancellation cancellation,
OrderItemFulfillment fulfillment)
OrderItemFulfillment fulfillment,
OrderItemTax tax)
{
this.OrderItemId = orderItemId;
this.QuantityOrdered = quantityOrdered;
Expand All @@ -56,6 +58,7 @@ public OrderItem(string orderItemId,
this.Promotion = promotion;
this.Cancellation = cancellation;
this.Fulfillment = fulfillment;
this.Tax = tax;
}

/// <summary>
Expand Down Expand Up @@ -128,6 +131,14 @@ public OrderItem(string orderItemId,
[DataMember(Name = "fulfillment", EmitDefaultValue = false)]
public OrderItemFulfillment Fulfillment { get; set; }

/// <summary>
/// Tax information associated with this specific order item,
/// including the responsible party and the tax collection model.
/// </summary>
/// <value>Tax information associated with this specific order item.</value>
[DataMember(Name = "tax", EmitDefaultValue = false)]
public OrderItemTax Tax { get; set; }


/// <summary>
/// Returns the string presentation of the object
Expand All @@ -147,6 +158,7 @@ public override string ToString()
sb.Append(" Promotion: ").Append(Promotion).Append("\n");
sb.Append(" Cancellation: ").Append(Cancellation).Append("\n");
sb.Append(" Fulfillment: ").Append(Fulfillment).Append("\n");
sb.Append(" Tax: ").Append(Tax).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
Expand Down Expand Up @@ -230,6 +242,11 @@ public bool Equals(OrderItem input)
this.Fulfillment == input.Fulfillment ||
(this.Fulfillment != null &&
this.Fulfillment.Equals(input.Fulfillment))
) &&
(
this.Tax == input.Tax ||
(this.Tax != null &&
this.Tax.Equals(input.Tax))
);
}

Expand Down Expand Up @@ -262,6 +279,8 @@ public override int GetHashCode()
hashCode = hashCode * 59 + this.Cancellation.GetHashCode();
if (this.Fulfillment != null)
hashCode = hashCode * 59 + this.Fulfillment.GetHashCode();
if (this.Tax != null)
hashCode = hashCode * 59 + this.Tax.GetHashCode();
return hashCode;
}
}
Expand All @@ -277,4 +296,4 @@ public override int GetHashCode()
}
}

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;

namespace FikaAmazonAPI.AmazonSpApiSDK.Models.OrdersV20260101
{
/// <summary>
/// Represents tax information for an order item, containing a list of tax collections.
/// </summary>
[DataContract]
public partial class OrderItemTax : IEquatable<OrderItemTax>, IValidatableObject

Check warning on line 15 in Source/FikaAmazonAPI/AmazonSpApiSDK/Models/OrdersV20260101/OrderItemTax.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Seal class 'OrderItemTax' or implement 'IEqualityComparer<T>' instead.

See more on https://sonarcloud.io/project/issues?id=abuzuhri_Amazon-SP-API-CSharp&issues=AZ4HlLBC7qvV9dgbRyPq&open=AZ4HlLBC7qvV9dgbRyPq&pullRequest=938
{
/// <summary>
/// Initializes a new instance of the <see cref="OrderItemTax"/> class.
/// </summary>
public OrderItemTax()
{
}

/// <summary>
/// Initializes a new instance of the <see cref="OrderItemTax"/> class.
/// </summary>
/// <param name="orderItemTaxCollections">A list of tax collections associated with this order item.</param>
public OrderItemTax(List<OrderItemTaxCollection> orderItemTaxCollections)
{
this.TaxCollection = orderItemTaxCollections;
}

/// <summary>
/// A list of tax collections for this order item.
/// Each entry contains details about the responsible party and the tax model (e.g. MARKETPLACE_FACILITATOR).
/// </summary>
[DataMember(Name = "taxCollections", EmitDefaultValue = false)]
public List<OrderItemTaxCollection> TaxCollection { get; set; }

/// <summary>
/// Returns the string representation of the object.
/// </summary>
/// <returns>String representation of the object</returns>
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class OrderItemTax {\n");
sb.Append(" TaxCollection: ").Append(TaxCollection).Append("\n");
sb.Append("}\n");
return sb.ToString();
}

/// <summary>
/// Returns the JSON string representation of the object.
/// </summary>
/// <returns>JSON string representation of the object</returns>
public virtual string ToJson()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
}

/// <summary>
/// Returns true if the given object is equal to this instance.
/// </summary>
/// <param name="obj">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object obj)
{
return this.Equals(obj as OrderItemTax);
}

/// <summary>
/// Returns true if the given <see cref="OrderItemTax"/> instance is equal to this instance.
/// </summary>
/// <param name="input">Instance of <see cref="OrderItemTax"/> to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(OrderItemTax input)
{
if (input == null)
return false;

return
this.TaxCollection == input.TaxCollection ||
(this.TaxCollection != null &&
this.TaxCollection.SequenceEqual(input.TaxCollection));
}

/// <summary>
/// Returns the hash code for this instance.
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked
{
int hashCode = 41;
if (this.TaxCollection != null)
hashCode = hashCode * 59 + this.TaxCollection.GetHashCode();
return hashCode;
}
}

/// <summary>
/// Validates all properties of the instance.
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation results</returns>
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using System.Text;

namespace FikaAmazonAPI.AmazonSpApiSDK.Models.OrdersV20260101
{
/// <summary>
/// Represents a single tax collection entry for an order item,
/// containing the responsible party and the applied tax model.
/// </summary>
[DataContract]
public partial class OrderItemTaxCollection : IEquatable<OrderItemTaxCollection>, IValidatableObject

Check warning on line 16 in Source/FikaAmazonAPI/AmazonSpApiSDK/Models/OrdersV20260101/OrderItemTaxCollection.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Seal class 'OrderItemTaxCollection' or implement 'IEqualityComparer<T>' instead.

See more on https://sonarcloud.io/project/issues?id=abuzuhri_Amazon-SP-API-CSharp&issues=AZ4HlLBe7qvV9dgbRyPr&open=AZ4HlLBe7qvV9dgbRyPr&pullRequest=938
{
/// <summary>
/// Initializes a new instance of the <see cref="OrderItemTaxCollection"/> class.
/// </summary>
public OrderItemTaxCollection()
{
}

/// <summary>
/// Initializes a new instance of the <see cref="OrderItemTaxCollection"/> class.
/// </summary>
/// <param name="responsibleParty">The party responsible for collecting the tax (e.g. "Amazon EU S.a.r.L.").</param>
/// <param name="model">The tax collection model applied to this order item.</param>
public OrderItemTaxCollection(string responsibleParty, OrderItemTaxCollectionEnum? model = null)
{
this.ResponsibleParty = responsibleParty;
this.Model = model;
}

/// <summary>
/// The party responsible for collecting the tax for this order item (e.g. "Amazon EU S.a.r.L.").
/// </summary>
[DataMember(Name = "responsibleParty", EmitDefaultValue = false)]
public string ResponsibleParty { get; set; }

/// <summary>
/// The tax collection model applied to this order item.
/// </summary>
[DataMember(Name = "model", EmitDefaultValue = false)]
public OrderItemTaxCollectionEnum? Model { get; set; }

/// <summary>
/// Returns the string representation of the object.
/// </summary>
/// <returns>String representation of the object</returns>
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class OrderItemTaxCollection {\n");
sb.Append(" ResponsibleParty: ").Append(ResponsibleParty).Append("\n");
sb.Append(" Model: ").Append(Model).Append("\n");
sb.Append("}\n");
return sb.ToString();
}

/// <summary>
/// Returns the JSON string representation of the object.
/// </summary>
/// <returns>JSON string representation of the object</returns>
public virtual string ToJson()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
}

/// <summary>
/// Returns true if the given object is equal to this instance.
/// </summary>
/// <param name="obj">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object obj)
{
return this.Equals(obj as OrderItemTaxCollection);
}

/// <summary>
/// Returns true if the given <see cref="OrderItemTaxCollection"/> instance is equal to this instance.
/// </summary>
/// <param name="input">Instance of <see cref="OrderItemTaxCollection"/> to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(OrderItemTaxCollection input)
{
if (input == null)
return false;

return
(
this.ResponsibleParty == input.ResponsibleParty ||
(this.ResponsibleParty != null &&
this.ResponsibleParty.Equals(input.ResponsibleParty))
) &&
(
this.Model == input.Model
);
}

/// <summary>
/// Returns the hash code for this instance.
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked
{
int hashCode = 41;
if (this.ResponsibleParty != null)
hashCode = hashCode * 59 + this.ResponsibleParty.GetHashCode();
hashCode = hashCode * 59 + this.Model.GetHashCode();
return hashCode;
}
}

/// <summary>
/// Validates all properties of the instance.
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation results</returns>
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Text;

namespace FikaAmazonAPI.AmazonSpApiSDK.Models.OrdersV20260101
{
/// <summary>
/// Specifies the tax collection model applied to this order item.
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum OrderItemTaxCollectionEnum

Check warning on line 14 in Source/FikaAmazonAPI/AmazonSpApiSDK/Models/OrdersV20260101/OrderItemTaxCollectionEnum.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this enumeration to remove the 'Enum' suffix.

See more on https://sonarcloud.io/project/issues?id=abuzuhri_Amazon-SP-API-CSharp&issues=AZ4HlK8z7qvV9dgbRyPp&open=AZ4HlK8z7qvV9dgbRyPp&pullRequest=938
{
/// <summary>
/// Tax is collected by the marketplace facilitator.
/// </summary>
[EnumMember(Value = "MARKETPLACE_FACILITATOR")]
MARKETPLACE_FACILITATOR = 1
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Text;


namespace FikaAmazonAPI.AmazonSpApiSDK.Models.OrdersV20260101
{
Expand All @@ -19,6 +17,12 @@ public enum PriceDesignationEnum
/// </summary>
[EnumMember(Value = "BUSINESS_PRICE")]
BUSINESS_PRICE = 1,

/// <summary>
/// Enum value for type QUANTITY_PRICE
/// </summary>
[EnumMember(Value = "QUANTITY_PRICE")]
QUANTITY_PRICE = 2
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ public enum ProgramEnum
/// </summary>
[EnumMember(Value = "PRIME")]
PRIME = 10,

/// <summary>
/// Enum value for type INVOICE_BY_AMAZON
/// </summary>
[EnumMember(Value = "INVOICE_BY_AMAZON")]
INVOICE_BY_AMAZON = 11
}

}
Loading