Skip to content

Commit e0f42a0

Browse files
author
R Hudylko
committed
FulFillmentOutbound fixes + deprecation improvements
1 parent 29ba0c8 commit e0f42a0

File tree

9 files changed

+98
-185
lines changed

9 files changed

+98
-185
lines changed

Source/FikaAmazonAPI.SampleCode/CatalogItemsSample.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using FikaAmazonAPI.Utils;
2+
using System.ComponentModel;
23
using static FikaAmazonAPI.Utils.Constants;
34

45
namespace FikaAmazonAPI.SampleCode
@@ -12,7 +13,7 @@ public CatalogItemsSample(AmazonConnection amazonConnection)
1213
}
1314

1415
[Obsolete("This method deprecated in June 2022. Please use GetCatalogItem(ParameterGetCatalogItem parameterListCatalogItem) instead.", true)]
15-
public void GetCatalogItemAsync()
16+
public void GetCatalogItemAsync()
1617
{
1718
var item = amazonConnection.CatalogItem.GetCatalogItem("B00CZC5F0G");
1819

@@ -25,7 +26,7 @@ public void ListCatalogCategories()
2526
}
2627

2728
[Obsolete("This method deprecated in June 2022. Please use SearchCatalogItems202204 instead.", true)]
28-
public void ListCatalogItems()
29+
public void ListCatalogItems()
2930
{
3031
var items = amazonConnection.CatalogItem.ListCatalogItems(new Parameter.CatalogItems.ParameterListCatalogItems()
3132
{

Source/FikaAmazonAPI/AmazonSpApiSDK/Models/FulfillmentOutbound/CreateFulfillmentOrderRequest.cs

Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
using Newtonsoft.Json;
1212
using System;
1313
using System.Collections.Generic;
14+
using System.ComponentModel;
1415
using System.ComponentModel.DataAnnotations;
1516
using System.IO;
1617
using System.Runtime.Serialization;
@@ -29,11 +30,19 @@ public partial class CreateFulfillmentOrderRequest : IEquatable<CreateFulfillmen
2930
/// </summary>
3031
/// <value>The shipping method for the fulfillment order.</value>
3132
[DataMember(Name = "shippingSpeedCategory", EmitDefaultValue = false)]
32-
public string ShippingSpeedCategory { get; set; }
33-
/// <summary>
34-
/// Gets or Sets FulfillmentAction
35-
/// </summary>
36-
[DataMember(Name = "fulfillmentAction", EmitDefaultValue = false)]
33+
[Obsolete("Use ShippingSpeedCategoryMethod instead")]
34+
[EditorBrowsable(EditorBrowsableState.Never)]
35+
public string ShippingSpeedCategory { get; set; }
36+
public ShippingSpeedCategory ShippingSpeedCategoryMethod {
37+
#pragma warning disable 0618
38+
get => (ShippingSpeedCategory)Enum.Parse(typeof(ShippingSpeedCategory), ShippingSpeedCategory, true);
39+
set => ShippingSpeedCategory = value.ToString();
40+
#pragma warning restore 0618
41+
}
42+
/// <summary>
43+
/// Gets or Sets FulfillmentAction
44+
/// </summary>
45+
[DataMember(Name = "fulfillmentAction", EmitDefaultValue = false)]
3746
public FulfillmentAction? FulfillmentAction { get; set; }
3847
/// <summary>
3948
/// Gets or Sets FulfillmentPolicy
@@ -63,7 +72,7 @@ public CreateFulfillmentOrderRequest() { }
6372
/// <param name="ShipFromCountryCode">The two-character country code for the country from which the fulfillment order ships. Must be in ISO 3166-1 alpha-2 format..</param>
6473
/// <param name="NotificationEmailList">NotificationEmailList.</param>
6574
/// <param name="Items">A list of items to include in the fulfillment order preview, including quantity. (required).</param>
66-
public CreateFulfillmentOrderRequest(string MarketplaceId = default(string), string SellerFulfillmentOrderId = default(string), string DisplayableOrderId = default(string), DateTime DisplayableOrderDate = default(DateTime), string DisplayableOrderComment = default(string), string ShippingSpeedCategory = null, DeliveryWindow DeliveryWindow = default(DeliveryWindow), Address DestinationAddress = default(Address), FulfillmentAction? FulfillmentAction = default(FulfillmentAction?), FulfillmentPolicy? FulfillmentPolicy = default(FulfillmentPolicy?), string FulfillmentMethod = default(string), CODSettings CODSettings = default(CODSettings), string ShipFromCountryCode = default(string), NotificationEmailList NotificationEmails = default(NotificationEmailList), CreateFulfillmentOrderItemList Items = default(CreateFulfillmentOrderItemList))
75+
public CreateFulfillmentOrderRequest(string MarketplaceId = default(string), string SellerFulfillmentOrderId = default(string), string DisplayableOrderId = default(string), DateTime? DisplayableOrderDate = default(DateTime?), string DisplayableOrderComment = default(string), string ShippingSpeedCategory = null, DeliveryWindow DeliveryWindow = default(DeliveryWindow), Address DestinationAddress = default(Address), FulfillmentAction? FulfillmentAction = default(FulfillmentAction?), FulfillmentPolicy? FulfillmentPolicy = default(FulfillmentPolicy?), string FulfillmentMethod = default(string), CODSettings CODSettings = default(CODSettings), string ShipFromCountryCode = default(string), NotificationEmailList NotificationEmails = default(NotificationEmailList), CreateFulfillmentOrderItemList Items = default(CreateFulfillmentOrderItemList))
6776
{
6877
// to ensure "SellerFulfillmentOrderId" is required (not null)
6978
if (SellerFulfillmentOrderId == null)
@@ -90,7 +99,7 @@ public CreateFulfillmentOrderRequest() { }
9099
}
91100
else
92101
{
93-
this.DisplayableOrderDate = DisplayableOrderDate;
102+
this.DisplayableOrderDate = DisplayableOrderDate.Value;
94103
}
95104
// to ensure "DisplayableOrderComment" is required (not null)
96105
if (DisplayableOrderComment == null)
@@ -108,10 +117,12 @@ public CreateFulfillmentOrderRequest() { }
108117
}
109118
else
110119
{
111-
this.ShippingSpeedCategory = ShippingSpeedCategory;
112-
}
113-
// to ensure "DestinationAddress" is required (not null)
114-
if (DestinationAddress == null)
120+
#pragma warning disable 0618
121+
this.ShippingSpeedCategory = ShippingSpeedCategory;
122+
#pragma warning restore 0618
123+
}
124+
// to ensure "DestinationAddress" is required (not null)
125+
if (DestinationAddress == null)
115126
{
116127
throw new InvalidDataException("DestinationAddress is a required property for CreateFulfillmentOrderRequest and cannot be null");
117128
}
@@ -132,7 +143,6 @@ public CreateFulfillmentOrderRequest() { }
132143
this.DeliveryWindow = DeliveryWindow;
133144
this.FulfillmentAction = FulfillmentAction;
134145
this.FulfillmentPolicy = FulfillmentPolicy;
135-
this.FulfillmentMethod = FulfillmentMethod;
136146
this.CODSettings = CODSettings;
137147
this.ShipFromCountryCode = ShipFromCountryCode;
138148
this.NotificationEmails = NotificationEmails;
@@ -189,13 +199,6 @@ public CreateFulfillmentOrderRequest() { }
189199

190200

191201

192-
/// <summary>
193-
/// Indicates the intended recipient channel for the order.
194-
/// </summary>
195-
/// <value>Indicates the intended recipient channel for the order.</value>
196-
[DataMember(Name = "FulfillmentMethod", EmitDefaultValue = false)]
197-
public string FulfillmentMethod { get; set; }
198-
199202
/// <summary>
200203
/// Gets or Sets CODSettings
201204
/// </summary>
@@ -235,12 +238,13 @@ public override string ToString()
235238
sb.Append(" DisplayableOrderId: ").Append(DisplayableOrderId).Append("\n");
236239
sb.Append(" DisplayableOrderDate: ").Append(DisplayableOrderDate).Append("\n");
237240
sb.Append(" DisplayableOrderComment: ").Append(DisplayableOrderComment).Append("\n");
238-
sb.Append(" ShippingSpeedCategory: ").Append(ShippingSpeedCategory).Append("\n");
239-
sb.Append(" DeliveryWindow: ").Append(DeliveryWindow).Append("\n");
241+
#pragma warning disable 0618
242+
sb.Append(" ShippingSpeedCategory: ").Append(ShippingSpeedCategory).Append("\n");
243+
#pragma warning restore 0618
244+
sb.Append(" DeliveryWindow: ").Append(DeliveryWindow).Append("\n");
240245
sb.Append(" DestinationAddress: ").Append(DestinationAddress).Append("\n");
241246
sb.Append(" FulfillmentAction: ").Append(FulfillmentAction).Append("\n");
242247
sb.Append(" FulfillmentPolicy: ").Append(FulfillmentPolicy).Append("\n");
243-
sb.Append(" FulfillmentMethod: ").Append(FulfillmentMethod).Append("\n");
244248
sb.Append(" CODSettings: ").Append(CODSettings).Append("\n");
245249
sb.Append(" ShipFromCountryCode: ").Append(ShipFromCountryCode).Append("\n");
246250
sb.Append(" NotificationEmails: ").Append(NotificationEmails).Append("\n");
@@ -305,10 +309,12 @@ public bool Equals(CreateFulfillmentOrderRequest input)
305309
this.DisplayableOrderComment.Equals(input.DisplayableOrderComment))
306310
) &&
307311
(
308-
this.ShippingSpeedCategory == input.ShippingSpeedCategory ||
312+
#pragma warning disable 0618
313+
this.ShippingSpeedCategory == input.ShippingSpeedCategory ||
309314
(this.ShippingSpeedCategory != null &&
310315
this.ShippingSpeedCategory.Equals(input.ShippingSpeedCategory))
311-
) &&
316+
#pragma warning restore 0618
317+
) &&
312318
(
313319
this.DeliveryWindow == input.DeliveryWindow ||
314320
(this.DeliveryWindow != null &&
@@ -329,11 +335,6 @@ public bool Equals(CreateFulfillmentOrderRequest input)
329335
(this.FulfillmentPolicy != null &&
330336
this.FulfillmentPolicy.Equals(input.FulfillmentPolicy))
331337
) &&
332-
(
333-
this.FulfillmentMethod == input.FulfillmentMethod ||
334-
(this.FulfillmentMethod != null &&
335-
this.FulfillmentMethod.Equals(input.FulfillmentMethod))
336-
) &&
337338
(
338339
this.CODSettings == input.CODSettings ||
339340
(this.CODSettings != null &&
@@ -375,18 +376,18 @@ public override int GetHashCode()
375376
hashCode = hashCode * 59 + this.DisplayableOrderDate.GetHashCode();
376377
if (this.DisplayableOrderComment != null)
377378
hashCode = hashCode * 59 + this.DisplayableOrderComment.GetHashCode();
378-
if (this.ShippingSpeedCategory != null)
379+
#pragma warning disable 0618
380+
if (this.ShippingSpeedCategory != null)
379381
hashCode = hashCode * 59 + this.ShippingSpeedCategory.GetHashCode();
380-
if (this.DeliveryWindow != null)
382+
#pragma warning restore 0618
383+
if (this.DeliveryWindow != null)
381384
hashCode = hashCode * 59 + this.DeliveryWindow.GetHashCode();
382385
if (this.DestinationAddress != null)
383386
hashCode = hashCode * 59 + this.DestinationAddress.GetHashCode();
384387
if (this.FulfillmentAction != null)
385388
hashCode = hashCode * 59 + this.FulfillmentAction.GetHashCode();
386389
if (this.FulfillmentPolicy != null)
387390
hashCode = hashCode * 59 + this.FulfillmentPolicy.GetHashCode();
388-
if (this.FulfillmentMethod != null)
389-
hashCode = hashCode * 59 + this.FulfillmentMethod.GetHashCode();
390391
if (this.CODSettings != null)
391392
hashCode = hashCode * 59 + this.CODSettings.GetHashCode();
392393
if (this.ShipFromCountryCode != null)

Source/FikaAmazonAPI/AmazonSpApiSDK/Models/FulfillmentOutbound/FulfillmentPreviewShipment.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public FulfillmentPreviewShipment() { }
3737
/// <param name="EarliestArrivalDate">The earliest date that the shipment is expected to arrive at its destination. (required).</param>
3838
/// <param name="LatestArrivalDate">The latest date that the shipment is expected to arrive at its destination, in ISO 8601 date time format. (required).</param>
3939
/// <param name="FulfillmentPreviewItems">Information about the items in the shipment. (required).</param>
40-
public FulfillmentPreviewShipment(Timestamp EarliestShipDate = default(Timestamp), Timestamp LatestShipDate = default(Timestamp), Timestamp EarliestArrivalDate = default(Timestamp), Timestamp LatestArrivalDate = default(Timestamp), FulfillmentPreviewItemList FulfillmentPreviewItems = default(FulfillmentPreviewItemList))
40+
public FulfillmentPreviewShipment(DateTime? EarliestShipDate = default(DateTime?), DateTime? LatestShipDate = default(DateTime?), DateTime? EarliestArrivalDate = default(DateTime?), DateTime? LatestArrivalDate = default(DateTime?), FulfillmentPreviewItemList FulfillmentPreviewItems = default(FulfillmentPreviewItemList))
4141
{
4242
// to ensure "EarliestShipDate" is required (not null)
4343
if (EarliestShipDate == null)
@@ -46,7 +46,7 @@ public FulfillmentPreviewShipment() { }
4646
}
4747
else
4848
{
49-
this.EarliestShipDate = EarliestShipDate;
49+
this.EarliestShipDate = EarliestShipDate.Value;
5050
}
5151
// to ensure "LatestShipDate" is required (not null)
5252
if (LatestShipDate == null)
@@ -55,7 +55,7 @@ public FulfillmentPreviewShipment() { }
5555
}
5656
else
5757
{
58-
this.LatestShipDate = LatestShipDate;
58+
this.LatestShipDate = LatestShipDate.Value;
5959
}
6060
// to ensure "EarliestArrivalDate" is required (not null)
6161
if (EarliestArrivalDate == null)
@@ -64,7 +64,7 @@ public FulfillmentPreviewShipment() { }
6464
}
6565
else
6666
{
67-
this.EarliestArrivalDate = EarliestArrivalDate;
67+
this.EarliestArrivalDate = EarliestArrivalDate.Value;
6868
}
6969
// to ensure "LatestArrivalDate" is required (not null)
7070
if (LatestArrivalDate == null)
@@ -73,7 +73,7 @@ public FulfillmentPreviewShipment() { }
7373
}
7474
else
7575
{
76-
this.LatestArrivalDate = LatestArrivalDate;
76+
this.LatestArrivalDate = LatestArrivalDate.Value;
7777
}
7878
// to ensure "FulfillmentPreviewItems" is required (not null)
7979
if (FulfillmentPreviewItems == null)
@@ -91,28 +91,28 @@ public FulfillmentPreviewShipment() { }
9191
/// </summary>
9292
/// <value>The earliest date that the shipment is expected to be sent from the fulfillment center, in ISO 8601 date time format.</value>
9393
[DataMember(Name = "EarliestShipDate", EmitDefaultValue = false)]
94-
public Timestamp EarliestShipDate { get; set; }
94+
public DateTime EarliestShipDate { get; set; }
9595

