-
-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#292 Add support for the Manage order lines endpoint
- Loading branch information
1 parent
25e2386
commit cfd5fa4
Showing
5 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
Mollie.Api/Models/Order/Request/ManageOrderLinesRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace Mollie.Api.Models.Order.Request { | ||
public class ManageOrderLinesRequest { | ||
/// <summary> | ||
/// List of operations to be processed. | ||
/// </summary> | ||
public IList<ManageOrderLinesOperation> Operations { get; set; } | ||
} | ||
|
||
public static class OrderLineOperation { | ||
public const string Add = "add"; | ||
public const string Update = "update"; | ||
public const string Cancel = "cancel"; | ||
} | ||
|
||
public class ManageOrderLinesAddOperationData : OrderLineRequest { | ||
} | ||
|
||
public class ManageOrderLinesUpdateOperationData : OrderLineUpdateRequest { | ||
public string Id { get; set; } | ||
} | ||
|
||
public class ManagerOrderLinesCancelOperationData : OrderLineDetails { | ||
} | ||
|
||
public abstract class ManageOrderLinesOperation { | ||
/// <summary> | ||
/// Operation type. Either `add`, `update`, or `cancel`. | ||
/// </summary> | ||
public string Operation { get; protected set; } | ||
} | ||
|
||
public class ManageOrderLinesAddOperation : ManageOrderLinesOperation { | ||
public ManageOrderLinesAddOperationData Data { get; set; } | ||
|
||
public ManageOrderLinesAddOperation() { | ||
this.Operation = OrderLineOperation.Add; | ||
} | ||
} | ||
|
||
public class ManageOrderLinesUpdateOperation : ManageOrderLinesOperation { | ||
public ManageOrderLinesUpdateOperationData Data { get; set; } | ||
|
||
public ManageOrderLinesUpdateOperation() { | ||
this.Operation = OrderLineOperation.Update; | ||
} | ||
} | ||
|
||
public class ManageOrderLinesCancelOperation : ManageOrderLinesOperation { | ||
public ManagerOrderLinesCancelOperationData Data { get; set; } | ||
|
||
public ManageOrderLinesCancelOperation() { | ||
this.Operation = OrderLineOperation.Cancel; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters