Skip to content

Commit 3b0a22a

Browse files
committed
added relativeTo & positionRelative parameters to Items.CreateAsync
1 parent effa92c commit 3b0a22a

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

MondayApi/Items/IItemActions.cs

+8-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,14 @@ Task<ItemsResponse> GetByBoardGroupAsync(string cursor, int numPerPage, string b
1515
Task<Item> GetOneAsync(string id,
1616
bool withColumnValues = false, IEnumerable<string> columnIDs = null);
1717

18-
Task<Item> CreateAsync(string itemName, string boardID, string groupID = null, IEnumerable<IColumnValue> columnValues = null, bool? createLabelsIfMissing = null);
18+
/// <param name="relativeTo">The unique identifier of the item you want to create the new one in relation to.</param>
19+
/// <param name="positionRelative">The desired position of the new item.
20+
/// <br /><see cref="PositionRelative.BeforeAt"/>: This enum value creates the new item above the <paramref name="relativeTo"/> value.
21+
/// If you don't use the <paramref name="relativeTo"/> argument, the new item will be created at the bottom of the first active group (unless you specify a group using <paramref name="groupID"/>).
22+
/// <br /><see cref="PositionRelative.AfterAt"/>: This enum value creates the new item below the <paramref name="relativeTo"/> value.
23+
/// If you don't use the <paramref name="relativeTo"/> argument, the new item will be created at the top of the first active group (unless you specify a group using <paramref name="groupID"/>).
24+
/// </param>
25+
Task<Item> CreateAsync(string itemName, string boardID, string groupID = null, IEnumerable<IColumnValue> columnValues = null, bool? createLabelsIfMissing = null, string relativeTo = null, PositionRelative? positionRelative = null);
1926
/// <summary>Allows creating multiple items with one request</summary>
2027
/// <param name="items">Items to be created. Properties used are <see cref="Item.Name"/>, <see cref="Item"/>.<see cref="Board.ID"/>, <see cref="Item"/>.<see cref="Group.ID"/> and <see cref="Item.ColumnValues"/></param>
2128
Task<IEnumerable<Item>> CreateMultipleAsync(IEnumerable<Item> items, bool? createLabelsIfMissing = null);

MondayApi/Items/ItemActions.cs

+7-2
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ public async Task<Item> GetOneAsync(string id, bool withColumnValues = false, IE
9696
return response.Items?.FirstOrDefault();
9797
}
9898

99-
public async Task<Item> CreateAsync(string itemName, string boardID, string groupID = null, IEnumerable<IColumnValue> columnValues = null, bool? createLabelsIfMissing = null) {
99+
/// <inheritdoc />
100+
public async Task<Item> CreateAsync(string itemName, string boardID, string groupID = null, IEnumerable<IColumnValue> columnValues = null,
101+
bool? createLabelsIfMissing = null, string relativeTo = null, PositionRelative? positionRelative = null
102+
) {
100103
Utils.Utils.RequireArgument(nameof(itemName), itemName);
101104
Utils.Utils.RequireArgument(nameof(boardID), boardID);
102105

@@ -106,7 +109,9 @@ public async Task<Item> CreateAsync(string itemName, string boardID, string grou
106109
boardID: boardID,
107110
groupID: groupID,
108111
columnValues: Utils.Utils.SerializeColumnValues(columnValues),
109-
createLabelsIfMissing: createLabelsIfMissing
112+
createLabelsIfMissing: createLabelsIfMissing,
113+
relativeTo: relativeTo,
114+
positionRelativeMethod: positionRelative
110115
);
111116

112117
var response = await client.RunMutation(mutation);

0 commit comments

Comments
 (0)