Skip to content

Commit 44e42e5

Browse files
authored
Merge pull request abuzuhri#858 from WuMiaoMiao2/add_vendorDirectFulfillmentInventory
fea:Added Vendor Direct Fulfillment Inventory API v1 service.
2 parents 746b842 + b82a79e commit 44e42e5

15 files changed

Lines changed: 1390 additions & 1 deletion
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
using FikaAmazonAPI.AmazonSpApiSDK.Models.VendorDirectFulfillmentInventory;
2+
3+
namespace FikaAmazonAPI.SampleCode;
4+
5+
public class VendorDirectFulfillmentInventorySample
6+
{
7+
AmazonConnection amazonConnection;
8+
9+
public VendorDirectFulfillmentInventorySample(AmazonConnection amazonConnection)
10+
{
11+
this.amazonConnection = amazonConnection;
12+
}
13+
14+
public void SubmitInventoryUpdate()
15+
{
16+
var submitInventoryUpdateRequest = new SubmitInventoryUpdateRequest
17+
{
18+
Inventory = new InventoryUpdate
19+
{
20+
SellingParty = new PartyIdentification
21+
{
22+
PartyId = ""
23+
},
24+
IsFullUpdate = false,
25+
Items = new List<ItemDetails>()
26+
{
27+
new()
28+
{
29+
VendorProductIdentifier = "",
30+
AvailableQuantity = new ItemQuantity
31+
{
32+
Amount = 99,
33+
UnitOfMeasure = "LB"
34+
},
35+
}
36+
}
37+
}
38+
};
39+
40+
var result =
41+
amazonConnection.VendorDirectFulfillmentInventory.SubmitInventoryUpdate("", submitInventoryUpdateRequest);
42+
}
43+
}

Source/FikaAmazonAPI/AmazonConnection.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public class AmazonConnection
4848
public FulFillmentOutboundService FulFillmentOutbound => this._FulFillmentOutbound ?? throw _NoCredentials;
4949
public VendorDirectFulfillmentOrderService VendorDirectFulfillmentOrders => this._VendorDirectFulfillmentOrders ?? throw _NoCredentials;
5050
public VendorOrderService VendorOrders => this._VendorOrders ?? throw _NoCredentials;
51-
51+
public VendorDirectFulfillmentInventoryService VendorDirectFulfillmentInventory => this._VendorDirectFulfillmentInventory ?? throw _NoCredentials;
5252
public VendorTransactionStatusService VendorTransactionStatus => this._VendorTransactionStatus ?? throw _NoCredentials;
5353

5454
private AppIntegrationsServiceV20240401 _AppIntegrationsServiceV20240401 { get; set; }
@@ -88,6 +88,7 @@ public class AmazonConnection
8888
private VendorDirectFulfillmentOrderService _VendorDirectFulfillmentOrders { get; set; }
8989
private VendorOrderService _VendorOrders { get; set; }
9090
private VendorTransactionStatusService _VendorTransactionStatus { get; set; }
91+
private VendorDirectFulfillmentInventoryService _VendorDirectFulfillmentInventory { get; set; }
9192

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

@@ -152,6 +153,7 @@ private void Init(AmazonCredential Credentials)
152153
this._VendorDirectFulfillmentOrders = new VendorDirectFulfillmentOrderService(this.Credentials, _loggerFactory);
153154
this._VendorOrders = new VendorOrderService(this.Credentials, _loggerFactory);
154155
this._VendorTransactionStatus = new VendorTransactionStatusService(this.Credentials, _loggerFactory);
156+
this._VendorDirectFulfillmentInventory = new VendorDirectFulfillmentInventoryService(this.Credentials, _loggerFactory);
155157

