Skip to content

Commit 07ad506

Browse files
authored
Merge pull request #577 from Andi482/ProcessingDirectiveInNotifications
Added ProcessingDirective to Subscription and ParameterCreateSubscription
2 parents b98fcac + eff7699 commit 07ad506

File tree

2 files changed

+37
-19
lines changed

2 files changed

+37
-19
lines changed

Source/FikaAmazonAPI/AmazonSpApiSDK/Models/Notifications/Subscription.cs

Lines changed: 34 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* Selling Partner API for Notifications
33
*
4-
* The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more.
4+
* The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more. For more information, see the [Notifications Use Case Guide](doc:notifications-api-v1-use-case-guide).
55
*
66
* OpenAPI spec version: v1
77
*
@@ -32,38 +32,40 @@ public Subscription() { }
3232
/// <summary>
3333
/// Initializes a new instance of the <see cref="Subscription" /> class.
3434
/// </summary>
35-
/// <param name="SubscriptionId">The subscription identifier generated when the subscription is created. (required).</param>
36-
/// <param name="PayloadVersion">The version of the payload object to be used in the notification. (required).</param>
37-
/// <param name="DestinationId">The identifier for the destination where notifications will be delivered. (required).</param>
38-
public Subscription(string SubscriptionId = default(string), string PayloadVersion = default(string), string DestinationId = default(string))
35+
/// <param name="subscriptionId">The subscription identifier generated when the subscription is created. (required).</param>
36+
/// <param name="payloadVersion">The version of the payload object to be used in the notification. (required).</param>
37+
/// <param name="destinationId">The identifier for the destination where notifications will be delivered. (required).</param>
38+
/// <param name="processingDirective">processingDirective.</param>
39+
public Subscription(string subscriptionId = default(string), string payloadVersion = default(string), string destinationId = default(string), ProcessingDirective processingDirective = default(ProcessingDirective))
3940
{
40-
// to ensure "SubscriptionId" is required (not null)
41-
if (SubscriptionId == null)
41+
// to ensure "subscriptionId" is required (not null)
42+
if (subscriptionId == null)
4243
{
43-
throw new InvalidDataException("SubscriptionId is a required property for Subscription and cannot be null");
44+
throw new InvalidDataException("subscriptionId is a required property for Subscription and cannot be null");
4445
}
4546
else
4647
{
47-
this.SubscriptionId = SubscriptionId;
48+
this.SubscriptionId = subscriptionId;
4849
}
49-
// to ensure "PayloadVersion" is required (not null)
50-
if (PayloadVersion == null)
50+
// to ensure "payloadVersion" is required (not null)
51+
if (payloadVersion == null)
5152
{
52-
throw new InvalidDataException("PayloadVersion is a required property for Subscription and cannot be null");
53+
throw new InvalidDataException("payloadVersion is a required property for Subscription and cannot be null");
5354
}
5455
else
5556
{
56-
this.PayloadVersion = PayloadVersion;
57+
this.PayloadVersion = payloadVersion;
5758
}
58-
// to ensure "DestinationId" is required (not null)
59-
if (DestinationId == null)
59+
// to ensure "destinationId" is required (not null)
60+
if (destinationId == null)
6061
{
61-
throw new InvalidDataException("DestinationId is a required property for Subscription and cannot be null");
62+
throw new InvalidDataException("destinationId is a required property for Subscription and cannot be null");
6263
}
6364
else
6465
{
65-
this.DestinationId = DestinationId;
66+
this.DestinationId = destinationId;
6667
}
68+
this.ProcessingDirective = processingDirective;
6769
}
6870

6971
/// <summary>
@@ -87,6 +89,12 @@ public Subscription() { }
8789
[DataMember(Name = "destinationId", EmitDefaultValue = false)]
8890
public string DestinationId { get; set; }
8991

92+
/// <summary>
93+
/// Gets or Sets ProcessingDirective
94+
/// </summary>
95+
[DataMember(Name = "processingDirective", EmitDefaultValue = false)]
96+
public ProcessingDirective ProcessingDirective { get; set; }
97+
9098
/// <summary>
9199
/// Returns the string presentation of the object
92100
/// </summary>
@@ -98,6 +106,7 @@ public override string ToString()
98106
sb.Append(" SubscriptionId: ").Append(SubscriptionId).Append("\n");
99107
sb.Append(" PayloadVersion: ").Append(PayloadVersion).Append("\n");
100108
sb.Append(" DestinationId: ").Append(DestinationId).Append("\n");
109+
sb.Append(" ProcessingDirective: ").Append(ProcessingDirective).Append("\n");
101110
sb.Append("}\n");
102111
return sb.ToString();
103112
}
@@ -106,7 +115,7 @@ public override string ToString()
106115
/// Returns the JSON string presentation of the object
107116
/// </summary>
108117
/// <returns>JSON string presentation of the object</returns>
109-
public string ToJson()
118+
public virtual string ToJson()
110119
{
111120
return JsonConvert.SerializeObject(this, Formatting.Indented);
112121
}
@@ -146,6 +155,11 @@ public bool Equals(Subscription input)
146155
this.DestinationId == input.DestinationId ||
147156
(this.DestinationId != null &&
148157
this.DestinationId.Equals(input.DestinationId))
158+
) &&
159+
(
160+
this.ProcessingDirective == input.ProcessingDirective ||
161+
(this.ProcessingDirective != null &&
162+
this.ProcessingDirective.Equals(input.ProcessingDirective))
149163
);
150164
}
151165

@@ -164,6 +178,8 @@ public override int GetHashCode()
164178
hashCode = hashCode * 59 + this.PayloadVersion.GetHashCode();
165179
if (this.DestinationId != null)
166180
hashCode = hashCode * 59 + this.DestinationId.GetHashCode();
181+
if (this.ProcessingDirective != null)
182+
hashCode = hashCode * 59 + this.ProcessingDirective.GetHashCode();
167183
return hashCode;
168184
}
169185
}

Source/FikaAmazonAPI/Parameter/Notification/ParameterCreateSubscription.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using FikaAmazonAPI.Search;
1+
using FikaAmazonAPI.AmazonSpApiSDK.Models.Notifications;
2+
using FikaAmazonAPI.Search;
23
using static FikaAmazonAPI.Utils.Constants;
34

45
namespace FikaAmazonAPI.Parameter.Notification
@@ -8,6 +9,7 @@ public class ParameterCreateSubscription : ParameterBased
89
public string payloadVersion { get; set; }
910
public string destinationId { get; set; }
1011
public NotificationType notificationType { get; set; }
12+
public ProcessingDirective processingDirective { get; set; }
1113

1214
}
1315
}

0 commit comments

Comments
 (0)