9696
/// <summary>
9797
/// The latest date that the shipment is expected to be sent from the fulfillment center, in ISO 8601 date time format.
9898
/// </summary>
9999
/// <value>The latest date that the shipment is expected to be sent from the fulfillment center, in ISO 8601 date time format.</value>
100100
[DataMember(Name = "LatestShipDate", EmitDefaultValue = false)]
101-
public Timestamp LatestShipDate { get; set; }
101+
public DateTime LatestShipDate { get; set; }
102102

103103
/// <summary>
104104
/// The earliest date that the shipment is expected to arrive at its destination.
105105
/// </summary>
106106
/// <value>The earliest date that the shipment is expected to arrive at its destination.</value>
107107
[DataMember(Name = "EarliestArrivalDate", EmitDefaultValue = false)]
108-
public Timestamp EarliestArrivalDate { get; set; }
108+
public DateTime EarliestArrivalDate { get; set; }
109109

110110
/// <summary>
111111
/// The latest date that the shipment is expected to arrive at its destination, in ISO 8601 date time format.
112112
/// </summary>
113113
/// <value>The latest date that the shipment is expected to arrive at its destination, in ISO 8601 date time format.</value>
114114
[DataMember(Name = "LatestArrivalDate", EmitDefaultValue = false)]
115-
public Timestamp LatestArrivalDate { get; set; }
115+
public DateTime LatestArrivalDate { get; set; }
116116