156158
AmazonCredential.DebugMode = this.Credentials.IsDebugMode;
157159
}
Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
/*
2+
* Selling Partner API for Direct Fulfillment Inventory Updates
3+
*
4+
* The Selling Partner API for Direct Fulfillment Inventory Updates provides programmatic access to a direct fulfillment vendor's inventory updates.
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.Collections.Generic;
13+
using System.ComponentModel.DataAnnotations;
14+
using System.IO;
15+
using System.Runtime.Serialization;
16+
using System.Text;
17+
using Newtonsoft.Json;
18+
19+
namespace FikaAmazonAPI.AmazonSpApiSDK.Models.VendorDirectFulfillmentInventory
20+
{
21+
/// <summary>
22+
/// Error response returned when the request is unsuccessful.
23+
/// </summary>
24+
[DataContract]
25+
public partial class Error : IEquatable<Error>, IValidatableObject
26+
{
27+
/// <summary>
28+
/// Initializes a new instance of the <see cref="Error" /> class.
29+
/// </summary>
30+
[JsonConstructor]
31+
public Error() { }
32+
/// <summary>
33+
/// Initializes a new instance of the <see cref="Error" /> class.
34+
/// </summary>
35+
/// <param name="code">An error code that identifies the type of error that occurred. (required).</param>
36+
/// <param name="message">A message that describes the error condition. (required).</param>
37+
/// <param name="details">Additional details that can help the caller understand or fix the issue..</param>
38+
public Error(string code = default(string), string message = default(string), string details = default(string))
39+
{
40+
// to ensure "code" is required (not null)
41+
if (code == null)
42+
{
43+
throw new InvalidDataException("code is a required property for Error and cannot be null");
44+
}
45+
else
46+
{
47+
this.Code = code;
48+
}
49+
// to ensure "message" is required (not null)
50+
if (message == null)
51+
{
52+
throw new InvalidDataException("message is a required property for Error and cannot be null");
53+
}
54+
else
55+
{
56+
this.Message = message;
57+
}
58+
this.Details = details;
59+
}
60+
61+
/// <summary>
62+
/// An error code that identifies the type of error that occurred.
63+
/// </summary>
64+
/// <value>An error code that identifies the type of error that occurred.</value>
65+
[DataMember(Name="code", EmitDefaultValue=false)]
66+
public string Code { get; set; }
67+
68+
/// <summary>
69+
/// A message that describes the error condition.
70+
/// </summary>
71+
/// <value>A message that describes the error condition.</value>
72+
[DataMember(Name="message", EmitDefaultValue=false)]
73+
public string Message { get; set; }
74+
75+
/// <summary>
76+
/// Additional details that can help the caller understand or fix the issue.
77+
/// </summary>
78+
/// <value>Additional details that can help the caller understand or fix the issue.</value>
79+
[DataMember(Name="details", EmitDefaultValue=false)]
80+
public string Details { get; set; }
81+
82+
/// <summary>
83+
/// Returns the string presentation of the object
84+
/// </summary>
85+
/// <returns>String presentation of the object</returns>
86+
public override string ToString()
87+
{
88+
var sb = new StringBuilder();
89+
sb.Append("class Error {\n");
90+
sb.Append(" Code: ").Append(Code).Append("\n");
91+
sb.Append(" Message: ").Append(Message).Append("\n");
92+
sb.Append(" Details: ").Append(Details).Append("\n");
93+
sb.Append("}\n");
94+
return sb.ToString();
95+
}
96+
97+
/// <summary>
98+
/// Returns the JSON string presentation of the object
99+
/// </summary>
100+
/// <returns>JSON string presentation of the object</returns>
101+
public virtual string ToJson()
102+
{
103+
return JsonConvert.SerializeObject(this, Formatting.Indented);
104+
}
105+
106+
/// <summary>
107+
/// Returns true if objects are equal
108+
/// </summary>
109+
/// <param name="input">Object to be compared</param>
110+
/// <returns>Boolean</returns>
111+
public override bool Equals(object input)
112+
{
113+
return this.Equals(input as Error);
114+
}
115+
116+
/// <summary>
117+
/// Returns true if Error instances are equal
118+
/// </summary>
119+
/// <param name="input">Instance of Error to be compared</param>
120+
/// <returns>Boolean</returns>
121+
public bool Equals(Error input)
122+
{
123+
if (input == null)
124+
return false;
125+
126+
return
127+
(
128+
this.Code == input.Code ||
129+
(this.Code != null &&
130+
this.Code.Equals(input.Code))
131+
) &&
132+
(
133+
this.Message == input.Message ||
134+
(this.Message != null &&
135+
this.Message.Equals(input.Message))
136+
) &&
137+
(
138+
this.Details == input.Details ||
139+
(this.Details != null &&
140+
this.Details.Equals(input.Details))
141+
);
142+
}
143+
144+
/// <summary>
145+
/// Gets the hash code
146+
/// </summary>
147+
/// <returns>Hash code</returns>
148+
public override int GetHashCode()
149+
{
150+
unchecked // Overflow is fine, just wrap
151+
{
152+
int hashCode = 41;
153+
if (this.Code != null)
154+
hashCode = hashCode * 59 + this.Code.GetHashCode();
155+
if (this.Message != null)
156+
hashCode = hashCode * 59 + this.Message.GetHashCode();
157+
if (this.Details != null)
158+
hashCode = hashCode * 59 + this.Details.GetHashCode();
159+
return hashCode;
160+
}
161+
}
162+
163+
/// <summary>
164+
/// To validate all properties of the instance
165+
/// </summary>
166+
/// <param name="validationContext">Validation context</param>
167+
/// <returns>Validation Result</returns>
168+
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
169+
{
170+
yield break;
171+
}
172+
}
173+
174+
}
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
/*
2+
* Selling Partner API for Direct Fulfillment Inventory Updates
3+
*
4+
* The Selling Partner API for Direct Fulfillment Inventory Updates provides programmatic access to a direct fulfillment vendor's inventory updates.
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.Collections.Generic;
13+
using System.ComponentModel.DataAnnotations;
14+
using System.Runtime.Serialization;
15+
using System.Text;
16+
using Newtonsoft.Json;
17+
18+
namespace FikaAmazonAPI.AmazonSpApiSDK.Models.VendorDirectFulfillmentInventory
19+
{
20+
/// <summary>
21+
/// A list of error responses returned when a request is unsuccessful.
22+
/// </summary>
23+
[DataContract]
24+
public partial class ErrorList : List<Error>, IEquatable<ErrorList>, IValidatableObject
25+
{
26+
/// <summary>
27+
/// Initializes a new instance of the <see cref="ErrorList" /> class.
28+
/// </summary>
29+
[JsonConstructor]
30+
public ErrorList() : base()
31+
{
32+
}
33+
34+
/// <summary>
35+
/// Returns the string presentation of the object
36+
/// </summary>
37+
/// <returns>String presentation of the object</returns>
38+
public override string ToString()
39+
{
40+
var sb = new StringBuilder();
41+
sb.Append("class ErrorList {\n");
42+
sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n");
43+
sb.Append("}\n");
44+
return sb.ToString();
45+
}
46+
47+
/// <summary>
48+
/// Returns the JSON string presentation of the object
49+
/// </summary>
50+
/// <returns>JSON string presentation of the object</returns>
51+
public string ToJson()
52+
{
53+
return JsonConvert.SerializeObject(this, Formatting.Indented);
54+
}
55+
56+
/// <summary>
57+
/// Returns true if objects are equal
58+
/// </summary>
59+
/// <param name="input">Object to be compared</param>
60+
/// <returns>Boolean</returns>
61+
public override bool Equals(object input)
62+
{
63+
return this.Equals(input as ErrorList);
64+
}
65+
66+
/// <summary>
67+
/// Returns true if ErrorList instances are equal
68+
/// </summary>
69+
/// <param name="input">Instance of ErrorList to be compared</param>
70+
/// <returns>Boolean</returns>
71+
public bool Equals(ErrorList input)
72+
{
73+
if (input == null)
74+
return false;
75+
76+
return base.Equals(input);
77+
}
78+
79+
/// <summary>
80+
/// Gets the hash code
81+
/// </summary>
82+
/// <returns>Hash code</returns>
83+
public override int GetHashCode()
84+
{
85+
unchecked // Overflow is fine, just wrap
86+
{
87+
int hashCode = base.GetHashCode();
88+
return hashCode;
89+
}
90+
}
91+
92+
/// <summary>
93+
/// To validate all properties of the instance
94+
/// </summary>
95+
/// <param name="validationContext">Validation context</param>
96+
/// <returns>Validation Result</returns>
97+
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
98+
{
99+
yield break;
100+
}
101+
}
102+
103+
}

0 commit comments

Comments
 (0)