Skip to content

Commit d50749e

Browse files
authored
Merge pull request #293 from IamGanesh19/main
Added support for Shipping API V2
2 parents 9eb56a9 + 8006268 commit d50749e

File tree

87 files changed

+4688
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+4688
-1
lines changed

Source/FikaAmazonAPI/AmazonConnection.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public class AmazonConnection
3434
public ServicesService Services => this._Services ?? throw _NoCredentials;
3535
public ShipmentInvoicingService ShipmentInvoicing => this._ShipmentInvoicing ?? throw _NoCredentials;
3636
public ShippingService Shipping => this._Shipping ?? throw _NoCredentials;
37+
public ShippingServiceV2 ShippingV2 => this._ShippingV2 ?? throw _NoCredentials;
3738
public UploadService Upload => this._Upload ?? throw _NoCredentials;
3839
public TokenService Tokens => this._Tokens ?? throw _NoCredentials;
3940
public FulFillmentInboundService FulFillmentInbound => this._FulFillmentInbound ?? throw _NoCredentials;
@@ -69,6 +70,7 @@ public class AmazonConnection
6970
private ServicesService _Services { get; set; }
7071
private ShipmentInvoicingService _ShipmentInvoicing { get; set; }
7172
private ShippingService _Shipping { get; set; }
73+
private ShippingServiceV2 _ShippingV2 { get; set; }
7274
private UploadService _Upload { get; set; }
7375

7476
private TokenService _Tokens { get; set; }
@@ -125,6 +127,7 @@ private void Init(AmazonCredential Credentials)
125127
this._Services = new ServicesService(this.Credentials);
126128
this._ShipmentInvoicing = new ShipmentInvoicingService(this.Credentials);
127129
this._Shipping = new ShippingService(this.Credentials);
130+
this._ShippingV2 = new ShippingServiceV2(this.Credentials);
128131
this._Upload = new UploadService(this.Credentials);
129132
this._Tokens = new TokenService(this.Credentials);
130133
this._FulFillmentInbound = new FulFillmentInboundService(this.Credentials);

Source/FikaAmazonAPI/AmazonCredential.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class AmazonCredential
1919
public bool IsActiveLimitRate { get; set; } = true;
2020
public Environments Environment { get; set; } = Environments.Production;
2121
public int MaxThrottledRetryCount { get; set; } = 3;
22-
22+
public ShippingBusiness? ShippingBusiness { get; set; }
2323

