Skip to content

Commit 2d75df5

Browse files
authored
Merge pull request #360 from dave-sewell/VendorOrders2
Vendor orders2
2 parents 8c27498 + a95e55d commit 2d75df5

25 files changed

+2545
-1
lines changed

Source/FikaAmazonAPI/AmazonConnection.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public class AmazonConnection
4040
public FulFillmentInboundService FulFillmentInbound => this._FulFillmentInbound ?? throw _NoCredentials;
4141
public FulFillmentOutboundService FulFillmentOutbound => this._FulFillmentOutbound ?? throw _NoCredentials;
4242
public VendorDirectFulfillmentOrderService VendorDirectFulfillmentOrders => this._VendorDirectFulfillmentOrders ?? throw _NoCredentials;
43-
43+
public VendorOrderService VendorOrders => this._VendorOrders ?? throw _NoCredentials;
4444

4545

4646
private OrderService _Orders { get; set; }
@@ -77,6 +77,7 @@ public class AmazonConnection
7777
private FulFillmentInboundService _FulFillmentInbound { get; set; }
7878
private FulFillmentOutboundService _FulFillmentOutbound { get; set; }
7979
private VendorDirectFulfillmentOrderService _VendorDirectFulfillmentOrders { get; set; }
80+
private VendorOrderService _VendorOrders { get; set; }
8081

8182
private UnauthorizedAccessException _NoCredentials = new UnauthorizedAccessException($"Error, you cannot make calls to Amazon without credentials!");
8283

@@ -133,6 +134,7 @@ private void Init(AmazonCredential Credentials)
133134
this._FulFillmentInbound = new FulFillmentInboundService(this.Credentials);
134135
this._FulFillmentOutbound = new FulFillmentOutboundService(this.Credentials);
135136
this._VendorDirectFulfillmentOrders = new VendorDirectFulfillmentOrderService(this.Credentials);
137+
this._VendorOrders = new VendorOrderService(this.Credentials);
136138
}
137139
}
138140
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using Newtonsoft.Json;
2+
using Newtonsoft.Json.Converters;
3+
using System.Runtime.Serialization;
4+
5+
namespace FikaAmazonAPI.AmazonSpApiSDK.Models.VendorOrders
6+
{
7+
[JsonConverter(typeof(StringEnumConverter))]
8+
public enum AcknowledgementCode
9+
{
10+
[EnumMember(Value = "Accepted")]
11+
Accepted,
12+
13+
[EnumMember(Value = "Backordered")]
14+
Backordered,
15+
16+
[EnumMember(Value = "Rejected")]
17+
Rejected
18+
}
19+
}
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
using System;
2+
using System.Text;
3+
using System.Collections.Generic;
4+
using System.Runtime.Serialization;
5+
using Newtonsoft.Json;
6+
using Newtonsoft.Json.Converters;
7+
using System.ComponentModel.DataAnnotations;
8+
9+
namespace FikaAmazonAPI.AmazonSpApiSDK.Models.VendorOrders
10+
{
11+
[DataContract]
12+
public partial class DateTimeInterval : IEquatable<DateTimeInterval>, IValidatableObject
13+
{
14+
public DateTimeInterval(string dateTimeInterval = default(string))
15+
{
16+
dateTimeIntervalStr = dateTimeInterval;
17+
string intervalWithSpaceDelimiter = dateTimeInterval.Replace("--", " ");
18+
string[] dateStrings = intervalWithSpaceDelimiter.Split(' ');
19+
StartDate = DateTime.Parse(dateStrings[0]).ToUniversalTime();
20+
EndDate = DateTime.Parse(dateStrings[1]).ToUniversalTime();
21+
}
22+
23+
private string dateTimeIntervalStr;
24+
25+
public static explicit operator DateTimeInterval(string interval) => new DateTimeInterval(interval);
26+
27+
[DataMember(Name = "startDate", EmitDefaultValue = false)]
28+
public DateTime StartDate { get; set; }
29+
30+
[DataMember(Name = "endDate", EmitDefaultValue = false)]
31+
public DateTime EndDate { get; set; }
32+
33+
public override string ToString()
34+
{
35+
return dateTimeIntervalStr;
36+
}
37+
38+
/// <summary>
39+
/// Returns the JSON string presentation of the object
40+
/// </summary>
41+
/// <returns>JSON string presentation of the object</returns>
42+
public virtual string ToJson()
43+
{
44+
return JsonConvert.SerializeObject(this, Formatting.Indented);
45+
}
46+
47+
/// <summary>
48+
/// Returns true if objects are equal
49+
/// </summary>
50+
/// <param name="input">Object to be compared</param>
51+
/// <returns>Boolean</returns>
52+
public override bool Equals(object input)
53+
{
54+
return this.Equals(input as DateTimeInterval);
55+
}
56+
57+
public bool Equals(DateTimeInterval input)
58+
{
59+
if (input == null)
60+
return false;
61+
return
62+
(
63+
this.dateTimeIntervalStr == input.dateTimeIntervalStr ||
64+
(this.dateTimeIntervalStr != null &&
65+
this.dateTimeIntervalStr.Equals(input.dateTimeIntervalStr))
66+
);
67+
}
68+
69+
/// <summary>
70+
/// Gets the hash code
71+
/// </summary>
72+
/// <returns>Hash code</returns>
73+
public override int GetHashCode()
74+
{
75+
return dateTimeIntervalStr.GetHashCode();
76+
}
77+
78+
/// <summary>
79+
/// To validate all properties of the instance
80+
/// </summary>
81+
/// <param name="validationContext">Validation context</param>
82+
/// <returns>Validation Result</returns>
83+
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
84+
{
85+
yield break;
86+
}
87+
}
88+
89+
}
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
/*
2+
* Selling Partner API for Direct Fulfillment Orders
3+
*
4+
* The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data.
5+
*
6+
* OpenAPI spec version: v1
7+
*
8+
* Generated by: https://github.com/swagger-api/swagger-codegen.git
9+
*/
10+
11+
using System;
12+
using System.Text;
13+
using System.Collections.Generic;
14+
using System.Runtime.Serialization;
15+
using Newtonsoft.Json;
16+
using System.ComponentModel.DataAnnotations;
17+
using FikaAmazonAPI.AmazonSpApiSDK.Models.Authorization;
18+
19+
namespace FikaAmazonAPI.AmazonSpApiSDK.Models.VendorOrders
20+
{
21+
/// <summary>
22+
/// The response schema for the getPurchasesOrder operation.
23+
/// </summary>
24+
[DataContract]
25+
public partial class GetPurchaseOrderResponse : IEquatable<GetPurchaseOrderResponse>, IValidatableObject
26+
{
27+
/// <summary>
28+
/// Initializes a new instance of the <see cref="GetOrderResponse" /> class.
29+
/// </summary>
30+
/// <param name="payload">The payload for the getOrder operation..</param>
31+
/// <param name="errors">errors.</param>
32+
public GetPurchaseOrderResponse(Order payload = default(Order), ErrorList errors = default(ErrorList))
33+
{
34+
this.Payload = payload;
35+
this.Errors = errors;
36+
}
37+
public GetPurchaseOrderResponse()
38+
{
39+
this.Payload = default(Order);
40+
this.Errors = default(ErrorList);
41+
}
42+
/// <summary>
43+
/// The payload for the getOrder operation.
44+
/// </summary>
45+
/// <value>The payload for the getOrder operation.</value>
46+
[DataMember(Name = "payload", EmitDefaultValue = false)]
47+
public Order Payload { get; set; }
48+
49+
/// <summary>
50+
/// Gets or Sets Errors
51+
/// </summary>
52+
[DataMember(Name = "errors", EmitDefaultValue = false)]
53+
public ErrorList Errors { get; set; }
54+
55+
/// <summary>
56+
/// Returns the string presentation of the object
57+
/// </summary>
58+
/// <returns>String presentation of the object</returns>
59+
public override string ToString()
60+
{
61+
var sb = new StringBuilder();
62+
sb.Append("class GetOrderResponse {\n");
63+
sb.Append(" Payload: ").Append(Payload).Append("\n");
64+
sb.Append(" Errors: ").Append(Errors).Append("\n");
65+
sb.Append("}\n");
66+
return sb.ToString();
67+
}
68+
69+
/// <summary>
70+
/// Returns the JSON string presentation of the object
71+
/// </summary>
72+
/// <returns>JSON string presentation of the object</returns>
73+
public virtual string ToJson()
74+
{
75+
return JsonConvert.SerializeObject(this, Formatting.Indented);
76+
}
77+
78+
/// <summary>
79+
/// Returns true if objects are equal
80+
/// </summary>
81+
/// <param name="input">Object to be compared</param>
82+
/// <returns>Boolean</returns>
83+
public override bool Equals(object input)
84+
{
85+
return this.Equals(input as GetPurchaseOrderResponse);
86+
}
87+
88+
/// <summary>
89+
/// Returns true if GetOrderResponse instances are equal
90+
/// </summary>
91+
/// <param name="input">Instance of GetOrderResponse to be compared</param>
92+
/// <returns>Boolean</returns>
93+
public bool Equals(GetPurchaseOrderResponse input)
94+
{
95+
if (input == null)
96+
return false;
97+
98+
return
99+
(
100+
this.Payload == input.Payload ||
101+
(this.Payload != null &&
102+
this.Payload.Equals(input.Payload))
103+
) &&
104+
(
105+
this.Errors == input.Errors ||
106+
(this.Errors != null &&
107+
this.Errors.Equals(input.Errors))
108+
);
109+
}
110+
111+
/// <summary>
112+
/// Gets the hash code
113+
/// </summary>
114+
/// <returns>Hash code</returns>
115+
public override int GetHashCode()
116+
{
117+
unchecked // Overflow is fine, just wrap
118+
{
119+
int hashCode = 41;
120+
if (this.Payload != null)
121+
hashCode = hashCode * 59 + this.Payload.GetHashCode();
122+
if (this.Errors != null)
123+
hashCode = hashCode * 59 + this.Errors.GetHashCode();
124+
return hashCode;
125+
}
126+
}
127+
128+
/// <summary>
129+
/// To validate all properties of the instance
130+
/// </summary>
131+
/// <param name="validationContext">Validation context</param>
132+
/// <returns>Validation Result</returns>
133+
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
134+
{
135+
yield break;
136+
}
137+
138+
}
139+
140+
}

0 commit comments

Comments
 (0)