117117
/// <summary>
118118
/// Information about the items in the shipment.

Source/FikaAmazonAPI/AmazonSpApiSDK/Models/FulfillmentOutbound/FulfillmentShipmentItem.cs

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -95,19 +95,27 @@ public FulfillmentShipmentItem() { }
9595
[DataMember(Name = "PackageNumber", EmitDefaultValue = false)]
9696
public int? PackageNumber { get; set; }
9797

98-
/// <summary>
99-
/// Returns the string presentation of the object
100-
/// </summary>
101-
/// <returns>String presentation of the object</returns>
102-
public override string ToString()
98+
/// <summary>
99+
/// The serial number of the shipped item.
100+
/// </summary>
101+
/// <value>The serial number of the shipped item.</value>
102+
[DataMember(Name = "SerialNumber", EmitDefaultValue = false)]
103+
public string SerialNumber { get; set; }
104+
105+
/// <summary>
106+
/// Returns the string presentation of the object
107+
/// </summary>
108+
/// <returns>String presentation of the object</returns>
109+
public override string ToString()
103110
{
104111
var sb = new StringBuilder();
105112
sb.Append("class FulfillmentShipmentItem {\n");
106113
sb.Append(" SellerSKU: ").Append(SellerSKU).Append("\n");
107114
sb.Append(" SellerFulfillmentOrderItemId: ").Append(SellerFulfillmentOrderItemId).Append("\n");
108115
sb.Append(" Quantity: ").Append(Quantity).Append("\n");
109116
sb.Append(" PackageNumber: ").Append(PackageNumber).Append("\n");
110-
sb.Append("}\n");
117+
sb.Append(" SerialNumber: ").Append(SerialNumber).Append("\n");
118+
sb.Append("}\n");
111119
return sb.ToString();
112120
}
113121

