Skip to content

Commit cf102aa

Browse files
authored
Merge pull request #230 from CrineTech/CrineTech
Updated NotificationMessages.Offer and NotificationMessages.OfferElement
2 parents f46f5ad + 5552e33 commit cf102aa

39 files changed

+451
-379
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,19 @@ var dataSqs = amazonConnection.Notification.CreateDestination(
348348
});
349349
```
350350

351+
### Notifications Create Subscription, For more Notifications sample please check [Here](https://github.com/abuzuhri/Amazon-SP-API-CSharp/blob/main/Source/FikaAmazonAPI.Test/Notifications.cs).
352+
```CSharp
353+
354+
//SQS
355+
var result = amazonConnection.Notification.CreateSubscription(
356+
new ParameterCreateSubscription()
357+
{
358+
destinationId = "xxxxxxxxxxxxxxx", // take this from CreateDestination or GetDestinations response
359+
notificationType = NotificationType.ANY_OFFER_CHANGED, // or B2B_ANY_OFFER_CHANGED for B2B prices
360+
payloadVersion = "1.0"
361+
});
362+
```
363+
351364
### Notifications read messages
352365
```CSharp
353366

Source/FikaAmazonAPI.SampleCode/NotificationsSample.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,19 @@ public void CreateDestination()
5656
Sqs = new AmazonSpApiSDK.Models.Notifications.SqsResource("arn:aws:sqs:us-east-2:9999999999999:NAME")
5757
}
5858
});
59+
}
60+
5961

62+
public void CreateSubscription()
63+
{
64+
//SQS
65+
var result = amazonConnection.Notification.CreateSubscription(
66+
new ParameterCreateSubscription()
67+
{
68+
destinationId = "xxxxxxxxxxxxxxx", // take this from CreateDestination or GetDestinations response
69+
notificationType = NotificationType.ANY_OFFER_CHANGED, // or B2B_ANY_OFFER_CHANGED for B2B prices
70+
payloadVersion = "1.0"
71+
});
6072
}
6173

6274

Source/FikaAmazonAPI/NotificationMessages/AnyOfferChangedNotification.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,28 @@ namespace FikaAmazonAPI.NotificationMessages
1010
public partial class AnyOfferChangedNotification
1111
{
1212
/// <summary>
13-
/// An explanation about the purpose of this instance.
13+
/// Required. The seller identifier for the offer.
1414
/// </summary>
15-
[JsonProperty("OfferChangeTrigger")]
16-
public OfferChangeTrigger OfferChangeTrigger { get; set; }
15+
[JsonProperty("SellerId")]
16+
public string SellerId { get; set; }
1717

1818
/// <summary>
19-
/// An explanation about the purpose of this instance.
19+
/// Required. The event that caused the notification to be sent.
2020
/// </summary>
21-
[JsonProperty("Offers")]
22-
public List<OfferElement> Offers { get; set; }
21+
[JsonProperty("OfferChangeTrigger")]
22+
public OfferChangeTriggerB2C OfferChangeTrigger { get; set; }
2323

2424
/// <summary>
25-
/// An explanation about the purpose of this instance.
25+
/// Required. Information about the product that had the offer change. The information in this summary applies to all conditions of the product.
2626
/// </summary>
27-
[JsonProperty("SellerId")]
28-
public string SellerId { get; set; }
27+
[JsonProperty("Summary")]
28+
public SummaryB2C Summary { get; set; }
2929

3030
/// <summary>
31-
/// An explanation about the purpose of this instance.
31+
/// Required. The top 20 competitive offers for the item and condition that triggered the notification.
3232
/// </summary>
33-
[JsonProperty("Summary")]
34-
public Summary Summary { get; set; }
33+
[JsonProperty("Offers")]
34+
public List<OfferB2C> Offers { get; set; }
3535
}
3636

3737
}
Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,33 @@
11
using System.Collections.Generic;
2+
using Newtonsoft.Json;
23

34
namespace FikaAmazonAPI.NotificationMessages
45
{
56
public partial class B2BAnyOfferChangedNotification
67
{
8+
/// <summary>
9+
/// Required. The seller identifier for the offer.
10+
/// </summary>
11+
[JsonProperty("SellerId")]
712
public string SellerId { get; set; }
8-
public OfferChangeTrigger OfferChangeTrigger { get; set; }
9-
public Summary Summary { get; set; }
10-
public List<Offer> Offers { get; set; }
13+
14+
/// <summary>
15+
/// Required. The event that caused the notification to be sent.
16+
/// </summary>
17+
[JsonProperty("OfferChangeTrigger")]
18+
public OfferChangeTriggerB2B OfferChangeTrigger { get; set; }
19+
20+
/// <summary>
21+
/// Required. Information about the product that had the offer change. The information in this summary applies to all conditions of the product.
22+
/// </summary>
23+
[JsonProperty("Summary")]
24+
public SummaryB2B Summary { get; set; }
25+
26+
/// <summary>
27+
/// Required. The top 20 competitive B2B offers for the item and condition that triggered the notification.
28+
/// </summary>
29+
[JsonProperty("Offers")]
30+
public List<OfferB2B> Offers { get; set; }
1131
}
1232

1333
}

Source/FikaAmazonAPI/NotificationMessages/BuyBoxEligibleOfferElement.cs

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace FikaAmazonAPI.NotificationMessages
2+
{
3+
public class BuyBoxPriceB2B : PriceBaseB2B
4+
{
5+
}
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace FikaAmazonAPI.NotificationMessages
2+
{
3+
public class BuyBoxPriceB2C : PriceBaseB2C
4+
{
5+
}
6+
}

Source/FikaAmazonAPI/NotificationMessages/BuyBoxPriceElement.cs

Lines changed: 0 additions & 41 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace FikaAmazonAPI.NotificationMessages
6+
{
7+
public class FulfillmentChannelType
8+
{
9+
public const string Amazon = "Amazon";
10+
public const string Merchant = "Merchant";
11+
}
12+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using Newtonsoft.Json;
2+
3+
namespace FikaAmazonAPI.NotificationMessages
4+
{
5+
public class LowestPriceB2B : PriceBaseB2B
6+
{
7+
/// <summary>
8+
/// Required. Indicates whether the item is fulfilled by Amazon or by the seller.
9+
/// </summary>
10+
/// <remarks>
11+
/// See values from FulfillmentChannelType class.
12+
/// </remarks>
13+
[JsonProperty("FulfillmentChannel")]
14+
public string FulfillmentChannel { get; set; }
15+
}
16+
}

0 commit comments

Comments
 (0)