2424
public AmazonCredential()
2525
{
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
using System;
2+
using System.Text;
3+
using System.Collections;
4+
using System.Collections.Generic;
5+
using System.Runtime.Serialization;
6+
using Newtonsoft.Json;
7+
8+
namespace FikaAmazonAPI.AmazonSpApiSDK.Models.ShippingV2 {
9+
10+
/// <summary>
11+
/// The address.
12+
/// </summary>
13+
[DataContract]
14+
public class Address {
15+
/// <summary>
16+
/// The name of the person, business or institution at the address.
17+
/// </summary>
18+
/// <value>The name of the person, business or institution at the address.</value>
19+
[DataMember(Name="name", EmitDefaultValue=false)]
20+
[JsonProperty(PropertyName = "name")]
21+
public string Name { get; set; }
22+
23+
/// <summary>
24+
/// The first line of the address.
25+
/// </summary>
26+
/// <value>The first line of the address.</value>
27+
[DataMember(Name="addressLine1", EmitDefaultValue=false)]
28+
[JsonProperty(PropertyName = "addressLine1")]
29+
public string AddressLine1 { get; set; }
30+
31+
/// <summary>
32+
/// Additional address information, if required.
33+
/// </summary>
34+
/// <value>Additional address information, if required.</value>
35+
[DataMember(Name="addressLine2", EmitDefaultValue=false)]
36+
[JsonProperty(PropertyName = "addressLine2")]
37+
public string AddressLine2 { get; set; }
38+
39+
/// <summary>
40+
/// Additional address information, if required.
41+
/// </summary>
42+
/// <value>Additional address information, if required.</value>
43+
[DataMember(Name="addressLine3", EmitDefaultValue=false)]
44+
[JsonProperty(PropertyName = "addressLine3")]
45+
public string AddressLine3 { get; set; }
46+
47+
/// <summary>
48+
/// The name of the business or institution associated with the address.
49+
/// </summary>
50+
/// <value>The name of the business or institution associated with the address.</value>
51+
[DataMember(Name="companyName", EmitDefaultValue=false)]
52+
[JsonProperty(PropertyName = "companyName")]
53+
public string CompanyName { get; set; }
54+
55+
/// <summary>
56+
/// Gets or Sets StateOrRegion
57+
/// </summary>
58+
[DataMember(Name="stateOrRegion", EmitDefaultValue=false)]
59+
[JsonProperty(PropertyName = "stateOrRegion")]
60+
public string StateOrRegion { get; set; }
61+
62+
/// <summary>
63+
/// Gets or Sets City
64+
/// </summary>
65+
[DataMember(Name="city", EmitDefaultValue=false)]
66+
[JsonProperty(PropertyName = "city")]
67+
public string City { get; set; }
68+
69+
/// <summary>
70+
/// Gets or Sets CountryCode
71+
/// </summary>
72+
[DataMember(Name="countryCode", EmitDefaultValue=false)]
73+
[JsonProperty(PropertyName = "countryCode")]
74+
public string CountryCode { get; set; }
75+
76+
/// <summary>
77+
/// Gets or Sets PostalCode
78+
/// </summary>
79+
[DataMember(Name="postalCode", EmitDefaultValue=false)]
80+
[JsonProperty(PropertyName = "postalCode")]
81+
public string PostalCode { get; set; }
82+
83+
/// <summary>
84+
/// The email address of the contact associated with the address.
85+
/// </summary>
86+
/// <value>The email address of the contact associated with the address.</value>
87+
[DataMember(Name="email", EmitDefaultValue=false)]
88+
[JsonProperty(PropertyName = "email")]
89+
public string Email { get; set; }
90+
91+
/// <summary>
92+
/// The phone number of the person, business or institution located at that address, including the country calling code.
93+
/// </summary>
94+
/// <value>The phone number of the person, business or institution located at that address, including the country calling code.</value>
95+
[DataMember(Name="phoneNumber", EmitDefaultValue=false)]
96+
[JsonProperty(PropertyName = "phoneNumber")]
97+
public string PhoneNumber { get; set; }
98+
99+
100+
/// <summary>
101+
/// Get the string presentation of the object
102+
/// </summary>
103+
/// <returns>String presentation of the object</returns>
104+
public override string ToString() {
105+
var sb = new StringBuilder();
106+
sb.Append("class Address {\n");
107+
sb.Append(" Name: ").Append(Name).Append("\n");
108+
sb.Append(" AddressLine1: ").Append(AddressLine1).Append("\n");
109+
sb.Append(" AddressLine2: ").Append(AddressLine2).Append("\n");
110+
sb.Append(" AddressLine3: ").Append(AddressLine3).Append("\n");
111+
sb.Append(" CompanyName: ").Append(CompanyName).Append("\n");
112+
sb.Append(" StateOrRegion: ").Append(StateOrRegion).Append("\n");
113+
sb.Append(" City: ").Append(City).Append("\n");
114+
sb.Append(" CountryCode: ").Append(CountryCode).Append("\n");
115+
sb.Append(" PostalCode: ").Append(PostalCode).Append("\n");
116+
sb.Append(" Email: ").Append(Email).Append("\n");
117+
sb.Append(" PhoneNumber: ").Append(PhoneNumber).Append("\n");
118+
sb.Append("}\n");
119+
return sb.ToString();
120+
}
121+
122+
/// <summary>
123+
/// Get the JSON string presentation of the object
124+
/// </summary>
125+
/// <returns>JSON string presentation of the object</returns>
126+
public string ToJson() {
127+
return JsonConvert.SerializeObject(this, Formatting.Indented);
128+
}
129+
130+
}
131+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System;
2+
using System.Text;
3+
using System.Collections;
4+
using System.Collections.Generic;
5+
using System.Runtime.Serialization;
6+
using Newtonsoft.Json;
7+
8+
namespace FikaAmazonAPI.AmazonSpApiSDK.Models.ShippingV2 {
9+
10+
/// <summary>
11+
/// The carrier generated reverse identifier for a returned package in a purchased shipment.
12+
/// </summary>
13+
[DataContract]
14+
public class AlternateLegTrackingId {
15+
16+
/// <summary>
17+
/// Get the string presentation of the object
18+
/// </summary>
19+
/// <returns>String presentation of the object</returns>
20+
public override string ToString() {
21+
var sb = new StringBuilder();
22+
sb.Append("class AlternateLegTrackingId {\n");
23+
sb.Append("}\n");
24+
return sb.ToString();
25+
}
26+
27+
/// <summary>
28+
/// Get the JSON string presentation of the object
29+
/// </summary>
30+
/// <returns>JSON string presentation of the object</returns>
31+
public string ToJson() {
32+
return JsonConvert.SerializeObject(this, Formatting.Indented);
33+
}
34+
35+
}
36+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
using System;
2+
using System.Text;
3+
using System.Collections;
4+
using System.Collections.Generic;
5+
using System.Runtime.Serialization;
6+
using Newtonsoft.Json;
7+
8+
namespace FikaAmazonAPI.AmazonSpApiSDK.Models.ShippingV2 {
9+
10+
/// <summary>
11+
/// Amazon order information. This is required if the shipment source channel is Amazon.
12+
/// </summary>
13+
[DataContract]
14+
public class AmazonOrderDetails {
15+
/// <summary>
16+
/// The Amazon order ID associated with the Amazon order fulfilled by this shipment.
17+
/// </summary>
18+
/// <value>The Amazon order ID associated with the Amazon order fulfilled by this shipment.</value>
19+
[DataMember(Name="orderId", EmitDefaultValue=false)]
20+
[JsonProperty(PropertyName = "orderId")]
21+
public string OrderId { get; set; }
22+
23+
24+
/// <summary>
25+
/// Get the string presentation of the object
26+
/// </summary>
27+
/// <returns>String presentation of the object</returns>
28+
public override string ToString() {
29+
var sb = new StringBuilder();
30+
sb.Append("class AmazonOrderDetails {\n");
31+
sb.Append(" OrderId: ").Append(OrderId).Append("\n");
32+
sb.Append("}\n");
33+
return sb.ToString();
34+
}
35+
36+
/// <summary>
37+
/// Get the JSON string presentation of the object
38+
/// </summary>
39+
/// <returns>JSON string presentation of the object</returns>
40+
public string ToJson() {
41+
return JsonConvert.SerializeObject(this, Formatting.Indented);
42+
}
43+
44+
}
45+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
using System;
2+
using System.Text;
3+
using System.Collections;
4+
using System.Collections.Generic;
5+
using System.Runtime.Serialization;
6+
using Newtonsoft.Json;
7+
8+
namespace FikaAmazonAPI.AmazonSpApiSDK.Models.ShippingV2 {
9+
10+
/// <summary>
11+
/// Amazon shipment information.
12+
/// </summary>
13+
[DataContract]
14+
public class AmazonShipmentDetails {
15+
/// <summary>
16+
/// This attribute is required only for a Direct Fulfillment shipment. This is the encrypted shipment ID.
17+
/// </summary>
18+
/// <value>This attribute is required only for a Direct Fulfillment shipment. This is the encrypted shipment ID.</value>
19+
[DataMember(Name="shipmentId", EmitDefaultValue=false)]
20+
[JsonProperty(PropertyName = "shipmentId")]
21+
public string ShipmentId { get; set; }
22+
23+
24+
/// <summary>
25+
/// Get the string presentation of the object
26+
/// </summary>
27+
/// <returns>String presentation of the object</returns>
28+
public override string ToString() {
29+
var sb = new StringBuilder();
30+
sb.Append("class AmazonShipmentDetails {\n");
31+
sb.Append(" ShipmentId: ").Append(ShipmentId).Append("\n");
32+
sb.Append("}\n");
33+
return sb.ToString();
34+
}
35+
36+
/// <summary>
37+
/// Get the JSON string presentation of the object
38+
/// </summary>
39+
/// <returns>JSON string presentation of the object</returns>
40+
public string ToJson() {
41+
return JsonConvert.SerializeObject(this, Formatting.Indented);
42+
}
43+
44+
}
45+
}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
using System;
2+
using System.Text;
3+
using System.Collections;
4+
using System.Collections.Generic;
5+
using System.Runtime.Serialization;
6+
using Newtonsoft.Json;
7+
8+
namespace FikaAmazonAPI.AmazonSpApiSDK.Models.ShippingV2 {
9+
10+
/// <summary>
11+
/// The value-added services available for purchase with a shipping service offering.
12+
/// </summary>
13+
[DataContract]
14+
public class AvailableValueAddedServiceGroup {
15+
/// <summary>
16+
/// The type of the value-added service group.
17+
/// </summary>
18+
/// <value>The type of the value-added service group.</value>
19+
[DataMember(Name="groupId", EmitDefaultValue=false)]
20+
[JsonProperty(PropertyName = "groupId")]
21+
public string GroupId { get; set; }
22+
23+
/// <summary>
24+
/// The name of the value-added service group.
25+
/// </summary>
26+
/// <value>The name of the value-added service group.</value>
27+
[DataMember(Name="groupDescription", EmitDefaultValue=false)]
28+
[JsonProperty(PropertyName = "groupDescription")]
29+
public string GroupDescription { get; set; }
30+
31+
/// <summary>
32+
/// When true, one or more of the value-added services listed must be specified.
33+
/// </summary>
34+
/// <value>When true, one or more of the value-added services listed must be specified.</value>
35+
[DataMember(Name="isRequired", EmitDefaultValue=false)]
36+
[JsonProperty(PropertyName = "isRequired")]
37+
public bool? IsRequired { get; set; }
38+
39+
/// <summary>
40+
/// A list of optional value-added services available for purchase with a shipping service offering.
41+
/// </summary>
42+
/// <value>A list of optional value-added services available for purchase with a shipping service offering.</value>
43+
[DataMember(Name="valueAddedServices", EmitDefaultValue=false)]
44+
[JsonProperty(PropertyName = "valueAddedServices")]
45+
public List<ValueAddedService> ValueAddedServices { get; set; }
46+
47+
48+
/// <summary>
49+
/// Get the string presentation of the object
50+
/// </summary>
51+
/// <returns>String presentation of the object</returns>
52+
public override string ToString() {
53+
var sb = new StringBuilder();
54+
sb.Append("class AvailableValueAddedServiceGroup {\n");
55+
sb.Append(" GroupId: ").Append(GroupId).Append("\n");
56+
sb.Append(" GroupDescription: ").Append(GroupDescription).Append("\n");
57+
sb.Append(" IsRequired: ").Append(IsRequired).Append("\n");
58+
sb.Append(" ValueAddedServices: ").Append(ValueAddedServices).Append("\n");
59+
sb.Append("}\n");
60+
return sb.ToString();
61+
}
62+
63+
/// <summary>
64+
/// Get the JSON string presentation of the object
65+
/// </summary>
66+
/// <returns>JSON string presentation of the object</returns>
67+
public string ToJson() {
68+
return JsonConvert.SerializeObject(this, Formatting.Indented);
69+
}
70+
71+
}
72+
}

0 commit comments

Comments
 (0)