@@ -153,14 +161,18 @@ public bool Equals(FulfillmentShipmentItem input)
153161
) &&
154162
(
155163
this.Quantity == input.Quantity ||
156-
(this.Quantity != null &&
157-
this.Quantity.Equals(input.Quantity))
164+
(this.Quantity.Equals(input.Quantity))
158165
) &&
159166
(
160167
this.PackageNumber == input.PackageNumber ||
161168
(this.PackageNumber != null &&
162169
this.PackageNumber.Equals(input.PackageNumber))
163-
);
170+
) &&
171+
(
172+
this.SerialNumber == input.SerialNumber ||
173+
(this.SerialNumber != null &&
174+
this.SerialNumber.Equals(input.SerialNumber))
175+
);
164176
}
165177

166178
/// <summary>
@@ -176,11 +188,12 @@ public override int GetHashCode()
176188
hashCode = hashCode * 59 + this.SellerSKU.GetHashCode();
177189
if (this.SellerFulfillmentOrderItemId != null)
178190
hashCode = hashCode * 59 + this.SellerFulfillmentOrderItemId.GetHashCode();
179-
if (this.Quantity != null)
180-
hashCode = hashCode * 59 + this.Quantity.GetHashCode();
191+
hashCode = hashCode * 59 + this.Quantity.GetHashCode();
181192
if (this.PackageNumber != null)
182193
hashCode = hashCode * 59 + this.PackageNumber.GetHashCode();
183-
return hashCode;
194+
if (this.SerialNumber != null)
195+
hashCode = hashCode * 59 + this.SerialNumber.GetHashCode();
196+
return hashCode;
184197
}
185198
}
186199

0 commit comments

Comments
 (0)