Skip to content

Commit c08ccb0

Browse files
committed
fix #363
1 parent fdd2ea1 commit c08ccb0

File tree

7 files changed

+227
-77
lines changed

7 files changed

+227
-77
lines changed

Source/FikaAmazonAPI.SampleCode/Program.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ static async Task Main(string[] args)
4949
});
5050

5151

52+
var headers = amazonConnection.ProductPricing.LastResponseHeader;
53+
5254

5355
var productsttt = reportManageree.GetProducts(); //GET_MERCHANT_LISTINGS_ALL_DATA
5456

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
using Newtonsoft.Json;
2+
using System.Runtime.Serialization;
3+
using System.Text;
4+
5+
namespace FikaAmazonAPI.AmazonSpApiSDK.Models.Notifications
6+
{
7+
/// <summary>
8+
/// Use this filter to select the aggregation time period at which to send notifications (e.g. limit to one notification every five minutes for high frequency notifications).
9+
/// </summary>
10+
[DataContract]
11+
public class AggregationFilter
12+
{
13+
/// <summary>
14+
/// Gets or Sets AggregationSettings
15+
/// </summary>
16+
[DataMember(Name = "aggregationSettings", EmitDefaultValue = false)]
17+
[JsonProperty(PropertyName = "aggregationSettings")]
18+
public AggregationSettings AggregationSettings { get; set; }
19+
20+
21+
/// <summary>
22+
/// Get the string presentation of the object
23+
/// </summary>
24+
/// <returns>String presentation of the object</returns>
25+
public override string ToString()
26+
{
27+
var sb = new StringBuilder();
28+
sb.Append("class AggregationFilter {\n");
29+
sb.Append(" AggregationSettings: ").Append(AggregationSettings).Append("\n");
30+
sb.Append("}\n");
31+
return sb.ToString();
32+
}
33+
34+
/// <summary>
35+
/// Get the JSON string presentation of the object
36+
/// </summary>
37+
/// <returns>JSON string presentation of the object</returns>
38+
public string ToJson()
39+
{
40+
return JsonConvert.SerializeObject(this, Formatting.Indented);
41+
}
42+
43+
}
44+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
using Newtonsoft.Json;
2+
using System.Runtime.Serialization;
3+
using System.Text;
4+
5+
namespace FikaAmazonAPI.AmazonSpApiSDK.Models.Notifications
6+
{
7+
// <summary>
8+
/// A container that holds all of the necessary properties to configure the aggregation of notifications.
9+
/// </summary>
10+
[DataContract]
11+
public class AggregationSettings
12+
{
13+
/// <summary>
14+
/// The supported time period to use to perform marketplace-ASIN level aggregation.
15+
/// </summary>
16+
/// <value>The supported time period to use to perform marketplace-ASIN level aggregation.</value>
17+
[DataMember(Name = "aggregationTimePeriod", EmitDefaultValue = false)]
18+
[JsonProperty(PropertyName = "aggregationTimePeriod")]
19+
public AggregationTimePeriod AggregationTimePeriod { get; set; }
20+
21+
22+
/// <summary>
23+
/// Get the string presentation of the object
24+
/// </summary>
25+
/// <returns>String presentation of the object</returns>
26+
public override string ToString()
27+
{
28+
var sb = new StringBuilder();
29+
sb.Append("class AggregationSettings {\n");
30+
sb.Append(" AggregationTimePeriod: ").Append(AggregationTimePeriod).Append("\n");
31+
sb.Append("}\n");
32+
return sb.ToString();
33+
}
34+
35+
/// <summary>
36+
/// Get the JSON string presentation of the object
37+
/// </summary>
38+
/// <returns>JSON string presentation of the object</returns>
39+
public string ToJson()
40+
{
41+
return JsonConvert.SerializeObject(this, Formatting.Indented);
42+
}
43+
44+
}
45+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using Newtonsoft.Json.Converters;
2+
using System.Runtime.Serialization;
3+
using System.Text.Json.Serialization;
4+
5+
namespace FikaAmazonAPI.AmazonSpApiSDK.Models.Notifications
6+
{
7+
[JsonConverter(typeof(StringEnumConverter))]
8+
public enum AggregationTimePeriod
9+
{
10+
/// <summary>
11+
/// Enum AggregationTimePeriod for value: FiveMinutes
12+
/// </summary>
13+
[EnumMember(Value = "FiveMinutes")]
14+
FiveMinutes = 1,
15+
16+
/// <summary>
17+
/// Enum AggregationTimePeriod for value: TenMinutes
18+
/// </summary>
19+
[EnumMember(Value = "TenMinutes")]
20+
TenMinutes = 1,
21+
}
22+
23+
}

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

Lines changed: 14 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
*/
1010

1111
using Newtonsoft.Json;
12-
using System;
13-
using System.Collections.Generic;
14-
using System.ComponentModel.DataAnnotations;
1512
using System.Runtime.Serialization;
1613
using System.Text;
1714

@@ -21,35 +18,34 @@ namespace FikaAmazonAPI.AmazonSpApiSDK.Models.Notifications
2118
/// The request schema for the createSubscription operation.
2219
/// </summary>
2320
[DataContract]
24-
public partial class CreateSubscriptionRequest : IEquatable<CreateSubscriptionRequest>, IValidatableObject
21+
public partial class CreateSubscriptionRequest
2522
{
26-
/// <summary>
27-
/// Initializes a new instance of the <see cref="CreateSubscriptionRequest" /> class.
28-
/// </summary>
29-
/// <param name="PayloadVersion">The version of the payload object to be used in the notification..</param>
30-
/// <param name="DestinationId">The identifier for the destination where notifications will be delivered..</param>
31-
public CreateSubscriptionRequest(string PayloadVersion = default(string), string DestinationId = default(string))
32-
{
33-
this.PayloadVersion = PayloadVersion;
34-
this.DestinationId = DestinationId;
35-
}
36-
3723
/// <summary>
3824
/// The version of the payload object to be used in the notification.
3925
/// </summary>
4026
/// <value>The version of the payload object to be used in the notification.</value>
4127
[DataMember(Name = "payloadVersion", EmitDefaultValue = false)]
28+
[JsonProperty(PropertyName = "payloadVersion")]
4229
public string PayloadVersion { get; set; }
4330

4431
/// <summary>
4532
/// The identifier for the destination where notifications will be delivered.
4633
/// </summary>
4734
/// <value>The identifier for the destination where notifications will be delivered.</value>
4835
[DataMember(Name = "destinationId", EmitDefaultValue = false)]
36+
[JsonProperty(PropertyName = "destinationId")]
4937
public string DestinationId { get; set; }
5038

5139
/// <summary>
52-
/// Returns the string presentation of the object
40+
/// Gets or Sets ProcessingDirective
41+
/// </summary>
42+
[DataMember(Name = "processingDirective", EmitDefaultValue = false)]
43+
[JsonProperty(PropertyName = "processingDirective")]
44+
public ProcessingDirective ProcessingDirective { get; set; }
45+
46+
47+
/// <summary>
48+
/// Get the string presentation of the object
5349
/// </summary>
5450
/// <returns>String presentation of the object</returns>
5551
public override string ToString()
@@ -58,78 +54,19 @@ public override string ToString()
5854
sb.Append("class CreateSubscriptionRequest {\n");
5955
sb.Append(" PayloadVersion: ").Append(PayloadVersion).Append("\n");
6056
sb.Append(" DestinationId: ").Append(DestinationId).Append("\n");
57+
sb.Append(" ProcessingDirective: ").Append(ProcessingDirective).Append("\n");
6158
sb.Append("}\n");
6259
return sb.ToString();
6360
}
6461

6562
/// <summary>
66-
/// Returns the JSON string presentation of the object
63+
/// Get the JSON string presentation of the object
6764
/// </summary>
6865
/// <returns>JSON string presentation of the object</returns>
6966
public string ToJson()
7067
{
7168
return JsonConvert.SerializeObject(this, Formatting.Indented);
7269
}
73-
74-
/// <summary>
75-
/// Returns true if objects are equal
76-
/// </summary>
77-
/// <param name="input">Object to be compared</param>
78-
/// <returns>Boolean</returns>
79-
public override bool Equals(object input)
80-
{
81-
return this.Equals(input as CreateSubscriptionRequest);
82-
}
83-
84-
/// <summary>
85-
/// Returns true if CreateSubscriptionRequest instances are equal
86-
/// </summary>
87-
/// <param name="input">Instance of CreateSubscriptionRequest to be compared</param>
88-
/// <returns>Boolean</returns>
89-
public bool Equals(CreateSubscriptionRequest input)
90-
{
91-
if (input == null)
92-
return false;
93-
94-
return
95-
(
96-
this.PayloadVersion == input.PayloadVersion ||
97-
(this.PayloadVersion != null &&
98-
this.PayloadVersion.Equals(input.PayloadVersion))
99-
) &&
100-
(
101-
this.DestinationId == input.DestinationId ||
102-
(this.DestinationId != null &&
103-
this.DestinationId.Equals(input.DestinationId))
104-
);
105-
}
106-
107-
/// <summary>
108-
/// Gets the hash code
109-
/// </summary>
110-
/// <returns>Hash code</returns>
111-
public override int GetHashCode()
112-
{
113-
unchecked // Overflow is fine, just wrap
114-
{
115-
int hashCode = 41;
116-
if (this.PayloadVersion != null)
117-
hashCode = hashCode * 59 + this.PayloadVersion.GetHashCode();
118-
if (this.DestinationId != null)
119-
hashCode = hashCode * 59 + this.DestinationId.GetHashCode();
120-
return hashCode;
121-
}
122-
}
123-
124-
/// <summary>
125-
/// To validate all properties of the instance
126-
/// </summary>
127-
/// <param name="validationContext">Validation context</param>
128-
/// <returns>Validation Result</returns>
129-
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
130-
{
131-
yield break;
132-
}
13370
}
13471

13572
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
using Newtonsoft.Json;
2+
using System.Collections.Generic;
3+
using System.Runtime.Serialization;
4+
using System.Text;
5+
6+
namespace FikaAmazonAPI.AmazonSpApiSDK.Models.Notifications
7+
{
8+
/// <summary>
9+
/// A notificationType specific filter. This object contains all of the currently available filters and properties that you can use to define a notificationType specific filter.
10+
/// </summary>
11+
[DataContract]
12+
public class EventFilter : AggregationFilter
13+
{
14+
/// <summary>
15+
/// Gets or Sets MarketplaceIds
16+
/// </summary>
17+
[DataMember(Name = "marketplaceIds", EmitDefaultValue = false)]
18+
[JsonProperty(PropertyName = "marketplaceIds")]
19+
public IList<string> MarketplaceIds { get; set; }
20+
21+
/// <summary>
22+
/// An eventFilterType value that is supported by the specific notificationType. This is used by the subscription service to determine the type of event filter. Refer to the section of the [Notifications Use Case Guide](doc:notifications-api-v1-use-case-guide) that describes the specific notificationType to determine if an eventFilterType is supported.
23+
/// </summary>
24+
/// <value>An eventFilterType value that is supported by the specific notificationType. This is used by the subscription service to determine the type of event filter. Refer to the section of the [Notifications Use Case Guide](doc:notifications-api-v1-use-case-guide) that describes the specific notificationType to determine if an eventFilterType is supported.</value>
25+
[DataMember(Name = "eventFilterType", EmitDefaultValue = false)]
26+
[JsonProperty(PropertyName = "eventFilterType")]
27+
public string EventFilterType { get; set; }
28+
29+
30+
/// <summary>
31+
/// Get the string presentation of the object
32+
/// </summary>
33+
/// <returns>String presentation of the object</returns>
34+
public override string ToString()
35+
{
36+
var sb = new StringBuilder();
37+
sb.Append("class EventFilter {\n");
38+
sb.Append(" MarketplaceIds: ").Append(MarketplaceIds).Append("\n");
39+
sb.Append(" EventFilterType: ").Append(EventFilterType).Append("\n");
40+
sb.Append("}\n");
41+
return sb.ToString();
42+
}
43+
44+
/// <summary>
45+
/// Get the JSON string presentation of the object
46+
/// </summary>
47+
/// <returns>JSON string presentation of the object</returns>
48+
public new string ToJson()
49+
{
50+
return JsonConvert.SerializeObject(this, Formatting.Indented);
51+
}
52+
53+
}
54+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
using Newtonsoft.Json;
2+
using System.Runtime.Serialization;
3+
using System.Text;
4+
5+
namespace FikaAmazonAPI.AmazonSpApiSDK.Models.Notifications
6+
{
7+
/// <summary>
8+
/// Additional information passed to the subscription to control the processing of notifications. For example, you can use an eventFilter to customize your subscription to send notifications for only the specified marketplaceId&#39;s, or select the aggregation time period at which to send notifications (e.g. limit to one notification every five minutes for high frequency notifications). The specific features available vary depending on the notificationType. This feature is limited to specific notificationTypes and is currently only supported by the ANY_OFFER_CHANGED notificationType.
9+
/// </summary>
10+
[DataContract]
11+
public class ProcessingDirective
12+
{
13+
/// <summary>
14+
/// A notificationType specific filter.
15+
/// </summary>
16+
/// <value>A notificationType specific filter.</value>
17+
[DataMember(Name = "eventFilter", EmitDefaultValue = false)]
18+
[JsonProperty(PropertyName = "eventFilter")]
19+
public EventFilter EventFilter { get; set; }
20+
21+
22+
/// <summary>
23+
/// Get the string presentation of the object
24+
/// </summary>
25+
/// <returns>String presentation of the object</returns>
26+
public override string ToString()
27+
{
28+
var sb = new StringBuilder();
29+
sb.Append("class ProcessingDirective {\n");
30+
sb.Append(" EventFilter: ").Append(EventFilter).Append("\n");
31+
sb.Append("}\n");
32+
return sb.ToString();
33+
}
34+
35+
/// <summary>
36+
/// Get the JSON string presentation of the object
37+
/// </summary>
38+
/// <returns>JSON string presentation of the object</returns>
39+
public string ToJson()
40+
{
41+
return JsonConvert.SerializeObject(this, Formatting.Indented);
42+
}
43+
44+
}
45+
}

0 commit comments

Comments
 (0)